Page MenuHomePhabricator

Edit Recovery data does not get deleted on save
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
Soda
Nov 13 2023, 2:25 PM
Referenced Files
F41509088: 2023-11-15_15-13-10.png
Nov 15 2023, 11:31 PM
F41509071: 2023-11-15_15-12-23.png
Nov 15 2023, 11:31 PM
F41508567: 2023-11-15_08-56-05.png
Nov 15 2023, 11:31 PM
F41508565: 2023-11-15_08-55-47.png
Nov 15 2023, 11:31 PM
F41508539: 2023-11-15_08-54-21.png
Nov 15 2023, 11:31 PM
F41508533: 2023-11-15_08-54-15.png
Nov 15 2023, 11:31 PM
F41508522: 2023-11-15_08-53-24.png
Nov 15 2023, 11:31 PM
F41508520: 2023-11-15_08-53-19.png
Nov 15 2023, 11:31 PM

Description

Steps to replicate the issue (include links if applicable):

  • Edit a page
  • Save the edit and wait for the edit save toast to appear
  • Open the edit screen again

What happens?:
The edit recovery toast appears

What should have happened instead?:
The edit recovery toast should not appear

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

QA Results - Beta

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 973810 had a related patch set uploaded (by Sohom Datta; author: Sohom Datta):

[mediawiki/core@master] Fix editRecovery data not being deleted on save

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

TheresNoTime added a subscriber: TheresNoTime.

thank you for the patch, will review shortly :-)

thank you for the patch, will review shortly :-)

Sure no issues, it caught my eye and ended up being a fun rabbit hole to get into :)

Change 973810 merged by jenkins-bot:

[mediawiki/core@master] Fix editRecovery data not being deleted on save

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

@TheresNoTime and @Samwilson Edit Recovery popup does now show once the edit is published as seen in the .webm file below but can you take a look at the Possible Issue section and let me know what you think?

Status: ❓NMI
Environment: Beta: 1.42.0-alpha (5a624a4)
OS: macOS Sonoma 14.0
Browser: Chrome 119, Firefox 119, Safari 17.0
Skins. Vector 2022, 2010, Minerva, Monobook, Timeless
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://en.wikipedia.beta.wmflabs.org/wiki/Dingo

❓AC1: https://phabricator.wikimedia.org/T351090

Possible Issue
Publish edit Safari vs Firefox- I created an edit for Safari with "This is a test" and Firefox with "This might be a test?". Edit recovery is saved on both. On Safari, I published the edit with "This is a test". I went back to Safari which has not had the edit recovery popup screen since it was published. I now go to Firefox which shows the article being updated in the View History. When I click on edit article, it doesn't show the Safari update but only the edit recovery from what I had earlier with "This might be a test?" Shouldn't Firefox show the change from Safari since the edit was published and show it in Firefox View History that it should be updated?

ScreenSafariFirefox
View History
2023-11-14_15-26-33.png (641×1 px, 209 KB)
2023-11-14_15-26-49.png (967×1 px, 348 KB)
Edit
2023-11-14_15-25-37.png (1×1 px, 491 KB)
2023-11-14_15-25-57.png (1×1 px, 594 KB)

Thanks @GMikesell-WMF that's very interesting: so just to clarify, am I understanding the flow correctly:

  1. Start editing on Safari, and save a change.
  2. Start editing on Firefox, and close the tab without saving.
  3. Open the same page for editing in Firefox, and note that the edit is recovered.
  4. At this point there's no indication that the Safari edit was saved, is that right?

When you click 'Show changes' does it give you the diff between the Safari edit and the new Firefox one, or between the old and new Firefox ones?

What we want to have happen here is for it to match the experience you'd get with the following:

  1. Start editing on Firefox, and don't save.
  2. Go to Safari and make and save an edit.
  3. Go back to Firefox and try both 'Show changes' (the normal bottom-of-form one) and 'Save changes'.

It should show the diff between the new Safari edit and the new Firefox test, and (with your example change) it should show an edit conflict. This is what should happen with Edit Recovery too, when you've closed and re-opened the in-progress Firefox edit.

Sorry if I'm misunderstanding things. :)

@Samwilson Let me know if you understand it or not. If anything, I can send you a video on Slack.

Status: ❓NMI
Environment: Beta: 1.42.0-alpha (5a624a4)
OS: macOS Sonoma 14.0
Browser: Chrome 119, Firefox 119, Safari 17.0
Skins. Vector 2022, 2010, Minerva, Monobook, Timeless
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://en.wikipedia.beta.wmflabs.org/wiki/Dingo
https://en.wikipedia.beta.wmflabs.org/wiki/Cougar

❓AC1: https://phabricator.wikimedia.org/T351090

  1. I made an edit in Safari (CAT) and Firefox (DOG), clicked Read, and came back to Edit Source for both of them
SafariFireFox
2023-11-15_08-51-18.png (1×1 px, 538 KB)
2023-11-15_08-51-46.png (1×1 px, 584 KB)
  1. Published and saved the edit for only Safari (CAT) and went to View History for both Safari and Firefox to show they both show the revision
SafariFireFox
2023-11-15_08-53-19.png (742×1 px, 282 KB)
2023-11-15_08-53-24.png (900×1 px, 309 KB)
  1. On Safari (CAT), I clicked on Edit Source which didn't have the Edit Recovery popup since it was published, which is by design.

2023-11-15_08-54-15.png (1×1 px, 431 KB)

  1. I now go to Firefox (DOG), and click on Edit Source but it's only showing the Edit Recovery of DOG for some reason, along with not showing the update from Safari.

2023-11-15_08-54-21.png (1×1 px, 507 KB)

  1. When you click Show Changes, Safari has nothing since it's published. Firefox is showing Safari (CAT) is being updated with DOG, even though Firefox wasn't published.
SafariFirefox
2023-11-15_08-55-47.png (1×1 px, 379 KB)
2023-11-15_08-56-05.png (1×1 px, 542 KB)
  1. I get that Edit Recovery is based on your own Browser but how does a user know if they are writing over someone else's published document if they have their own Edit Recovery saved on their Browser? If I publish Firefox, I don't get a warning that I will be overwriting the other user from Safari, since it will go to your Edit Recovery. The Firefox user will be able to publish without knowing there was an update unless the user clicks on Show Changes before the user Publishes it.

Here's another example on a drastic level after running the same steps as above but sub Safari for Chrome. This time I closed the Firefox tab and opened up a new one and when I go to Edit Source, it doesn't recognize the Chrome update. You will only know in view history or if the user clicks on Show Changes. You would think you would get a warning that you are about to write over someone's update since the Edit Recovery is not seeing the update. Then again, it's probably as design but wanted to run it by you first, thanks!

https://en.wikipedia.beta.wmflabs.org/wiki/Cougar

ChromeFirefox
2023-11-15_15-12-23.png (1×1 px, 555 KB)
2023-11-15_15-13-10.png (1×1 px, 202 KB)

The reproduction pattern of this change should not involve two browsers, it should be something along the lines of:

  • Make sure no previous unsaved edit recovery session are present on the browser
  • Open a random page
  • Click on edit, make a edit
  • Save the edit
  • Open the edit page in the same browser

You should not see a Edit Recovery notification (which would previously show up)

That being said, the edge case @GMikesell-WMF has identified should probably be a seperate bug. I have filed T351435 for it :)

The reproduction pattern of this change should not involve two browsers, it should be something along the lines of:

  • Make sure no previous unsaved edit recovery session are present on the browser
  • Open a random page
  • Click on edit, make a edit
  • Save the edit
  • Open the edit page in the same browser

You should not see an Edit Recovery notification (which would previously show up)

Got it. As mentioned earlier, the Edit Recovery notification does not pop up after making and saving an edit as long there is no unsaved edit recovery data. I will move this to Done. Thanks for all your work!

Status: ✅ PASS
Environment: Beta: 1.42.0-alpha (5a624a4)
OS: macOS Sonoma 14.0
Browser: Chrome 119, Firefox 119, Safari 17.0
Skins. Vector 2022, 2010, Minerva, Monobook, Timeless
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://en.wikipedia.beta.wmflabs.org/wiki/Dingo

✅AC1: https://phabricator.wikimedia.org/T351090

That being said, the edge case @GMikesell-WMF has identified should probably be a seperate bug. I have filed T351435 for it :)

Thank you for creating the task!

Samwilson moved this task from Needs discussion to Backlog on the Edit Recovery board.
Samwilson moved this task from Backlog to Ready on the Edit Recovery board.