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 {
8484 return DecisionResponse ( result: nil , reasons: reasons)
8585 }
8686
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+
8794 guard isAsync else {
8895 let info = LogMessage . cmabNotSupportedInSyncMode
8996 logger. e ( info)
You can’t perform that action at this time.
0 commit comments