Page MenuHomePhabricator

Add error-handling to commons-selection.js
Closed, ResolvedPublic

Description

If MediaWiki API replies with an error, commons-selection.js can't deal with it. The user then sees "Loading..." forever. An error message would do. The error message should recommend disconnecting and reconnecting of Wikimedia account.

Example error reply, happens when user have old OAuth token.

{"error":{"code":"mwoauth-invalid-authorization","info":"The authorization headers in your request are not valid: No approved grant was found for that authorization token.","*":"See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"mw1228"}

Details

Related Gerrit Patches:

Event Timeline

Urbanecm created this task.May 8 2019, 11:18 AM
Urbanecm triaged this task as Medium priority.
Urbanecm moved this task from Inbox to Bugs on the WMCZ-Tracker board.

Per IRC.

Change 509637 had a related patch set uploaded (by Shreyasminocha; owner: Shreyasminocha):
[wikimedia-cz/tracker@master] Add error handling to Commons selection interface

https://gerrit.wikimedia.org/r/509637

Change 529615 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[wikimedia-cz/tracker@master] Add error handling to commons-selection.js

https://gerrit.wikimedia.org/r/529615

Change 509637 abandoned by Urbanecm:
Add error handling to Commons selection interface

Reason:
submitted https://gerrit.wikimedia.org/r/c/wikimedia-cz/tracker/ /529615 instead

https://gerrit.wikimedia.org/r/509637

Urbanecm claimed this task.Aug 11 2019, 7:53 PM
Urbanecm added a subscriber: Shreyasminocha.
Restricted Application added a project: User-Urbanecm. · View Herald TranscriptAug 11 2019, 7:53 PM

Change 529615 merged by jenkins-bot:
[wikimedia-cz/tracker@master] Add error handling to commons-selection.js

https://gerrit.wikimedia.org/r/529615

Urbanecm closed this task as Resolved.Aug 11 2019, 7:54 PM

Apologies for not being able to make the changes you pointed out recently in time.
Thanks for completing this.

No problem, I totally understand you have a lot of things to do :-). When doing T229269, I introduced a bug, which I fixed in https://gerrit.wikimedia.org/r/c/wikimedia-cz/tracker/+/529477, but for users it was like "nothing is happening", so I added a try catch to catch all possible fatals. Feel free to add more descriptive errors if you feel it's needed :-).