Closed nadezhday closed 4 years ago
Fixed indirectly. 'Lexical Entries roles...' command is not available for unauthorized users anymore.
The problem is not fixed.
Here is the scenario to reproduce the exception: Open http://83.149.198.62/dictionary/2774/31/perspective/2774/35/view -Sign in. -Select LexicalEntries->Lexical Entries roles... command
Exceptions: 1) Unhandled (in react-apollo) e@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:700330 f</e.prototype.currentResult@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:688942 i/a</l.prototype.dataForChild@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:70300 i/a</l.prototype.render@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:71140 lr@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1259242 sr@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1259037 zl@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1323770 ei@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1284013 Jr@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1283936 qr@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1280906 Ke/<@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1237604 e.unstablerunWithPriority@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1333026 qe@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1237314 Ke@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1237552 Ge@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1237485 Fr@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1277666 enqueueForceUpdate@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1317173 i.prototype.forceUpdate@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:1209406 i/a</l.prototype.forceRenderChildren@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:69523 e@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:69034 n@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:69115 d@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5215791 h@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5216135 value@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5217218 error/<@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:694382 error@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:694344 </t.prototype.queryListenerForObserver/<@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5234306 </t.prototype.broadcastQueries/</<@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5240636 </t.prototype.broadcastQueries/<@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5240615 _</t.prototype.broadcastQueries@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5240522 next@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5241695 d@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5215742 h@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5216135 value@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5217154 next/<@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5244708 next@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5244681 d@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5215742 h@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5216135 value@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5217154 next@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5280459 d@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5215742 h@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5216135 value@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5217154 l/</</<@http://83.149.198.62/assets/vendor.1c2f3f04.js:1:5277519
2) TypeError: r[a] is undefinedcomponent.js:139:51 value component.js:139 React 6 qr self-hosted:920 Ke React unstable_runWithPriority scheduler.production.min.js:19 React 6 forceRenderChildren react-apollo.browser.umd.js:529 e react-apollo.browser.umd.js:504 n react-apollo.browser.umd.js:508 d Observable.js:130 h Observable.js:161 value Observable.js:220 error ObservableQuery.js:332 forEach self-hosted:235 error ObservableQuery.js:332 queryListenerForObserver QueryManager.js:342 broadcastQueries QueryManager.js:710 forEach self-hosted:235 broadcastQueries QueryManager.js:709 forEach self-hosted:1197 broadcastQueries QueryManager.js:704 next QueryManager.js:761 d Observable.js:126 h Observable.js:161 value Observable.js:215 value self-hosted:876 next dedupLink.js:60 forEach self-hosted:235 next dedupLink.js:60 d Observable.js:126 h Observable.js:161 value Observable.js:215 next index.js:37 d Observable.js:126 h Observable.js:161 value Observable.js:215 l index.js:91
Exception occurs when logged on as non-administrator only.
Frontend exception has been fixed. Backend error message is displayed now informing that user does not have necessary permissions. I would suggest to create a new issue for improving this error message since it does not look user friendly.
Verification: scenario from description works - OK
But if you repeat step "Select LexicalEntries->Lexical Entries roles... command" one more time then you will get empty dialog. This problem will be reported in another case.
Additional cases are created: 1) https://github.com/ispras/lingvodoc-react/issues/202 LexicalEntries->Lexical Entries roles... command: Empty dialog 2) https://github.com/ispras/lingvodoc-react/issues/201 Improve error message "user does not have necessary permissions".
While writing selenium tests I found a bug. 1 step if login as non-administrator, then go to /dictionary/2774/31/perspective/2774/35/view then Lexical Entries -> Lexical Entries roles ... then a message "GraphQL error: Client 3069 doesn't have 'view' permissions for 'perspective_role' [2774, 35]." appear.
2 step Then sign out and sign in as administrator. Then go to /dictionary/482/4/perspective/482/5/view then Lexical Entries -> Lexical Entries roles ... then the list of roles will be empty.
But if you perform the second step immediately without the first one the list of roles will not be empty.
Do I need to create an issue on this?
It is not reproduced at the moment
Covered in tests/test_view_lexical_roles.py
-Open test-lingvodoc
-Sign in. -Select LexicalEntries->Lexical Entries roles... command Problem: Dialog is not opened, Error is not readable. The only way to interact with the page is to reload it. Console: Unhandled (in react-apollo) e@http://../assets/vendor.a5f59d47.js:1:681133 f</e.prototype.currentResult@http://.../assets/vendor.a5f59d47.js:1:669746 l/</</<@http://../assets/vendor.a5f59d47.js:1:5115687 raven.js:55:31 b raven.js:55 s react-apollo.browser.umd.js:566 d raven.js:393
TypeError: "r[a] is undefined" value component.js:139 React 11 forceRenderChildren react-apollo.browser.umd.js:529 e react-apollo.browser.umd.js:504 n react-apollo.browser.umd.js:508 d Observable.js:130 h Observable.js:161 value Observable.js:220 error ObservableQuery.js:332 error ObservableQuery.js:332 queryListenerForObserver QueryManager.js:342 broadcastQueries QueryManager.js:710 broadcastQueries QueryManager.js:709 broadcastQueries QueryManager.js:704 next QueryManager.js:761 d Observable.js:126 h Observable.js:161 value Observable.js:215 next dedupLink.js:60 next dedupLink.js:60 d Observable.js:126 h Observable.js:161 value Observable.js:215 next index.js:37 d Observable.js:126 h Observable.js:161 value Observable.js:215 l index.js:91