@@ -104,19 +104,19 @@ class DefaultDecisionService: OPTDecisionService {
104
104
105
105
let dummyEntityId = " $ "
106
106
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] )
111
108
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 ?? " "
117
114
118
115
// this means the user is not in the cmab experiment
119
116
if entityId != dummyEntityId {
117
+ let info = LogMessage . userNotInCmabExperiment ( user. userId, experiment. key)
118
+ logger. d ( info)
119
+ reasons. addInfo ( info)
120
120
return DecisionResponse ( result: nil , reasons: reasons)
121
121
}
122
122
@@ -198,7 +198,7 @@ class DefaultDecisionService: OPTDecisionService {
198
198
/// - opType: Operation type, either sync or async
199
199
/// - userProfileTracker: Optional tracker for user profile data.
200
200
/// - Returns: A `DecisionResponse` with the variation (if any) and decision reasons.
201
- private func getVariation( config: ProjectConfig ,
201
+ func getVariation( config: ProjectConfig ,
202
202
experiment: Experiment ,
203
203
user: OptimizelyUserContext ,
204
204
options: [ OptimizelyDecideOption ] ? = nil ,
0 commit comments