aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Remote/FSTOnlineStateTracker.h
diff options
context:
space:
mode:
authorGravatar Michael Lehenbauer <mikelehen@gmail.com>2018-03-26 13:24:32 -0700
committerGravatar GitHub <noreply@github.com>2018-03-26 13:24:32 -0700
commite0e6625f3ef573ebcf10ce6b298939ccbea25532 (patch)
tree2ed51208ddd994c3fcd581f7b167f9cfd3b27d74 /Firestore/Source/Remote/FSTOnlineStateTracker.h
parentf77ec68a8862bd03b430deff48022ffb179172b0 (diff)
Fix issue that could cause offline get()s to wait up to 10 seconds. (#978)
Port of https://github.com/firebase/firebase-js-sdk/pull/592 FSTOnlineStateTracker was reverting to OnlineState Unknown on every stream attempt rather than remaining Offline once the offline heuristic had been met (i.e. 2 stream failures or 10 seconds). This means that getDocument() requests made while offline could be delayed up to 10 seconds each time (or until the next backoff attempt failed).
Diffstat (limited to 'Firestore/Source/Remote/FSTOnlineStateTracker.h')
-rw-r--r--Firestore/Source/Remote/FSTOnlineStateTracker.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Firestore/Source/Remote/FSTOnlineStateTracker.h b/Firestore/Source/Remote/FSTOnlineStateTracker.h
index a414a18..2521c84 100644
--- a/Firestore/Source/Remote/FSTOnlineStateTracker.h
+++ b/Firestore/Source/Remote/FSTOnlineStateTracker.h
@@ -43,9 +43,10 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, weak) id<FSTOnlineStateDelegate> onlineStateDelegate;
/**
- * Called by FSTRemoteStore when a watch stream is started.
+ * Called by FSTRemoteStore when a watch stream is started (including on each backoff attempt).
*
- * It sets the FSTOnlineState to Unknown and starts the onlineStateTimer if necessary.
+ * If this is the first attempt, it sets the FSTOnlineState to Unknown and starts the
+ * onlineStateTimer.
*/
- (void)handleWatchStreamStart;