Skip to content

Commit 27d6a24

Browse files
[FSSDK-11528] Holdout support in decision service (#1075)
1 parent 51438cf commit 27d6a24

File tree

7 files changed

+565
-18
lines changed

7 files changed

+565
-18
lines changed

lib/core/bucketer/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export const bucket = function(bucketerParams: BucketerParams): DecisionResponse
5656
const decideReasons: DecisionReason[] = [];
5757
// Check if user is in a random group; if so, check if user is bucketed into a specific experiment
5858
const experiment = bucketerParams.experimentIdMap[bucketerParams.experimentId];
59-
const groupId = experiment['groupId'];
59+
// Optional chaining skips groupId check for holdout experiments; Holdout experimentId is not in experimentIdMap
60+
const groupId = experiment?.['groupId'];
6061
if (groupId) {
6162
const group = bucketerParams.groupIdMap[groupId];
6263
if (!group) {

0 commit comments

Comments
 (0)