Page MenuHomePhabricator

?oldid=mostRecentRevId causes strange behavior on second edit
Closed, ResolvedPublic8 Estimated Story Points

Description

  1. Go to /wiki/Some_page?oldid=123 where 123 is the oldid of the most recent revision (e.g. https://en.wikipedia.org/w/index.php?title=User:Roan_Kattouw_(WMF)/Sandbox&oldid=731550113 ; go to the history and click the topmost timestamp)
  2. Click the edit tab to open VE
  3. Make changes
  4. Save
  5. Click edit again
  6. Be surprised that you're in oldid mode and don't see the changes you just made

If you do this with any other oldid (i.e. the ID of an actually-old revision), you will now be editing the most recent revision of the page. However, because the oldid is the most recent ID, VE gets confused and goes into oldid mode. We should never be in oldid mode on the second edit.

Event Timeline

Turns out Timo realized something was wrong when he wrote this code back in 2013: https://gerrit.wikimedia.org/r/#/c/72070/12/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js@402 (that comment is still there in DesktopArticleTarget#saveComplete)

Change 301056 had a related patch set uploaded (by Catrope):
Reduce mayhem caused by ?oldid=currentRevId

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

Change 301056 merged by jenkins-bot:
Reduce mayhem caused by ?oldid=currentRevId

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

Jdforrester-WMF assigned this task to Catrope.
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF set the point value for this task to 8.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.