diff --git a/lib/core/decision_service/index.ts b/lib/core/decision_service/index.ts index 7d2ebf093..2064ec2a2 100644 --- a/lib/core/decision_service/index.ts +++ b/lib/core/decision_service/index.ts @@ -78,8 +78,6 @@ import { Maybe, OpType } from '../../utils/type'; import { Value } from '../../utils/promise/operation_value'; import { Platform } from '../../platform_support'; -import { localHoldout } from '../../feature_toggle'; - export const EXPERIMENT_NOT_RUNNING = 'Experiment %s is not running.'; export const RETURNING_STORED_VARIATION = 'Returning previously activated variation "%s" of experiment "%s" for user "%s" from user profile.'; @@ -1609,21 +1607,19 @@ export class DecisionService { }); } - if (localHoldout()) { - // Check local holdouts targeting this specific experiment rule. - // Inserted immediately after the forced-decision block, before regular rule evaluation. - const localHoldoutsForExperiment = getHoldoutsForRule(configObj, rule.id); - for (const holdout of localHoldoutsForExperiment) { - const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); - decideReasons.push(...holdoutDecision.reasons); - if (holdoutDecision.result.variation) { - // Signal the caller to use the holdout decision directly, preserving the holdout as experiment. - return Value.of(op, { - result: holdoutDecision.result, - reasons: decideReasons, - holdoutDecision: true, - }); - } + // Check local holdouts targeting this specific experiment rule. + // Inserted immediately after the forced-decision block, before regular rule evaluation. + const localHoldoutsForExperiment = getHoldoutsForRule(configObj, rule.id); + for (const holdout of localHoldoutsForExperiment) { + const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); + decideReasons.push(...holdoutDecision.reasons); + if (holdoutDecision.result.variation) { + // Signal the caller to use the holdout decision directly, preserving the holdout as experiment. + return Value.of(op, { + result: holdoutDecision.result, + reasons: decideReasons, + holdoutDecision: true, + }); } } @@ -1663,20 +1659,18 @@ export class DecisionService { }; } - if (localHoldout()) { - // Check local holdouts targeting this specific delivery rule (FSSDK-12369). - // Inserted immediately after the forced-decision block, before audience and traffic allocation checks. - const localHoldoutsForDelivery = getHoldoutsForRule(configObj, rule.id); - for (const holdout of localHoldoutsForDelivery) { - const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); - decideReasons.push(...holdoutDecision.reasons); - if (holdoutDecision.result.variation) { - return { - result: holdoutDecision.result, - reasons: decideReasons, - holdoutDecision: true, - }; - } + // Check local holdouts targeting this specific delivery rule (FSSDK-12369). + // Inserted immediately after the forced-decision block, before audience and traffic allocation checks. + const localHoldoutsForDelivery = getHoldoutsForRule(configObj, rule.id); + for (const holdout of localHoldoutsForDelivery) { + const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); + decideReasons.push(...holdoutDecision.reasons); + if (holdoutDecision.result.variation) { + return { + result: holdoutDecision.result, + reasons: decideReasons, + holdoutDecision: true, + }; } } diff --git a/lib/feature_toggle.ts b/lib/feature_toggle.ts index 85fba2a88..c567c46a3 100644 --- a/lib/feature_toggle.ts +++ b/lib/feature_toggle.ts @@ -39,7 +39,4 @@ import { Platform } from './platform_support'; export type IfActive boolean, Y, N = unknown> = ReturnType extends true ? Y : N; - -export const localHoldout = () => true as const; - export const __platforms: Platform[] = ['__universal__'];