Prevent A/B test enrollment hook from firing for unsampled

Bug: T297662
Change-Id: Ibeca32a3c0fab7de403d69ea274c653cf4bd6c0e
This commit is contained in:
Clare Ming 2021-12-13 17:31:17 -07:00
parent 983437312b
commit 60553ff324
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ function isInTestGroup( bucket, targetGroup ) {
function initAB( bucket ) {
// Send data to WikimediaEvents to log A/B test initialization if experiment is enabled
// and if the user is logged in.
if ( ABTestConfig.enabled && !mw.user.isAnon() ) {
if ( ABTestConfig.enabled && !mw.user.isAnon() && bucket !== 'unsampled' ) {
// @ts-ignore
mw.hook( 'mediawiki.web_AB_test_enrollment' ).fire( getABTestGroupExperimentName() );