I'm really curious what happens to unused preferences left behind in the database by patches like https://gerrit.wikimedia.org/r/498903. There is no process to ever drop these, as far as I know. How can anyone identify these later? Do they clog up the database? Should we even care?
Possibilities:
- There is maintenance/cleanupPreferences.php. But do we ever run this? It looks like the script assumes all preferences have a default value specified somewhere. Is this really true? As far as I know it's possible to call setOption() without ever registering a default. Or what if an extension is temporarily disabled and we don't want the user's settings to immediately disappear?
- I also found maintenance/userOptions.php advancedsearch --delete which feels much saver to run on production, but leaves us with the job to identify the unused preferences first.
- I wonder if it's worth to actively drop unused preferences? Code could look like this:
// Purge obsolete BetaFeature option from the database if ( $optionsManager->getOption( $user, 'advancedsearch' ) !== null ) { $optionsManager->setOption( $user, 'advancedsearch', null ); $optionsManager->saveOptions( $user ); }
Possibly affected WMDE-TechWish projects:
- Advanced-Search: There is advancedsearch and advancedsearch-disable.
- Move-Files-To-Commons: fileexporter was the preference name for a BetaFeatures.
- Reference Previews: There is popups-reference-previews and popupsreferencepreviews.
- Revision-Slider?
- Two-Column-Edit-Conflict-Merge: There is twocolconflict and twocolconflict-enabled.
- There is also templatewizard-betafeature.
- …
Verified list
- advancedsearch-disable = "" We changed the default from false to 0. As a result there might be some rows with an empty string or 0 in the database. We can drop these.
- revisionslider-disable = "" Same here.
- advancedsearch Has no effect since https://gerrit.wikimedia.org/r/498903 and can be removed, no matter what the value is. Replaced with advancedsearch-disable.
- fileexporter Gone since https://gerrit.wikimedia.org/r/756612. No replacement.
- revisionslider Gone since https://gerrit.wikimedia.org/r/361061. Replaced with revisionslider-disable.
- templatewizard-betafeature Gone since https://gerrit.wikimedia.org/r/499879. No replacement.
- betafeatures-geonotahack Gone since https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/161025. No replacement.
- betafeatures-popup-disable Gone since https://gerrit.wikimedia.org/r/c/mediawiki/extensions/BetaFeatures/+/305146. No replacement.
- betafeatures-vector-typography-update - Gone since undeployment and archiving of MediaWiki-extensions-VectorBeta
- betafeatures-vector-compact-personal-bar - ...
- userjs-gettingstarted-showtour - Gone since undeployment of MediaWiki-extensions-GettingStarted (at the latest)
Note: Reference Previews and Two-Column-Edit-Conflict-Merge are still referencing their BetaFeatures flags in the code.