Page MenuHomePhabricator

Don't restore data for a page after the data has expired
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

If you start editing a page for which you have expired Edit Recovery data, that data will be restored while at the same time deleted in indexedDB.

This might lead to confusing or unexpected behaviour for the user.

For example, if they trigger an edit recovery save (e.g. editing the page, switching tabs) the edit recovery data will be saved again with a new expiry date. If not, the next time they start editing the page the data will not be recovered.

I suggest the least confusing thing is to delete the expired data and not recover it. The data has expired so this is what the user should expect.

This only applies to when the page you are editing matches the edit recovery data. Edit recovery data for other pages is deleted.

Steps to reproduce problem
  1. In LocalSettings.php, put something like $wgEditRecoveryExpiry = 10;
  2. Start editing a page (but don't save)
  3. Close the editing window and wait 10 seconds (or however long you set the expiry for)
  4. Open the editing page again

Expected behaviour: Edits from step 2 are not recovered. You don't see a popup. If you look in indexedDB, the data for the page is cleared.
Observed behaviour: Edits from step 2 are recovered. You see a popup. Data for the page is cleared in indexedDB (as long as you have not triggered a save of the edit recovery data by, for example, switching tabs or windows).

Environment

Browser: Firefox 115. Chromium 120.
Wiki(s): Local docker MediaWiki 1.42.0-alpha (0b1b808) 02:37, 16 January 2024.
Editor: WikiEditor 0.5.4 (8f16d58) 13:55, 12 January 2024.

QA Results - Local

Event Timeline

Good point. We delete it and then simultaneously read it. The reading should probably happen after the deleting is resolved.

Change 991103 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Edit Recovery: load data only after deleting expired rows

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

Change 991103 merged by jenkins-bot:

[mediawiki/core@master] Edit Recovery: load data only after deleting expired rows

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

@Samwilson Originally I was getting an Operation failed because the requested database object could not be found only with Firefox. A separate task T355289: Operation failed because the requested database object could not be found was created and is now resolved by Sam. I will move this to Done. Thanks for all your work!

Status: ✅PASS
Environment: Local- 1.42.0-alpha (6d71df9)12:40, 18 January 2024
OS: macOS Sonoma 14.2.1
Browser: Chrome 120, Firefox 121, Safari 17.2.1
Skins. Vector 2022/10
Device: MBA M2
Emulated Device:: n/a
Test Links:
http://localhost:8080/wiki/Dog
http://localhost:8080/wiki/Cat

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

FirefoxChromeSafari