From cb42305909a538946460ab3351a8d938cd1d61aa Mon Sep 17 00:00:00 2001 From: Abhi591 Date: Mon, 3 Jun 2024 21:06:14 +0530 Subject: [PATCH] fix: fetch experimentKey from rule --- lib/api/GetFlag.ts | 2 +- .../segmentation-evaluator/evaluators/SegmentEvaluator.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api/GetFlag.ts b/lib/api/GetFlag.ts index 2477fac..f9cabdd 100644 --- a/lib/api/GetFlag.ts +++ b/lib/api/GetFlag.ts @@ -247,7 +247,7 @@ export class FlagApi implements IGetFlag { experimentVariationToReturn = whitelistedObject.variation; Object.assign(passedRulesInformation, { experimentId: rule.getId(), - experimentKey: whitelistedObject.experimentKey, + experimentKey: rule.getKey(), experimentVariationId: whitelistedObject.variationId, }); } diff --git a/lib/packages/segmentation-evaluator/evaluators/SegmentEvaluator.ts b/lib/packages/segmentation-evaluator/evaluators/SegmentEvaluator.ts index ec218db..2d108d0 100644 --- a/lib/packages/segmentation-evaluator/evaluators/SegmentEvaluator.ts +++ b/lib/packages/segmentation-evaluator/evaluators/SegmentEvaluator.ts @@ -283,7 +283,7 @@ export class SegmentEvaluator implements Segmentation { } // this will be checked for all cases where wildcard is not present - if (expectedValues.includes(actualValue)) { + if (expectedValues.includes(actualValue.toLowerCase())) { return true; // Direct value match found, return true } }