Page MenuHomePhabricator

"Show preview" or "Show changes" twice can clear Edit Recovery data
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

While on Preview or Changes, if I make an edit and click "Show preview"/"Show changes" twice in a row, the Edit Recovery data may be cleared.

This seems to only happen if you don't first make an edit to the page before first clicking "Show preview"/"Show changes".

Steps to reproduce problem
  1. Go to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=HabCat&action=edit
  2. Click either "Show preview" or "Show changes" (do not edit the page first)
  3. On the Preview or Changes page, make an edit (don't save)
  4. Click again either "Show preview" or "Show changes"
  5. Without making any edits, click again either "Show preview" or "Show changes"

Expected behaviour: The "Changes recovered" popup appears. The Edit Recovery data for that page appears in IndexedDB.
Observed behaviour: The popup does not appear. The data is not in IndexedDB.

Environment

Browser: Firefox 115. Chromium 120.
Wiki(s): MediaWiki 1.42.0-alpha (2e9d3e6) 10:18, 15 January 2024.
Editor: WikiEditor 0.5.4 (8f16d58) 13:55, 12 January 2024.

Event Timeline

nb. I could replicate this on beta, testwiki and locally, but only if Show preview without reloading the page was turned off.

Change 1005113 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/core@master] [WIP/DNM] Edit Recovery: Persist changes made during preview

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

@TheresNoTime Is this task ready to be worked on? I know we talked about this a couple days ago but I don't remember if there was something blocking it.

The patch still says WIP/DNM. Is it ready for review or no?