When to clear edit recovery data
Currently, if you edit a section the edit recovery data is stored in a separate indexeddb record.
You can have multiple records associated with the same page.
For example, if you open the below users and make edits (but don't publish):
- 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§ion=1
- https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit§ion=2
you will have three records, one for the entire page and two for the two sections.
However, as soon as you publish an edit (either for the entire page or a section) it will clear all the records associated with the page and you will lose any unsaved edits for the other sections and/or the entire page.
So, for example, if you were now to publish the edits you made to
you would lose any edits you made to
- https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit and
- https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit§ion=2
How to handle sections added or moved
Sections are identified by a number, for example: title=New_Page_123&action=edit§ion=3.
These numbers can change if sections are moved around the page or new sections are added above the existing sections. For example, if I make edits to == Section 2 == (but don't publish) https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit§ion=3.
In the meantime, if someone adds a section above it like in the screenshot below
If I return to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=New_Page_123&action=edit§ion=3 I will be editing a different section (=== Section 1b ===) but it will restore the edit data for the previous section (== Section 2 ==).
Deleted section
If I am editing the last section on the page and someone deletes it, when I go back to edit it you will see "Cannot find section" and therefore you won't be able to recover your edit data.
I would need to edit the entire page to re-add the section or undo the delete (unless you use rollback), but doing that will clear all the recovery data for the page, thus losing their unsaved edit data.
We should decide how we want to handle these cases. Perhaps this is a question for @JSengupta-WMF.
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ❌ https://phabricator.wikimedia.org/T344410 here |