-
Notifications
You must be signed in to change notification settings - Fork 258
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
Jon/ab/create-login-buttons #4473
Conversation
45ebbfc
to
3603a69
Compare
src/experimentConfig.ts
Outdated
} catch (err) { | ||
// Not found or incompatible. Re-generate with random values according to | ||
// the defined distribution. | ||
const generatedExperimentConfig = asExperimentConfig({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consolidate isMaestro() check here and return default values if so
src/components/scenes/LoginScene.tsx
Outdated
}, []) | ||
|
||
return loggedIn ? ( | ||
return loggedIn || (!isMaestro() && experimentConfig == null) ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consolidate ismaestro checks to getExperimentConfig
const generateExperimentConfigVal = (key: keyof typeof experimentDistribution): boolean => { | ||
return Math.random() < experimentDistribution[key] | ||
const generateExperimentConfigVal = <T>(key: keyof typeof experimentDistribution, configVals: T[]): T => { | ||
const variantProbability = experimentDistribution[key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should assert that variantProbability.length === configVals.length - 1
8fd3040
to
df5d072
Compare
src/experimentConfig.ts
Outdated
}) | ||
// behavior/appearance. | ||
// If no generateCfgValFn given, returns defined defaults | ||
const asExperimentConfig: any = (generateCfgValFn?: GenerateExperimentConfigValFn) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cleaner shouldn't be typed any
. This would break the return type
src/experimentConfig.ts
Outdated
@@ -74,7 +83,7 @@ const experimentConfigPromise: Promise<ExperimentConfig> = (async (): Promise<Ex | |||
} catch (err) { | |||
// Not found or incompatible. Re-generate with random values according to | |||
// the defined distribution. | |||
const generatedExperimentConfig = asExperimentConfig({}) | |||
const generatedExperimentConfig = asExperimentConfig(generateExperimentConfigVal)({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all the complexity of creating a function that gets passed in when all you really care about is a boolean like useDefaults
. Pass that as the first arg to asExperimentConfig
and you don't need to check for a null function.
91b3e4d
to
df584ad
Compare
df584ad
to
a63ac39
Compare
It's OK that we change the values of legacyLanding because it's not reporting values properly to the reports currently.
a63ac39
to
2ac7ae4
Compare
CHANGELOG
Dependencies
#4469
Requirements
If you have made any visual changes to the GUI. Make sure you have: