Page MenuHomePhabricator

Soft refreshes can clear Edit Recovery data on Firefox
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

I have seen two cases so far where Edit Recovery data has been cleared unexpectedly after a soft refresh.

Case one:
While editing, if I soft refresh the page twice in a row the Edit Recovery data in IndexedDB for that page will be cleared.

Case two:
While editing, if I soft refresh the page and then leave the edit screen (e.g. navigate away or close the tab) the IndexedDB data for that page is cleared.

I have only been able to reproduce this on Firefox so far, and only if I soft refresh. I have tried Chrome and Safari but no success yet.

Steps to reproduce problem

Case one:

  1. In Firefox, open https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Conflict-title-0.6832584036805363-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=edit
  2. Type something in the editor window (but don't save)
  3. Open devtools, go to the Storage tab, expand "Indexed DB" and all its submenus until you see an item called "unsaved-page-data", click on it to check that there is some data stored for this page (the key will be the name of the page)
  4. Soft refresh (ctrl+r)
  5. When the page reloads, soft refresh again

Expected behaviour: Checking Indexed DB again the data should not have changed.
Observed behaviour: The data is no longer in Indexed DB. If you perform a hard refresh (ctrl+shift+r) the edit you made in step 2 will not be recovered.

Case two:

  1. In Firefox, open https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Conflict-title-0.6832584036805363-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=edit
  2. Type something in the editor window (but don't save)
  3. Open devtools, go to the Storage tab, expand "Indexed DB" and all its submenus until you see an item called "unsaved-page-data", click on it to check that there is some data stored for this page (the key will be the name of the page)
  4. Soft refresh (ctrl+r)
  5. Click on "Edit Source"

Expected behaviour: Edit gets restored.
Observed behaviour: Edit does not get restored. Article is as it was in step 1. Not data is in IndexedDB.

Environment

Browser: Firefox 115 (Debian) and 119 (Windows 11).
Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.42.0-alpha (dcd8a21) 03:06, 23 November 2023.
Editor: WikiEditor 0.5.4 (68da956) 07:21, 22 November 2023.

QA Results - Beta

Event Timeline

dom_walden renamed this task from Repeated soft refreshes clears Edit Recovery data on Firefox to Soft refreshes can clear Edit Recovery data on Firefox.Nov 23 2023, 11:26 AM
dom_walden updated the task description. (Show Details)

This also happens after you close and restore a tab (ctrl+shift+t) or going back on the browser. I am still investigating.

I'm trying to replicate this but can't yet. Do you think it's related to T351821: Edit Recovery interaction with browser data recovery? It sounds like it's not seeing any difference between the 'original' data and what's now stored, probably because it's got the wrong idea of what 'original' is.

Open devtools, go to the Storage tab, expand "Indexed DB" and all its submenus until you see an item called "unsaved-page-data", click on it to check that there is some data stored for this page (the key will be the name of the page)

Side note: Now we've got Special:EditRecovery, that can be used to verify the contents of the DB, if it's easier.

I'm trying to replicate this but can't yet. Do you think it's related to T351821: Edit Recovery interaction with browser data recovery? It sounds like it's not seeing any difference between the 'original' data and what's now stored, probably because it's got the wrong idea of what 'original' is.

That sounds plausible.

Open devtools, go to the Storage tab, expand "Indexed DB" and all its submenus until you see an item called "unsaved-page-data", click on it to check that there is some data stored for this page (the key will be the name of the page)

Side note: Now we've got Special:EditRecovery, that can be used to verify the contents of the DB, if it's easier.

Thanks, I forgot about that.

@Samwilson In both cases the Indexed DB was restored correctly. This will be moved to Done. Thanks for all your work!

Status: ✅PASS
Environment: Beta: 1.42.0-alpha (ce211ef)
OS: macOS Sonoma 14.2
Browser: Firefox 120
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Conflict-title-0.6832584036805363-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=edit

✅AC1: https://phabricator.wikimedia.org/T351869
Case one:

✅AC2: https://phabricator.wikimedia.org/T351869
Case two: