Skip to content

Commit 349efba

Browse files
CopilotMat001FarhanAnjum-opti
authored
[FSSDK-11953] java-sdk CMAB: Fix missing bucketing reasons in CMAB decision path (#592)
* Initial plan * Fix missing CMAB bucketing reasons in decision process Added merge of bucketing reasons for CMAB experiments to ensure traffic allocation information is included in decision responses. Co-authored-by: Mat001 <[email protected]> * fix: missing decision reasons added in cmab flow --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Mat001 <[email protected]> Co-authored-by: Matjaz Pirnovar <[email protected]> Co-authored-by: FarhanAnjum-opti <[email protected]>
1 parent 7a7cf79 commit 349efba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ public DecisionResponse<Variation> getVariation(@Nonnull Experiment experiment,
172172
String bucketingId = getBucketingId(user.getUserId(), user.getAttributes());
173173
String cmabUuid = null;
174174
decisionVariation = bucketer.bucket(experiment, bucketingId, projectConfig, decisionPath);
175+
reasons.merge(decisionVariation.getReasons());
175176
if (decisionPath == DecisionPath.WITH_CMAB && isCmabExperiment(experiment) && decisionVariation.getResult() != null) {
176177
// group-allocation and traffic-allocation checking passed for cmab
177-
// we need server decision overruling local bucketing for cmab
178+
// we need server decision overruling local bucketing for cmab
178179
DecisionResponse<CmabDecision> cmabDecision = getDecisionForCmabExperiment(projectConfig, experiment, user, bucketingId, options);
179180
reasons.merge(cmabDecision.getReasons());
180181

@@ -197,7 +198,6 @@ public DecisionResponse<Variation> getVariation(@Nonnull Experiment experiment,
197198
}
198199
} else {
199200
// Standard bucketing for non-CMAB experiments
200-
reasons.merge(decisionVariation.getReasons());
201201
variation = decisionVariation.getResult();
202202
}
203203

0 commit comments

Comments
 (0)