Skip to content

Commit a04bb17

Browse files
committed
WIP-TESTUNITS-4
1 parent a6ed2a4 commit a04bb17

File tree

3 files changed

+260
-297
lines changed

3 files changed

+260
-297
lines changed

fbclient/evaluator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@ def is_send_to_expt(dispatch_key: str,
287287
return VariationSplittingAlgorithm(new_dispatch_key, [0, upper_bound]).is_key_belongs_to_percentage()
288288
return False
289289

290-
dispatch_key = rollout_variations.get('dispatchKey', 'keyid')
291-
dispatch_key_value = "".join((flag['key'], user.get(dispatch_key))) # type: ignore
290+
dispatch_key = rollout_variations.get('dispatchKey')
291+
dispatch_key = dispatch_key if dispatch_key else 'keyid'
292+
dispatch_key_value = "".join((flag['key'], user.get(dispatch_key, ""))) # type: ignore
292293
for rollout in rollout_variations['variations']:
293294
if VariationSplittingAlgorithm(dispatch_key_value, rollout['rollout']).is_key_belongs_to_percentage(): # type: ignore
294295
send_to_expt = is_send_to_expt(dispatch_key_value, rollout, flag['exptIncludeAllTargets'], rollout_variations['includedInExpt']) # type: ignore

0 commit comments

Comments
 (0)