From 1c7223a0abe58e396eb33871f30f43c7e0a98f29 Mon Sep 17 00:00:00 2001 From: Yan Zaitsev Date: Thu, 3 Oct 2024 17:19:23 +0530 Subject: [PATCH] Wrap _listeners access with _realtimeLockQueue in fetchLatestConfig completionHandler --- FirebaseRemoteConfig/Sources/RCNConfigRealtime.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/FirebaseRemoteConfig/Sources/RCNConfigRealtime.m b/FirebaseRemoteConfig/Sources/RCNConfigRealtime.m index 921bb31dce3..d57c76187d0 100644 --- a/FirebaseRemoteConfig/Sources/RCNConfigRealtime.m +++ b/FirebaseRemoteConfig/Sources/RCNConfigRealtime.m @@ -462,10 +462,12 @@ - (void)fetchLatestConfig:(NSInteger)remainingAttempts targetVersion:(NSInteger) integerValue] >= targetVersion) { // only notify listeners if there is a change if ([update updatedKeys].count > 0) { - for (RCNConfigUpdateCompletion listener in strongSelf - ->_listeners) { - listener(update, nil); - } + dispatch_async(strongSelf->_realtimeLockQueue, ^{ + for (RCNConfigUpdateCompletion listener in strongSelf + ->_listeners) { + listener(update, nil); + } + }); } } else { FIRLogDebug(