@@ -165,7 +165,8 @@ - (void)fetchConfigWithExpirationDuration:(NSTimeInterval)expirationDuration
165
165
[NSError errorWithDomain: FIRRemoteConfigErrorDomain
166
166
code: FIRErrorCodeConfigFailed
167
167
userInfo: @{
168
- @" FetchError" : @" Duplicate request while the previous one is pending"
168
+ NSLocalizedDescriptionKey :
169
+ @" FetchError: Duplicate request while the previous one is pending"
169
170
}];
170
171
return [strongSelf reportCompletionOnHandler: completionHandler
171
172
withStatus: FIRRemoteConfigFetchStatusFailure
@@ -206,6 +207,7 @@ - (void)refreshInstanceIDTokenAndFetchCheckInInfoWithCompletionHandler:
206
207
NSString *errorDescription = @" Failed to get GCMSenderID" ;
207
208
FIRLogError (kFIRLoggerRemoteConfig , @" I-RCN000074" , @" %@ " ,
208
209
[NSString stringWithFormat: @" %@ " , errorDescription]);
210
+ self->_settings .isFetchInProgress = NO ;
209
211
return [self
210
212
reportCompletionOnHandler: completionHandler
211
213
withStatus: FIRRemoteConfigFetchStatusFailure
@@ -221,6 +223,7 @@ - (void)refreshInstanceIDTokenAndFetchCheckInInfoWithCompletionHandler:
221
223
[NSString stringWithFormat: @" Failed to get InstanceID token. Error : %@ ." , error];
222
224
FIRLogError (kFIRLoggerRemoteConfig , @" I-RCN000073" , @" %@ " ,
223
225
[NSString stringWithFormat: @" %@ " , errorDescription]);
226
+ self->_settings .isFetchInProgress = NO ;
224
227
return [self
225
228
reportCompletionOnHandler: completionHandler
226
229
withStatus: FIRRemoteConfigFetchStatusFailure
@@ -249,7 +252,8 @@ - (void)refreshInstanceIDTokenAndFetchCheckInInfoWithCompletionHandler:
249
252
[NSString stringWithFormat: @" Error getting iid : %@ ." , error];
250
253
FIRLogError (kFIRLoggerRemoteConfig , @" I-RCN000055" , @" %@ " ,
251
254
[NSString stringWithFormat: @" %@ " , errorDescription]);
252
- return [self
255
+ strongSelfQueue->_settings .isFetchInProgress = NO ;
256
+ return [strongSelfQueue
253
257
reportCompletionOnHandler: completionHandler
254
258
withStatus: FIRRemoteConfigFetchStatusFailure
255
259
withError: [NSError
@@ -345,6 +349,7 @@ - (void)fetchWithUserProperties:(NSDictionary *)userProperties
345
349
NSString *errString = [NSString stringWithFormat: @" Failed to compress the config request." ];
346
350
FIRLogWarning (kFIRLoggerRemoteConfig , @" I-RCN000033" , @" %@ " , errString);
347
351
352
+ self->_settings .isFetchInProgress = NO ;
348
353
return [self
349
354
reportCompletionOnHandler: completionHandler
350
355
withStatus: FIRRemoteConfigFetchStatusFailure
@@ -361,6 +366,10 @@ - (void)fetchWithUserProperties:(NSDictionary *)userProperties
361
366
FIRLogDebug (kFIRLoggerRemoteConfig , @" I-RCN000050" ,
362
367
@" config fetch completed. Error: %@ StatusCode: %ld " , (error ? error : @" nil" ),
363
368
(long )[((NSHTTPURLResponse *)response) statusCode ]);
369
+
370
+ // The fetch has completed.
371
+ self->_settings .isFetchInProgress = NO ;
372
+
364
373
RCNConfigFetch *fetcherCompletionSelf = weakSelf;
365
374
if (!fetcherCompletionSelf) {
366
375
return ;
@@ -372,7 +381,6 @@ - (void)fetchWithUserProperties:(NSDictionary *)userProperties
372
381
return ;
373
382
}
374
383
375
- strongSelf->_settings .isFetchInProgress = NO ;
376
384
NSInteger statusCode = [((NSHTTPURLResponse *)response) statusCode ];
377
385
378
386
if (error || (statusCode != kRCNFetchResponseHTTPStatusCodeOK )) {
0 commit comments