Last modified: 2014-08-28 16:05:43 UTC
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
I don't see how an assert would help (unless you are on a wiki which allows anonymous uploads).
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.
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.