Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix A/B test timing bug #601

Merged
merged 2 commits into from Sep 21, 2020
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next

Return early from setupHubPromoABTest if A/B tests have not yet been …

…fetched to avoid misinterpreting absense of 'hub_plain' or 'hub_midnight'
  • Loading branch information
wlycdgr committed Sep 2, 2020
commit bcfd4dfaa55fadff34f9cf036e0363668cc9d3c8
@@ -1118,7 +1118,12 @@ function getAntitrackingTestConfig() {
* @return {Object} Hub promotion configuration parameters
*/
function setupHubPromoABTest() {
if (conf.hub_promo_variant !== 'not_yet_set') return;
if (
!abtest.hasBeenFetched
|| conf.hub_promo_variant !== 'not_yet_set'
) {
return;
}

if (abtest.hasTest('hub_plain')) {
conf.hub_promo_variant = 'plain';
@@ -27,6 +27,7 @@ const { BROWSER_INFO, CMP_BASE_URL, EXTENSION_VERSION } = globals;
class ABTest {
constructor() {
this.tests = {};
this.hasBeenFetched = false;
}

/**
@@ -63,6 +64,7 @@ class ABTest {
(tests, test) => Object.assign(tests, { [test.name]: test.data }),
{}
);
this.hasBeenFetched = true;
} else {
log('A/B Tests: no tests found.');
}
ProTip! Use n and p to navigate between commits in a pull request.