Jhernandez has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311727

Change subject: WIP: Respect beta feature flag for logged in users
......................................................................

WIP: Respect beta feature flag for logged in users

Both in active and inactive state (not just active like before).

Change-Id: Ieb4cd39c2870fb701cabd0f1d01c0ab42b6ebe78
---
M resources/ext.popups.experiment.js
1 file changed, 11 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/27/311727/1

diff --git a/resources/ext.popups.experiment.js 
b/resources/ext.popups.experiment.js
index 809fb02..990fa17 100644
--- a/resources/ext.popups.experiment.js
+++ b/resources/ext.popups.experiment.js
@@ -73,18 +73,19 @@
                        return false;
                }
 
-               // Users with the beta feature enabled are already in the 
experimental condition.
-               if ( mw.config.get( 'wgPopupsExperimentIsBetaFeatureEnabled', 
false ) ) {
-                       return true;
-               }
+               if ( mw.user.isAnon() ) {
+                       if ( !config ) {
+                               return false;
+                       }
 
-               if ( !config ) {
-                       return false;
+                       // FIXME: mw.experiments should expose the 
CONTROL_BUCKET constant, e.g.
+                       // `mw.experiments.CONTROL_BUCKET`.
+                       return mw.experiments.getBucket( config, getToken() ) 
!== 'control';
+               } else {
+                       // Logged in users are in condition depending on the 
beta feature flag
+                       // instead of bucketing
+                       return mw.config.get( 
'wgPopupsExperimentIsBetaFeatureEnabled', false );
                }
-
-               // FIXME: mw.experiments should expose the CONTROL_BUCKET 
constant, e.g.
-               // `mw.experiments.CONTROL_BUCKET`.
-               return mw.experiments.getBucket( config, getToken() ) !== 
'control';
        };
 
 }( mediaWiki ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/311727
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb4cd39c2870fb701cabd0f1d01c0ab42b6ebe78
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <jhernan...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to