From 34ebf10b0acc65f1924d723e82085d4104bc281d Mon Sep 17 00:00:00 2001 From: Michael Lehenbauer Date: Mon, 5 Mar 2018 09:49:41 -0800 Subject: Add 10 second timeout waiting for connection before client behaves as-if offline. (#872) [Port of https://github.com/firebase/firebase-js-sdk/commit/0fa319e5e019dd0d40ab441d2ff9f8f6d4724e43] * Refactored FSTOnlineState tracking out of FSTRemoteStore and into new FSTOnlineStateTracker component. * Added a 10 second timeout to transition from OnlineState.Unknown to OnlineState.Offline rather than waiting indefinitely for the stream to succeed or fail. * Removed hack to run SpecTests using an FSTDispatchQueue that wrapped dispatch_get_main_queue(). This was incompatible with [FSTDispatchQueue runDelayedCallbacksUntil:] since it queues work and blocks waiting for it to complete. Now spec tests create / use a proper FSTDispatchQueue. * Added a SpecTest to verify OnlineState timeout behavior. * Misc cleanup: * Renamed FSTOnlineState states: Failed => Offline, Healthy => Online * Renamed FSTTimerIds (ListenStreamConnection => ListenStreamConnectionBackoff) * Added ability to run timers from spec tests. --- Firestore/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Firestore/CHANGELOG.md') diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index b472f0c..9b35ea3 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -1,4 +1,8 @@ # Unreleased +- [changed] If the SDK's attempt to connect to the Cloud Firestore backend + neither succeeds nor fails within 10 seconds, the SDK will consider itself + "offline", causing getDocument() calls to resolve with cached results, rather + than continuing to wait. # v0.10.2 - [changed] When you delete a FirebaseApp, the associated Firestore instances -- cgit v1.2.3