Skip to content

Commit

Permalink
AXON-144 fix default value on fail
Browse files Browse the repository at this point in the history
  • Loading branch information
cabella-dot committed Feb 22, 2025
1 parent 820f7cd commit 0d9d365
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/util/featureFlags/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,18 @@ export class FeatureFlagClient {
}

public static checkExperimentValue(experiment: string): any {
let gateValue: any = undefined;
let gateValue: any;
const experimentGate = ExperimentGates[experiment];
if (FeatureGates === null) {
console.warn('FeatureGates: FeatureGates is not initialized. Defaulting to Undefined');
console.warn(
`FeatureGates: FeatureGates is not initialized. Returning default value: ${experimentGate.defaultValue}`,
);
} else {
console.log(ExperimentGates[experiment]);
gateValue = FeatureGates.getExperimentValue(
ExperimentGates[experiment].gate,
ExperimentGates[experiment].parameter,
ExperimentGates[experiment].defaultValue,
experimentGate.gate,
experimentGate.parameter,
experimentGate.defaultValue,
);
}
console.log(`ExperimentGateValue: ${experiment} -> ${gateValue}`);
Expand Down
2 changes: 1 addition & 1 deletion src/util/featureFlags/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ExperimentGates: ExperimentGate = {
[Experiments.NewAuthUIAA]: {
gate: 'atlascode_new_auth_ui_aa',
parameter: 'isEnabled',
defaultValue: `bruh`,
defaultValue: false,
},
};

Expand Down

0 comments on commit 0d9d365

Please sign in to comment.