Skip to content

Commit fc8181f

Browse files
Merge branch 'master' into junaed/fssdk-11529-update-impression-event
2 parents 83b7017 + 27d6a24 commit fc8181f

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

lib/core/bucketer/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ 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+
// Optional chaining skips groupId check for holdout experiments; Holdout experimentId is not in experimentIdMap
5960
const groupId = experiment?.['groupId'];
6061
if (groupId) {
6162
const group = bucketerParams.groupIdMap[groupId];

lib/core/decision_service/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
} from '../../utils/enums';
2424
import {
2525
getAudiencesById,
26-
getExperimentAudienceConditions,
2726
getExperimentFromId,
2827
getExperimentFromKey,
2928
getFlagVariationByKey,
@@ -32,7 +31,6 @@ import {
3231
getVariationKeyFromId,
3332
isActive,
3433
ProjectConfig,
35-
getTrafficAllocation,
3634
getHoldoutsForFlag,
3735
} from '../../project_config/project_config';
3836
import { AudienceEvaluator, createAudienceEvaluator } from '../audience_evaluator';
@@ -47,7 +45,6 @@ import {
4745
Holdout,
4846
OptimizelyDecideOption,
4947
OptimizelyUserContext,
50-
TrafficAllocation,
5148
UserAttributes,
5249
UserProfile,
5350
UserProfileService,
@@ -123,7 +120,7 @@ export const USER_BUCKETED_INTO_HOLDOUT_VARIATION = 'User %s is in variation %s
123120
export const USER_NOT_BUCKETED_INTO_HOLDOUT_VARIATION = 'User %s is in no holdout variation.';
124121

125122
export interface DecisionObj {
126-
experiment: ExperimentCore | null;
123+
experiment: Experiment | Holdout | null;
127124
variation: Variation | null;
128125
decisionSource: DecisionSource;
129126
cmabUuid?: string;

lib/notification_center/type.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@
1515
*/
1616

1717
import { LogEvent } from '../event_processor/event_dispatcher/event_dispatcher';
18-
import { EventTags, ExperimentCore, FeatureVariableValue, UserAttributes, VariableType, Variation } from '../shared_types';
18+
import {
19+
EventTags,
20+
Experiment,
21+
FeatureVariableValue,
22+
Holdout,
23+
UserAttributes,
24+
VariableType,
25+
Variation,
26+
} from '../shared_types';
1927
import { DecisionSource } from '../utils/enums';
2028
import { Nullable } from '../utils/type';
2129

@@ -25,7 +33,7 @@ export type UserEventListenerPayload = {
2533
}
2634

2735
export type ActivateListenerPayload = UserEventListenerPayload & {
28-
experiment: ExperimentCore | null;
36+
experiment: Experiment | Holdout | null;
2937
variation: Variation | null;
3038
logEvent: LogEvent;
3139
}

0 commit comments

Comments
 (0)