Skip to content

Commit 0d9d365

Browse files
committed
AXON-144 fix default value on fail
1 parent 820f7cd commit 0d9d365

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/util/featureFlags/client.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,18 @@ export class FeatureFlagClient {
6767
}
6868

6969
public static checkExperimentValue(experiment: string): any {
70-
let gateValue: any = undefined;
70+
let gateValue: any;
71+
const experimentGate = ExperimentGates[experiment];
7172
if (FeatureGates === null) {
72-
console.warn('FeatureGates: FeatureGates is not initialized. Defaulting to Undefined');
73+
console.warn(
74+
`FeatureGates: FeatureGates is not initialized. Returning default value: ${experimentGate.defaultValue}`,
75+
);
7376
} else {
7477
console.log(ExperimentGates[experiment]);
7578
gateValue = FeatureGates.getExperimentValue(
76-
ExperimentGates[experiment].gate,
77-
ExperimentGates[experiment].parameter,
78-
ExperimentGates[experiment].defaultValue,
79+
experimentGate.gate,
80+
experimentGate.parameter,
81+
experimentGate.defaultValue,
7982
);
8083
}
8184
console.log(`ExperimentGateValue: ${experiment} -> ${gateValue}`);

src/util/featureFlags/features.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const ExperimentGates: ExperimentGate = {
1717
[Experiments.NewAuthUIAA]: {
1818
gate: 'atlascode_new_auth_ui_aa',
1919
parameter: 'isEnabled',
20-
defaultValue: `bruh`,
20+
defaultValue: false,
2121
},
2222
};
2323

0 commit comments

Comments
 (0)