The BetaFeatures extension stores beta feature enrolment and auto-enrolment as a user preference. WMF is interested in changes to certain preferences and tracks them using the PrefUpdate instrumentation. When a tracked preference is updated, a PrefUpdate event is created and logged.
The PrefUpdate instrument determines whether the preference's current value is the same as the preference's default value and sets the PrefUpdate event's isDefault property accordingly. Currently, the default value for those preferences that store beta feature enrolment is null and so all PrefUpdate events are logged with isDefault = false.
The default value of a user preference is controlled by:
- $wgDefaultUserOptions
- The current wiki's content language
- $wgNamespacesToBeSearchedDefault
- $wgDefaultSkin
- The UserGetDefaultOptions hook
Possible Fix
Implement a UserGetDefaultOptions hook handler to register a default value of false for every beta feature:
public static function onUserGetDefaultOptions( &$defaultOptions ) { $betaFeatures = \MediaWikiServices::getInstance() ->getMainConfig() ->get( 'BetaFeatures' ); $defaultOptions += array_fill_keys( array_keys( $betaFeatures ), false ); }
Questions
- Should the default value be false if the user has enabled auto-enrol?