Page MenuHomePhabricator

Discarding changes in a section discards edit recovery data for the whole page
Open, HighPublicBUG REPORT

Assigned To
None
Authored By
dom_walden
Jan 12 2024, 2:28 PM
Referenced Files
F47391382: 2024-04-18_13-18-27.png
Apr 18 2024, 8:35 PM
F47391344: 2024-04-18_13-17-18.png
Apr 18 2024, 8:35 PM
F47391323: 2024-04-18_13-11-01.png
Apr 18 2024, 8:35 PM
F47391308: 2024-04-18_13-16-01.png
Apr 18 2024, 8:35 PM
F47391251: 2024-04-18_13-09-08.png
Apr 18 2024, 8:35 PM
F47391231: 2024-04-18_13-07-06.png
Apr 18 2024, 8:35 PM
F47391449: T354948_ER_Section1.webm
Apr 18 2024, 8:35 PM
F47049729: T354948_ER_Sections_IndexDB.webm
Apr 16 2024, 10:09 PM

Description

What is the problem?

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).

Originally raised in T352028#9455995.

Steps to reproduce problem
  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. Reload the page
  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.
Environment

Browser: Firefox 115.
Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.42.0-alpha (cab3f6e) 10:39, 12 January 2024.
Editor: WikiEditor 0.5.4 (cd6b88e) 07:33, 10 January 2024.

QA Results - Beta

Event Timeline

dom_walden renamed this task from Discarding changes in a section discards changes for the whole section to Discarding changes in a section discards edit recovery data for the whole page.Jan 12 2024, 2:28 PM
dom_walden updated the task description. (Show Details)

(fyi; can no longer replicate this behaviour)

Samwilson subscribed.

This issue has been fixed as part of other work around section-saving.

@Samwilson As you mentioned earlier, this is by design. The idea is that when you click on "Show Preview" or "Show Changes", you know what you're doing and the contents are all that you're currently working with. The recovery process should only happen when you start editing. I did come across another error as seen below though.

Status: ❌FAIL
Environment: Beta: 1.43.0-alpha (67f80e6
OS: macOS Sonoma 14.4.1
Browser: Chrome 123
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
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/T354948 - I did an edit on https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit with "DARK". Then I did an edit on https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit&section=1 with "LIGHT". I did discard changes to remove "Light" but as you see in the video, it also removed "Dark" from the IndexDB.

aaah... I feel a bit silly. It would appear that we've never been able to discard data for a section: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/965051/11/resources/src/mediawiki.editRecovery/edit.js#92

I guess we didn't think about it for T342721: Show toast notification when restoring edit data.

Fixing now!

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

[mediawiki/core@master] Edit Recovery: discard section data

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

Change #1020440 merged by jenkins-bot:

[mediawiki/core@master] Edit Recovery: discard section data

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

Discarding for sections should be working correctly now.

@Samwilson IndexDB is now working correctly with sections. I will move this to Done. Thanks for all your work!

Status: ✅PASS
Environment: Beta: 1.43.0-alpha (01a6c18)
OS: macOS Sonoma 14.4.1
Browser: Chrome 123, Firefox 124, Safari 17.3
Skins. Vector 2022, Vector 2010, Minerva, Monobook, Timeless
Device: MBA M2
Emulated Device:: n/a
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/T354948

Chrome-Vector 2022
FirefoxSafari
2024-04-18_13-07-06.png (1×1 px, 315 KB)
2024-04-18_13-09-08.png (1×3 px, 404 KB)
Vector 2010MinervaMonobookTimeless
2024-04-18_13-16-01.png (1×3 px, 427 KB)
2024-04-18_13-11-01.png (1×3 px, 321 KB)
2024-04-18_13-17-18.png (1×2 px, 378 KB)
2024-04-18_13-18-27.png (1×2 px, 329 KB)