From d4de7a6e86476991e2363dd09f623b2f0edfbee4 Mon Sep 17 00:00:00 2001 From: Michael Lehenbauer Date: Fri, 15 Dec 2017 14:56:03 -0800 Subject: b/68276665: Raise isFromCache=true events when offline (#567) * Plumbs FSTOnlineState changes through to views. * View sets this.current to false on FSTOnlineStateFailed, triggering isFromCache=true events. It will automatically be returned to true once the listen is reestablished and we get a new CURRENT message. * Updated tests (and added one new one) to verify behavior. * Unifies setOnlineStateToUnknown, setOnlineStateToHealthy, and updateAndBroadcastOnlineState into a single updateOnlineState method. * Split disableNetwork into (public) disableNetwork and (private) disableNetworkWithTargetOnlineState methods.. * Some miscellaneous comment cleanup. * Add missing comment per CR feedback. --- Firestore/CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Firestore/CHANGELOG.md') diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index 8daae91..59858e6 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -1,4 +1,4 @@ -# Unreleased +# Unreleased (firestore-api-changes) - [changed] Removed the includeMetadataChanges property in FIRDocumentListenOptions to avoid confusion with the factory method of the same name. - [changed] Added a commit method that takes no completion handler to FIRWriteBatch. @@ -8,6 +8,11 @@ - [changed] For non-existing documents, DocumentSnapshot.data() now returns `nil` instead of throwing an exception. A non-nullable QueryDocumentSnapshot is introduced for Queries to reduce the number of nil-checks in your code. +- [changed] Snapshot listeners (with the `includeMetadataChanges` option + enabled) now receive an event with `snapshot.metadata.isFromCache` set to + `true` if the SDK loses its connection to the backend. A new event with + `snapshot.metadata.isFromCache` set to false will be raised once the + connection is restored and the query is in sync with the backend again. # v0.9.4 - [changed] Firestore no longer has a direct dependency on FirebaseAuth. -- cgit v1.2.3