File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,13 @@ class DefaultDecisionService: OPTDecisionService {
84
84
return DecisionResponse ( result: nil , reasons: reasons)
85
85
}
86
86
87
+ // We do not choose the alternative solution (checking and rejecting if on the main thread)
88
+ // because it would lead to inconsistent decision results:
89
+ // - If the decision is called from the main thread, CMAB logic is skipped and an error is logged.
90
+ // - If called from a background thread, CMAB logic is included.
91
+ // This means the same API could return different results based on thread context, which is confusing for users.
92
+ // Instead, we pass an `isAsync` boolean to ensure that CMAB will be evaluated only for async calls.
93
+
87
94
guard isAsync else {
88
95
let info = LogMessage . cmabNotSupportedInSyncMode
89
96
logger. e ( info)
You can’t perform that action at this time.
0 commit comments