@@ -104,19 +104,19 @@ class DefaultDecisionService: OPTDecisionService {
104104
105105 let dummyEntityId = " $ "
106106 let cmabTrafficAllocation = TrafficAllocation ( entityId: dummyEntityId, endOfRange: cmab. trafficAllocation)
107- var cmabExp = experiment
108- // Replace the regular allocaion with cmab traffic allocation
109- // to reuse the experiment bucketing logic
110- cmabExp. trafficAllocation = [ cmabTrafficAllocation]
107+ let bucketedResponse = ( bucketer as? DefaultBucketer ) ? . bucketToEntityId ( config: config, experiment: experiment, bucketingId: bucketingId, trafficAllocation: [ cmabTrafficAllocation] )
111108
112- let bucketedResponse = bucketer . bucketExperiment ( config : config , experiment : cmabExp , bucketingId : bucketingId )
113-
114- reasons . merge ( bucketedResponse . reasons )
115-
116- let entityId = bucketedResponse. result? . id
109+ if let _reasons = bucketedResponse ? . reasons {
110+ reasons . merge ( _reasons )
111+ }
112+
113+ let entityId = bucketedResponse? . result ?? " "
117114
118115 // this means the user is not in the cmab experiment
119116 if entityId != dummyEntityId {
117+ let info = LogMessage . userNotInCmabExperiment ( user. userId, experiment. key)
118+ logger. d ( info)
119+ reasons. addInfo ( info)
120120 return DecisionResponse ( result: nil , reasons: reasons)
121121 }
122122
@@ -198,7 +198,7 @@ class DefaultDecisionService: OPTDecisionService {
198198 /// - opType: Operation type, either sync or async
199199 /// - userProfileTracker: Optional tracker for user profile data.
200200 /// - Returns: A `DecisionResponse` with the variation (if any) and decision reasons.
201- private func getVariation( config: ProjectConfig ,
201+ func getVariation( config: ProjectConfig ,
202202 experiment: Experiment ,
203203 user: OptimizelyUserContext ,
204204 options: [ OptimizelyDecideOption ] ? = nil ,
0 commit comments