Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions FirebaseRemoteConfig/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 12.2.0
- [fixed] Fixed a race condition that could lead to a crash during network
session recreation. (#15087)

# 12.0.0
- [added] Improved how the SDK handles real-time requests when a Firebase
project has exceeded its available quota for real-time services.
Expand Down
6 changes: 3 additions & 3 deletions FirebaseRemoteConfig/Sources/FIRRemoteConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ - (FIRRemoteConfigSettings *)configSettings {
dispatch_sync(_queue, ^{
minimumFetchInterval = self->_settings.minimumFetchInterval;
fetchTimeout = self->_settings.fetchTimeout;
// The NSURLSession needs to be recreated whenever the fetch timeout may be updated.
[_configFetch recreateNetworkSession];
});
FIRLogDebug(kFIRLoggerRemoteConfig, @"I-RCN000066",
@"Successfully read configSettings. Minimum Fetch Interval:%f, "
Expand All @@ -708,8 +710,6 @@ - (FIRRemoteConfigSettings *)configSettings {
FIRRemoteConfigSettings *settings = [[FIRRemoteConfigSettings alloc] init];
settings.minimumFetchInterval = minimumFetchInterval;
settings.fetchTimeout = fetchTimeout;
/// The NSURLSession needs to be recreated whenever the fetch timeout may be updated.
[_configFetch recreateNetworkSession];
return settings;
}

Expand All @@ -721,7 +721,7 @@ - (void)setConfigSettings:(FIRRemoteConfigSettings *)configSettings {

self->_settings.minimumFetchInterval = configSettings.minimumFetchInterval;
self->_settings.fetchTimeout = configSettings.fetchTimeout;
/// The NSURLSession needs to be recreated whenever the fetch timeout may be updated.
// The NSURLSession needs to be recreated whenever the fetch timeout may be updated.
[self->_configFetch recreateNetworkSession];
FIRLogDebug(kFIRLoggerRemoteConfig, @"I-RCN000067",
@"Successfully set configSettings. Minimum Fetch Interval:%f, "
Expand Down
1 change: 1 addition & 0 deletions FirebaseRemoteConfig/Sources/RCNConfigFetch.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ - (instancetype)initWithContent:(RCNConfigContent *)content
}

/// Force a new NSURLSession creation for updated config.
/// - Warning: This API is **not** thread-safe.
- (void)recreateNetworkSession {
if (_fetchSession) {
[_fetchSession invalidateAndCancel];
Expand Down
Loading