Page MenuHomePhabricator

Add user preference to enable Edit Recovery
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

  • As an interested user, I want a way to enable Edit Recovery without having to wait until it's enabled for everyone.
  • As a developer of the feature, I want a way for users to opt in to using it so they can give feedback.

Benefits (why should this be implemented?):

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Samwilson thanks for creating this task! Actually, my use case is neither of the above ones, but

As an experienced editor who knows how to edit (which tools, features and activities to avoid) in order to be able to rely on the auto-recovery feature of the browser, I want to be able to turn off Edit Recovery even after it became default so that it doesn’t keep popping up after I abandon edits intentionally.

However, testing the feature early is also a good way to make use of this preference.

An idea that CommTech talked about in a meeting recently was to make it possible to add something like mw.EditRecovery.enabled = false; to one's global.js or common.js so that advanced users would have a way to turn it off without adding to the UI for everyone else (there's a concern about having too many preferences already). There's also now Special:EditRecovery, which could be a good place to house a preference toggle, if we did want it to be a general thing but still keep it out of Special:Preferences (although that'd make it harder to handle GlobalPreferences, I think, and perhaps there's a use case for wanting Edit Recovery on only some wikis).

As an experienced editor who knows how to edit (which tools, features and activities to avoid) in order to be able to rely on the auto-recovery feature of the browser, I want to be able to turn off Edit Recovery even after it became default so that it doesn’t keep popping up after I abandon edits intentionally.

My case exactly. A checkbox in Preferences can also link to Special:EditRecovery (T351781), killing two birds.

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

[mediawiki/core@master] [WIP] EditRecovery: Add user preference

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

This patch adds a preference under the Editing section, defaulting to disabled, for Edit Recovery.
The words Edit Recovery in the message Enable the Edit Recovery feature links to Special:EditRecovery.

Change 992403 merged by jenkins-bot:

[mediawiki/core@master] EditRecovery: Add user preference

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

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

[operations/mediawiki-config@master] IS/CS: Add wmgEditRecoveryDefaultUserOptions

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

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

[mediawiki/core@wmf/1.42.0-wmf.15] EditRecovery: Add user preference

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

Change 992522 abandoned by Samtar:

[mediawiki/core@wmf/1.42.0-wmf.15] EditRecovery: Add user preference

Reason:

Will just ride the train, backport isn't needed, my bad

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

dom_walden subscribed.

I have tested enabling and disabling Edit Recovery via Special:Preferences, Special:GlobalPreferences and with a local override.

Once you disable Edit Recovery, I am assuming any data you had stored will remain and not be cleared (unless you clear it yourself). When I tested canceling or saving an edit, I saw it does not clear the data from IndexedDB.

Test environment: https://en.wikipedia.beta.wmflabs.org MediaWiki 1.42.0-alpha (0912c1f) 01:53, 26 January 2024.

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

[operations/mediawiki-config@master] IS/CS: Add wmgEditRecoveryDefaultUserOptions

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

@TheresNoTime Does this merge conflict need to be sorted?

Once you disable Edit Recovery, I am assuming any data you had stored will remain and not be cleared (unless you clear it yourself). When I tested canceling or saving an edit, I saw it does not clear the data from IndexedDB.

I've been wondering about that, and the related situation of what to do if $wgEnableEditRecovery = false. In both cases ideally we'd delete the local indexedDB database. We've not wanted to do this yet, because it'll mean loading JS when the feature flag is off, and the point of the feature flag is to enable the feature. So probably we need another flag? Anyway, I think this is fine to carry forward as it is, for deployment.

Tacsipacsi points out on the above patch that the preference could perhaps be enabled by default on testwiki; have we made a decision about that? It seems like it might be good, and not disruptive considering that it's currently enabled there.

It seems like it might be good, and not disruptive considering that it's currently enabled there.

Yes, I proposed including testwiki exactly because it’s already default there. Making it opt-in on testwiki could come as a surprise to those who know it works there (and could even cause edits to be lost if someone assumes it works but in the meantime it becomes opt-in).

Change 992632 merged by jenkins-bot:

[operations/mediawiki-config@master] IS/CS: Add wmgEditRecoveryDefaultUserOptions

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

Mentioned in SAL (#wikimedia-operations) [2024-02-19T12:21:51Z] <samtar@deploy2002> Started scap: Backport for [[gerrit:992632|IS/CS: Add wmgEditRecoveryDefaultUserOptions (T350653)]]

Mentioned in SAL (#wikimedia-operations) [2024-02-19T12:23:06Z] <samtar@deploy2002> samtar: Backport for [[gerrit:992632|IS/CS: Add wmgEditRecoveryDefaultUserOptions (T350653)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-02-19T12:32:07Z] <samtar@deploy2002> Finished scap: Backport for [[gerrit:992632|IS/CS: Add wmgEditRecoveryDefaultUserOptions (T350653)]] (duration: 10m 21s)

Deployed, default disabled, enabled for testwiki per above & comment.

Thanks!

I’ve just realized that $wgEnableEditRecovery is still disabled on all production wikis except for testwiki. Is this intentional? When do you plan to enable it as an opt-in beta (i.e. $wgEnableEditRecovery = true; $wgDefaultUserOptions['editrecovery'] = 0;) on other wikis?

This is intentional — I believe we plan to enable it as an opt-in beta soon, but more info is at T355548: Edit Recovery deployment

Okay, thanks for the explanation!