Page MenuHomePhabricator

VisualEditor: Return of the invalid token on save attempt problem?
Closed, ResolvedPublic

Description

(This sounds exactly like bug 50424, but that was marked fixed on 2013-07-15 with "deployed within the hour".)

I had made source edits to a mediawiki.org page over https. Looking at it 30+ minutes later I wanted to make one more quick edit, so I clicked [Edit]. VE worked fine, Save dialog, [Review your changes] worked, but the final [Save page] drew blue bars before doing nothing.

Firebug's network console showed the API requst visualeditoredit with

basetimestamp	20130723212405
format	json
minor	1
oldid	745108
page	Manual:How_to_debug
starttimestamp	20130723232059

was failing with

{"servedby":"mw1139","error":{"code":"badtoken","info":"Invalid token"}}

I had a similar occurrence a few days ago where the API reported badtoken. I can't remember the specifics of that, but I assumed it was my mistake because I was using multiple accounts on different wikis. This time I wasn't doing anything special. Connecting to https://www.mediawiki.org/wiki/Special:Version in another tab shows me as still logged in.

Maybe there are two bugs here: VE's inability to recover from this, and the lack of a "VE had an internal error" with suggestion as to how to what to do (e.g. copy the right-hand column of [Review changes]. Regarding the former, when I've lost state with source editing I usually find [Show preview] brings it back, maybe VE can implement something like this internally.


Version: unspecified
Severity: normal

Details

Reference
bz51915

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:05 AM
bzimport set Reference to bz51915.

When the API responds with badtoken, VE *should* refetch the token and try again. I'm fairly sure that was implemented, but not 100% sure.

(In reply to comment #1)
FWIW when I investigated this by clicking the final [Save page] again, I only saw the one visualeditoredit API request in Firebug's Network tab.

en.wp editor Rpyle731 has just reported an occurrence of this:
"While putting in stub templates in article "[[Zhang Shi (prince)]]" using the visual editor, when trying to save I got the text

"Error loading data from server. Unsuccessful request: Invalid token.""

mael.leguevel wrote:

I had the same message with the following scenario:
Edit an article, not logged in. Then, log in from another tab. Trying to save the article from the first tab, I get the same error message.

This was fixed in gerrit 76859 which was merged yesterday and will go out today.