Page MenuHomePhabricator

Ability to recover from an Expired session (badtoken)
Closed, ResolvedPublic

Description

Reports of user getting the badtoken API error. This was traced back by the user to the user's session having expired during the steps of the upload.

The wizard (and much of our JS/API/UI btw) does not really handle expired sessions nicely, probably an area where we need to improve. I believe we have an 'assert' for this on the API nowadays ? Perhaps it needs to be used by the UW api calls.

https://commons.wikimedia.org/wiki/Commons:Upload_Wizard_feedback#Internal_error:_bad_token


Version: master
Severity: normal

Details

Reference
bz69691

Event Timeline

bzimport raised the priority of this task from to Needs Triage.
bzimport set Reference to bz69691.
bzimport added a subscriber: Unknown Object (MLST).
TheDJ created this task.Aug 18 2014, 12:23 PM
Tgr added a comment.Aug 18 2014, 1:01 PM

I don't see how an assert would help (unless you are on a wiki which allows anonymous uploads).

TheDJ added a comment.Aug 18 2014, 1:34 PM

I think what the user here is after is consistency. So if he enters as a logged in user, he expects to upload and finish all the steps as a user as well. So when we start, check if user is logged in, if he is, add "assert=user", if assert fails, see if we can help the user log in again.

Tgr added a comment.Aug 18 2014, 1:40 PM

Anonymous uploads are disallowed though (actually UW does not work without logging in even if you allow them - that's a separate bug), so AFAIK the only difference an assert makes is that the API error will be assertuserfail instead of badtoken.

A more helpful error message linking (with target=_blank) to the login page would certainly be helpful.

Maybe something like bug 69314 can be done in UploadWizard as well?

See also bug 69596.

Gilles triaged this task as Normal priority.Nov 24 2014, 2:04 PM
Gilles added a subscriber: Gilles.
Tgr removed a subscriber: Tgr.
Tgr added a subscriber: Tgr.
Tgr added subscribers: Aklapper, MingleTerminator.
Steinsplitter moved this task from Incoming to Uploading on the Commons board.
matmarex renamed this task from Ability to recover from an Expired session to Ability to recover from an Expired session (badtoken).Apr 30 2015, 11:42 PM
matmarex set Security to None.
matmarex edited subscribers, added: matmarex; removed: MingleTerminator, Unknown Object (MLST).

Wow, this really should have had higher priority.

Change 208043 had a related patch set uploaded (by Bartosz Dziewoński):
mediawiki.api: Add #badToken for invalidating bad cached tokens

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

Change 208044 had a related patch set uploaded (by Bartosz Dziewoński):
Recover from 'badtoken' error when uploading

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

Gilles removed a subscriber: Gilles.May 4 2015, 9:40 AM
Jdforrester-WMF raised the priority of this task from Normal to High.May 5 2015, 3:57 PM

Change 208043 merged by jenkins-bot:
mediawiki.api: Add #badToken for invalidating bad cached tokens

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

Change 208044 merged by jenkins-bot:
Recover from 'badtoken' error when uploading

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

I assume we need one more patch once the blocker is fixed?

matmarex closed this task as Resolved.May 6 2015, 8:01 AM

I think this is actually all, the core patch and the UploadWizard patch.

It will be interesting to monitor the impact of this fix on upload errors: where are they graphed now? http://multimedia-metrics.wmflabs.org/ doesn't load any graph/datasource. http://datasets.wikimedia.org/public-datasets/all/multimedia/upload-wizard-funnel-absolute.tsv works though.

Change 238325 had a related patch set uploaded (by Bartosz Dziewoński):
Really recover from 'badtoken' error when uploading

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

Restricted Application added a subscriber: Matanya. · View Herald TranscriptSep 14 2015, 9:16 PM

Change 238334 had a related patch set uploaded (by MarkTraceur):
Really recover from 'badtoken' error when uploading

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

Change 238325 merged by jenkins-bot:
Really recover from 'badtoken' error when uploading

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

Change 238334 merged by jenkins-bot:
Really recover from 'badtoken' error when uploading

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