From dad29e4a925a722e79eca58dad47c7b670fae882 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Wed, 2 Aug 2023 10:58:29 +0100 Subject: [PATCH] Set context logic fix --- Sources/OpenFeature/OpenFeatureAPI.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/OpenFeature/OpenFeatureAPI.swift b/Sources/OpenFeature/OpenFeatureAPI.swift index 4bb0671..a5535a3 100644 --- a/Sources/OpenFeature/OpenFeatureAPI.swift +++ b/Sources/OpenFeature/OpenFeatureAPI.swift @@ -37,8 +37,9 @@ public class OpenFeatureAPI { } public func setEvaluationContext(evaluationContext: EvaluationContext) { - getProvider()?.onContextSet(oldContext: self._context, newContext: evaluationContext) + let oldContext = self._context self._context = evaluationContext + getProvider()?.onContextSet(oldContext: oldContext, newContext: evaluationContext) } public func getEvaluationContext() -> EvaluationContext? {