Page MenuHomePhabricator

Save dialog gets stuck when trying to save while logged out on a private wiki
Closed, ResolvedPublic1 Estimated Story Points

Description

  1. Log into a private wiki
  2. Open VE
  3. Make some changes
  4. In another tab, log out (or get logged out accidentally because of session management bugs)
  5. Try to save
  6. Save dialog gets stuck. "Resume editing" doesn't close it, only escape does
  7. Log back in in another tab
  8. Save dialog is still stuck and you can't get it unstuck
  9. Switching to source mode is the only way to rescue your edit

On the network level, the serializeforcachekey request gets back a readapidenied error, and that seems to be what causes things to get stuck.

Event Timeline

So what actually happens is VE sends a visualeditoredit API request, which for some strange reason doesn't fail with readapidenied (to be fair, visualeditoredit is not a read API) but fails with badtoken(!). This causes a request for a new token to be sent, which fails with readapidenied. That failure doesn't seem to be handled, and the save dialog gets stuck in the pending state.

Trying to view the diff does fail with a readapidenied error in an alert box and returns the save dialog to its normal state.

Change 275148 had a related patch set uploaded (by Catrope):
Handle API errors when refetching the edit token

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

Jdforrester-WMF assigned this task to Catrope.
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.

Change 275148 merged by jenkins-bot:
Handle API errors when refetching the edit token

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