Merge "Misnamed field on a/b test logging"

This commit is contained in:
jenkins-bot 2022-02-12 20:37:04 +00:00 committed by Gerrit Code Review
commit 66feffb991

View file

@ -42,7 +42,7 @@
);
}
function addABTestData( data ) {
function addABTestData( data, addToken ) {
// DiscussionTools New Topic A/B test for logged out users
if ( !mw.config.get( 'wgDiscussionToolsABTest' ) ) {
return;
@ -54,8 +54,10 @@
}
var anonid = parseInt( tokenData.token.slice( 0, 8 ), 16 );
data.bucket = anonid % 2 === 0 ? 'test' : 'control';
// eslint-disable-next-line camelcase
data.anonymous_user_id = tokenData.token;
if ( addToken ) {
// eslint-disable-next-line camelcase
data.anonymous_user_token = tokenData.token;
}
} else if ( mw.user.options.get( 'discussiontools-abtest2' ) ) {
data.bucket = mw.user.options.get( 'discussiontools-abtest2' );
}
@ -213,7 +215,7 @@
}
/* eslint-enable camelcase */
addABTestData( event );
addABTestData( event, true );
if ( trackdebug ) {
log( topic, duration + 'ms', event );