Skip to content

[FSSDK-11172] feat: update decision service to handle CMAB #602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jul 14, 2025
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b40adda
wip: cmab client done
muzahidul-opti Jun 18, 2025
9c9b9b0
Update test cases
muzahidul-opti Jun 18, 2025
d998e0b
wip: add test cases for cmab services
muzahidul-opti Jun 20, 2025
c427a46
Merge branch 'master' into muzahid/cmab-service
muzahidul-opti Jun 24, 2025
8e168f6
Added log for cmab decision
muzahidul-opti Jun 24, 2025
0c4d072
Update copyright date
muzahidul-opti Jun 24, 2025
f342ae2
CMAB decision implemented
muzahidul-opti Jun 26, 2025
ebbde3c
CmabService testcases added for sync getDecision function
muzahidul-opti Jun 27, 2025
92d3140
Add factory method for DefaultCmabService
muzahidul-opti Jun 27, 2025
c6507b0
DefaultDecision initializer updated
muzahidul-opti Jun 27, 2025
b51c228
Add operation type enum
muzahidul-opti Jun 27, 2025
e9d01ac
CMAB not supported in sync mode
muzahidul-opti Jun 27, 2025
e827b27
Reuse experiment bucketing logic
muzahidul-opti Jun 27, 2025
445006b
Add seperate method for group exlusion, add bucketToEntityId method
muzahidul-opti Jun 30, 2025
b9ce0f5
Update bucketing logic for cmab experiment
muzahidul-opti Jun 30, 2025
093e372
Add test cases for cmab experiement
muzahidul-opti Jun 30, 2025
f2cc7df
Add test cases for cmab decision options
muzahidul-opti Jul 2, 2025
f0c1d5b
Merge branch 'master' into muzahid/cmab-decision
muzahidul-opti Jul 2, 2025
384bfa8
Add test cases for bucketToEntity
muzahidul-opti Jul 3, 2025
87bcecf
Return feature dicision with nil variation for CMAB fetch error
muzahidul-opti Jul 4, 2025
d1067d6
Add code doc and fix linting issue
muzahidul-opti Jul 4, 2025
0d761c9
Update cmab entity id matching logic
muzahidul-opti Jul 4, 2025
eab9755
Update code documentation
muzahidul-opti Jul 9, 2025
771f279
Correct spelling mistake
muzahidul-opti Jul 9, 2025
2cd2981
Add explanation about async behavior
muzahidul-opti Jul 10, 2025
45140d9
Add comment about cmab error handling
muzahidul-opti Jul 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add comment about cmab error handling
  • Loading branch information
muzahidul-opti committed Jul 11, 2025
commit 45140d91b6a09517884ff668f683bf7e3fb12f5c
9 changes: 7 additions & 2 deletions Sources/Implementation/DefaultDecisionService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,13 @@ class DefaultDecisionService: OPTDecisionService {
options: options)
reasons.merge(decisionResponse.reasons)
if let result = decisionResponse.result {
if result.cmabError || result.variation != nil {
let featureDecision = FeatureDecision(experiment: experiment, variation: result.variation, source: Constants.DecisionSource.featureTest.rawValue, cmabUUID: result.cmabUUID)
if result.cmabError {
// For CMAB - we're supposed to get decision from the server.
// If failed, return decision with nil variation, so the client can take care of them.
let featureDecision = FeatureDecision(experiment: experiment, variation: nil, source: Constants.DecisionSource.featureTest.rawValue)
return DecisionResponse(result: featureDecision, reasons: reasons)
} else if let variation = result.variation {
let featureDecision = FeatureDecision(experiment: experiment, variation: variation, source: Constants.DecisionSource.featureTest.rawValue)
return DecisionResponse(result: featureDecision, reasons: reasons)
}
}
Expand Down
Loading