What is the problem?
I have noticed a few times when clicking "Discard changes" in the Edit Recovery popup that the wikitext remains unchanged, rather than reverting to the current revision of the article.
It does clear the data from IndexedDB, although a user might not realise that this has been done if the wikitext has not changed.
I believe it is because my browser is recovering the unsaved edits I made before Edit Recovery does. I am guessing that makes Edit Recovery think my unsaved edits are the original state of the article. Therefore, clicking "Discard changes" does not restore the correct thing.
Times I have seen this:
- When doing a "soft" refresh on Firefox
- When closing and reopening a tab (with ctrl+shift+t) on Firefox
- Restoring tabs after closing and reopening Firefox
- Sometimes when restoring tabs after I have simulated a crash on Firefox (by doing kill on the process)
I have yet to see this on Chromium. I don't know about other browsers.
I am not sure what we want to do in this case and whether there may be other interactions between Edit Recovery and the browser's native data recovery.
Steps to reproduce problem
- In Firefox, open a new tab and go to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=PhonosTest-211&action=edit
- Make an edit
- Close the tab
- Restore the tab (ctrl+shift+t)
- In the "Changes recovered" popup, click "Discard changes"
Expected behaviour: Wikitext is restored to the state it was in step 1.
Observed behaviour: Wikitext is not changed. The edit you made in step 2 remains.
Environment
Browser: Firefox 115 and 119.
Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.42.0-alpha (b2d4fd5) 14:40, 22 November 2023.
Editor: WikiEditor 0.5.4 (68da956) 07:21, 22 November 2023.
QA Results - Beta & Local
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | https://phabricator.wikimedia.org/T351821 here |