From 15a98fcaf496cfa94817cad59f1ed49a16b790e8 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 19 Sep 2024 10:34:04 +0200 Subject: [PATCH] fix: update playground SDK to increase the possible random numbers used for stickiness id (#8182) Same fix as done in some other sdks, such as the node one at https://github.com/Unleash/unleash-client-node/pull/417o Fixes an issue where 1% rollout would not yield any results with random rollout for certain group ids --- .../feature-evaluator/strategy/flexible-rollout-strategy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/features/playground/feature-evaluator/strategy/flexible-rollout-strategy.ts b/src/lib/features/playground/feature-evaluator/strategy/flexible-rollout-strategy.ts index 2d2a0da799..ad48ddb13c 100644 --- a/src/lib/features/playground/feature-evaluator/strategy/flexible-rollout-strategy.ts +++ b/src/lib/features/playground/feature-evaluator/strategy/flexible-rollout-strategy.ts @@ -10,7 +10,7 @@ const STICKINESS = { export default class FlexibleRolloutStrategy extends Strategy { private randomGenerator: Function = () => - `${Math.round(Math.random() * 100) + 1}`; + `${Math.round(Math.random() * 10_000) + 1}`; constructor(radnomGenerator?: Function) { super('flexibleRollout');