Page MenuHomePhabricator

Clear all data if $wgEnableEditRecovery == false
Closed, DeclinedPublic

Description

In T341844 we added a feature flag that enables the Edit Recovery feature. If this is enabled and used, data will be stored in browsers indexedDB storage. If the feature flag is then disabled, the data will stay there. Instead, if the feature is turned off, then any existing data should be purged.

This could be as simple as:

window.indexedDB.deleteDatabase( mw.config.get( 'wgDBname' ) + '_editRecovery' );

This is really only useful on a wiki where the feature is turned off permanently after some time of being in use (i.e. where there would likely be many users with lots of locally stored data).

Questions: Should it be purged just on login/logout/editing/preferences? Loading a small module everywhere just for this single use feels like overkill, but then so does leaving the data in place forever. Also, the point of the feature flag is that the feature make zero changes to anything when it's not enabled, so it doesn't make sense for it to actually enable a module in this situation. Perhaps a second config variable is needed?

Event Timeline

This should not be necessary with proper expiry (T341956). If our IndexedDB implementation is generic enough, like our localStorage wrapper, then we can ensure that expired items are removed, regardless of which features are enabled.