Page MenuHomePhabricator

Recovery data cleared for whole page when section is saved
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

If I have recovery data for a whole page and I am editing a section of the same page, when I save the section it clears data for the whole page but not for the section.

Further to T344410#9278606, sections and whole pages should be cleared independently.

Steps to reproduce problem
  1. Go to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit
  2. Make an edit (but don't save) and then close the tab
  3. Go to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit&section=1
  4. Make an edit and save
  5. Reopen https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit

Expected behaviour: The edit you made in step 2 should be recovered.
Observed behaviour: It is not. If you look in IndexedDB in devtools, you will notice the entry for the section (New_Page_123,1) has not been cleared.

Environment

Browser: Firefox 115. Chromium 119.
Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.42.0-alpha (d8b8d9d) 07:18, 27 November 2023.
Editor: WikiEditor 0.5.4 (89e5491) 07:33, 27 November 2023.

QA Results - Beta

Details

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptNov 27 2023, 2:08 PM

I notices this as well but assumed it was intentional :)

[...]
storage.deleteData( mw.config.get( 'wgPageName' ) );

deleteData() takes the page name and section โ€” will look to make the page section available at postEdit

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

[mediawiki/core@master] [WIP] editRecovery: Add wgEditingSection js config

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

Change 987148 merged by jenkins-bot:

[mediawiki/core@master] editRecovery: Add -editRecoverySection js config

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

I find after I "Show preview" or "Show changes" for a section edit, if I then do "Discard changes" it discards for the whole page (and in some cases the section as well).

For example:

  1. Go to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Conflict-title-0.650954540390162-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=edit and make an edit (don't save)
  2. Go to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Conflict-title-0.650954540390162-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n&action=edit&section=1 and make an edit (don't save)
  3. Click "Show preview" or "Show changes"
  4. Click "Discard changes" in the popup
  5. Inspect indexeddb data on the browser. The data for the whole page will have been deleted, but the section data might still be there. If you then trigger an ER save (e.g. by switching tabs) the section data will also be cleared.

I find after I "Show preview" or "Show changes" for a section edit, if I then do "Discard changes" it discards for the whole page (and in some cases the section as well).

Actually, this is a bug that also affects regularly editing a section. I raised it separately as T354948.

@TheresNoTime Edit recovery does what is expected for this task. Discarding changes in a section discards edit recovery data for the whole page issue has been created separately by Dom with T354948. Another one that I came across was that there's no indication that you are now editing an old revision of the page which can be found in T351435 to resolve that issue.

Status: โœ…PASS
Environment: Beta: 1.42.0-alpha (eb82de5)
OS: macOS Sonoma 14.2.1
Browser: Chrome 119, Firefox 115
Skins. Vector 2022
Device: MBA M2
Emulated Device:: BrowserStack
Test Links:
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit&section=1

โœ…AC1: https://phabricator.wikimedia.org/T352028

ChromeFirefox