Page MenuHomePhabricator

Visual Editor: "Changes recovered: Your unsaved changes have been automatically recovered." - creates edit conflicts that are NOT detected and allows subsequent edits to be lost!
Closed, ResolvedPublic

Description

I was using the Visual Editor to update the article

https://en.wikipedia.org/wiki/Stephen_Andrew_(politician)

I made some changes but then realised that the changes involved the wrong URL so I backed out of the edit by clicking Article. It asked the Leave/Stay question and I said Leave.

So I tracked down the right URL and then source-edited the article (no particular reason for choice of source mode, just did, I am fluent in both). I made the changes I wanted to and Saved. I then went into Visual Editor again and it seemed like the changes I had saved hadn't been. I went back, looked at the History, and the versions there and everything seemed OK. I started the VE again, same thing, I was seeing the aborted edit. Then I noticed up in the top right the little box that said "Changes recovered: Your unsaved changes have been automatically recovered." Nothing I could do would open the current version of the file in VE (I logged out and I logged in again, I made a trvial changes using the source editor.). So I tried to see what happened if I saved those abandoned changes, and yep, it saved them, over the top of subsequent edits.

So there appear to be two big problems here.

  1. I cannot abort a VE edit! because if I do, I can never use the VE again on that article untiI I publish it!
  1. Publishing the abandoned edit overrides all subsequent edits without creating an edit conflict.

The capacity to do damage here is incredible. How many minutes/hours/days/weeks later might the VE user restart an aborted edit and unintentionally overwrite all subsequent edits? How many times has it already happened? I noticed because the article was quite small and there was lots of whitespace around my aborted edit, but if the changes had occurred inside a more "text-heavy" area, then I may not have noticed it.

This is the version of the article when I opened it in VE, started making changes, realised the URL was wrong, then aborted it:

https://en.wikipedia.org/w/index.php?title=Stephen_Andrew_(politician)&oldid=829642330

This is the version of the article I created with my subsequent source edit (fixing the URL and presenting it as a cite web}}

https://en.wikipedia.org/w/index.php?title=Stephen_Andrew_(politician)&diff=next&oldid=829642330

This is the version I then opened in VE and got the "Changes recovered". I aborted the VE edit . I reattempted opening in VE a few times, same problem, aborted each time.

This is the version of me doing another source edit (just for testing purposes, added a space).

https://en.wikipedia.org/w/index.php?title=Stephen_Andrew_(politician)&oldid=829643890

Again I re-entered VE and got the "Changes recovered". Now thinking, if I save this, will it stop me or give me an edit conflict. So I saved it. The VE happily saved it and there was no edit conflict. And yes I had just overwritten my previous two source edits.

https://en.wikipedia.org/w/index.php?title=Stephen_Andrew_(politician)&oldid=829645123

I then used "undo" to roll it back to a good version.

https://en.wikipedia.org/w/index.php?title=Stephen_Andrew_(politician)&oldid=829645177

I can now open the article in VE without the "Changes recovered".

I think this new feature needs to be turned off until it has been fixed in two important ways:

  1. it will not operate in "edit conflict" situation (i.e. where the aborted edit does not apply to the last version of the article)
  1. even if the aborted edit does apply to the last version of the article, the user must be allowed to click something to say "no, I don't want my changes recovered -- I aborted for a very good reason, it was no accident".

In the above, "save" = "publish"

Event Timeline

And I think the logs need to be examined to see if any other articles have been affected by the publishing of an aborted VE edits after other edits, as they will need to have the edits manually merged.

I made some changes but then realised that the changes involved the wrong URL so I backed out of the edit by clicking Article. It asked the Leave/Stay question and I said Leave.
I cannot abort a VE edit! because if I do, I can never use the VE again on that article untiI I publish it!

Clicking 'article' navigates you off the page, which means you don't have the chance to delete you auto-saved changes (no JS is executed after the stay/leave system dialog). We could probably add some bindings to the 'Article' button, but there will always be ways for people to leave the editor without discarding their changes.

Currently if you use the 'Read' tab or press 'esc' you will get a local dialog to discard your changes, and they will be removed form auto-save.

So I tracked down the right URL and then source-edited the article

We need to add some code to the 2010 editor to invalidate VE's autosave.

it will not operate in "edit conflict" situation (i.e. where the aborted edit does not apply to the last version of the article)

Auto-save just recovers the state of the document when you loaded, and your subsequent changes, so it should behave no differently than a regular edit conflict.

Article tab issue: T189380
2010WTE switch issue: T189381

The VE happily saved it and there was no edit conflict. And yes I had just overwritten my previous two source edits.

This appears to be happening independently of the auto-save feature. Filed as T189387.

Edit: Actually I think this is just because you conflicted with yourself, from the edit API documentation: "Note: Edit conflicts will be ignored if you are conflicting with the current user."

With the the other two issues fixed I think that should address all the concerns here.

When I train with the VE, it is a common question "how do I get out of this edit and start over".

I tell them to click Article as in the past both of these have worked for me and have worked identically. The advantage of Article over Read is that Article is in a very predictable place on the screen (left of the tool bar) whereas Read is not as it positions itself relative to the screen width. This is a particular problem when I am supporting new users remotely (note that I do support of new people not just here in Queensland but also through the USA Public Library network). It is much easier to say "click on the Article tab, top left next to the Wikipedia Globe" than attempt to explain where Read is likely to be.

However, they often respond with "that's not obvious" because expect to find some kind of Cancel/Exit button on the tool bar as an alternative to the Publish button (this is probably because of the way other tools like Microsoft Word works). And I can't blame them for saying that because semantically you are thinking "I want to terminate this edit without publishing", not "I want to read the article". It would be much better if we had the Cancel/Edit button with a clear semantics.

Another issue about VE showing older version of page reported at https://www.mediawiki.org/wiki/Topic:U96jvxbu5yyjb67g
Similar complain as the discussion Erica linked to.

However, they often respond with "that's not obvious" because expect to find some kind of Cancel/Exit button on the tool bar as an alternative to the Publish button (this is probably because of the way other tools like Microsoft Word works).

There is a task asking for this, T85470: Users are requesting a "Cancel and exit without saving" option.

Article tab issue: T189380
2010WTE switch issue: T189381

With [these] two issues fixed I think that should address all the concerns here.

@Esanders Do you think this is resolved then? Patch https://gerrit.wikimedia.org/r/#/c/419169/ looks like it might have been related to this task?

I think so - that patch relates to something discussed on the original autosave task, that we should file a separate bug for.

Esanders claimed this task.