@@ -165,7 +165,8 @@ - (void)fetchConfigWithExpirationDuration:(NSTimeInterval)expirationDuration
165165 [NSError errorWithDomain: FIRRemoteConfigErrorDomain
166166 code: FIRErrorCodeConfigFailed
167167 userInfo: @{
168- @" FetchError" : @" Duplicate request while the previous one is pending"
168+ NSLocalizedDescriptionKey :
169+ @" FetchError: Duplicate request while the previous one is pending"
169170 }];
170171 return [strongSelf reportCompletionOnHandler: completionHandler
171172 withStatus: FIRRemoteConfigFetchStatusFailure
@@ -206,6 +207,7 @@ - (void)refreshInstanceIDTokenAndFetchCheckInInfoWithCompletionHandler:
206207 NSString *errorDescription = @" Failed to get GCMSenderID" ;
207208 FIRLogError (kFIRLoggerRemoteConfig , @" I-RCN000074" , @" %@ " ,
208209 [NSString stringWithFormat: @" %@ " , errorDescription]);
210+ self->_settings .isFetchInProgress = NO ;
209211 return [self
210212 reportCompletionOnHandler: completionHandler
211213 withStatus: FIRRemoteConfigFetchStatusFailure
@@ -221,6 +223,7 @@ - (void)refreshInstanceIDTokenAndFetchCheckInInfoWithCompletionHandler:
221223 [NSString stringWithFormat: @" Failed to get InstanceID token. Error : %@ ." , error];
222224 FIRLogError (kFIRLoggerRemoteConfig , @" I-RCN000073" , @" %@ " ,
223225 [NSString stringWithFormat: @" %@ " , errorDescription]);
226+ self->_settings .isFetchInProgress = NO ;
224227 return [self
225228 reportCompletionOnHandler: completionHandler
226229 withStatus: FIRRemoteConfigFetchStatusFailure
@@ -249,7 +252,8 @@ - (void)refreshInstanceIDTokenAndFetchCheckInInfoWithCompletionHandler:
249252 [NSString stringWithFormat: @" Error getting iid : %@ ." , error];
250253 FIRLogError (kFIRLoggerRemoteConfig , @" I-RCN000055" , @" %@ " ,
251254 [NSString stringWithFormat: @" %@ " , errorDescription]);
252- return [self
255+ strongSelfQueue->_settings .isFetchInProgress = NO ;
256+ return [strongSelfQueue
253257 reportCompletionOnHandler: completionHandler
254258 withStatus: FIRRemoteConfigFetchStatusFailure
255259 withError: [NSError
@@ -345,6 +349,7 @@ - (void)fetchWithUserProperties:(NSDictionary *)userProperties
345349 NSString *errString = [NSString stringWithFormat: @" Failed to compress the config request." ];
346350 FIRLogWarning (kFIRLoggerRemoteConfig , @" I-RCN000033" , @" %@ " , errString);
347351
352+ self->_settings .isFetchInProgress = NO ;
348353 return [self
349354 reportCompletionOnHandler: completionHandler
350355 withStatus: FIRRemoteConfigFetchStatusFailure
@@ -361,6 +366,10 @@ - (void)fetchWithUserProperties:(NSDictionary *)userProperties
361366 FIRLogDebug (kFIRLoggerRemoteConfig , @" I-RCN000050" ,
362367 @" config fetch completed. Error: %@ StatusCode: %ld " , (error ? error : @" nil" ),
363368 (long )[((NSHTTPURLResponse *)response) statusCode ]);
369+
370+ // The fetch has completed.
371+ self->_settings .isFetchInProgress = NO ;
372+
364373 RCNConfigFetch *fetcherCompletionSelf = weakSelf;
365374 if (!fetcherCompletionSelf) {
366375 return ;
@@ -372,7 +381,6 @@ - (void)fetchWithUserProperties:(NSDictionary *)userProperties
372381 return ;
373382 }
374383
375- strongSelf->_settings .isFetchInProgress = NO ;
376384 NSInteger statusCode = [((NSHTTPURLResponse *)response) statusCode ];
377385
378386 if (error || (statusCode != kRCNFetchResponseHTTPStatusCodeOK )) {
0 commit comments