File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -138,17 +138,16 @@ export const bucket = function(bucketerParams: BucketerParams): DecisionResponse
138
138
] ) ;
139
139
140
140
const entityId = _findBucket ( bucketValue , bucketerParams . trafficAllocationConfig ) ;
141
- if ( entityId !== null ) {
142
- if ( ! bucketerParams . variationIdMap [ entityId ] ) {
143
- if ( entityId ) {
144
- bucketerParams . logger ?. warn ( INVALID_VARIATION_ID ) ;
145
- decideReasons . push ( [ INVALID_VARIATION_ID ] ) ;
146
- }
147
- return {
148
- result : null ,
149
- reasons : decideReasons ,
150
- } ;
141
+
142
+ if ( bucketerParams . validateEntity && entityId !== null && ! bucketerParams . variationIdMap [ entityId ] ) {
143
+ if ( entityId ) {
144
+ bucketerParams . logger ?. warn ( INVALID_VARIATION_ID ) ;
145
+ decideReasons . push ( [ INVALID_VARIATION_ID ] ) ;
151
146
}
147
+ return {
148
+ result : null ,
149
+ reasons : decideReasons ,
150
+ } ;
152
151
}
153
152
154
153
return {
Original file line number Diff line number Diff line change @@ -594,12 +594,16 @@ export class DecisionService {
594
594
bucketingId : string ,
595
595
userId : string
596
596
) : BucketerParams {
597
+ let validateEntity = true ;
598
+
597
599
let trafficAllocationConfig : TrafficAllocation [ ] = getTrafficAllocation ( configObj , experiment . id ) ;
598
600
if ( experiment . cmab ) {
599
601
trafficAllocationConfig = [ {
600
602
entityId : CMAB_DUMMY_ENTITY_ID ,
601
603
endOfRange : experiment . cmab . trafficAllocation
602
604
} ] ;
605
+
606
+ validateEntity = false ;
603
607
}
604
608
605
609
return {
@@ -613,6 +617,7 @@ export class DecisionService {
613
617
trafficAllocationConfig,
614
618
userId,
615
619
variationIdMap : configObj . variationIdMap ,
620
+ validateEntity,
616
621
}
617
622
}
618
623
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ export interface BucketerParams {
64
64
variationIdMap : { [ id : string ] : Variation } ;
65
65
logger ?: LoggerFacade ;
66
66
bucketingId : string ;
67
+ validateEntity ?: boolean ;
67
68
}
68
69
69
70
export interface DecisionResponse < T > {
You can’t perform that action at this time.
0 commit comments