diff options
author | Michael Lehenbauer <mikelehen@gmail.com> | 2017-12-15 14:56:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-15 14:56:03 -0800 |
commit | d4de7a6e86476991e2363dd09f623b2f0edfbee4 (patch) | |
tree | 182dfb0a5143b9465f9f01d7424982da8d0a775d /Firestore/Source/Core/FSTView.h | |
parent | 98e08bc0b883d24cf2a0e658924ddd14dbf07d65 (diff) |
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.
Diffstat (limited to 'Firestore/Source/Core/FSTView.h')
-rw-r--r-- | Firestore/Source/Core/FSTView.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Firestore/Source/Core/FSTView.h b/Firestore/Source/Core/FSTView.h index ed230a3..beadf46 100644 --- a/Firestore/Source/Core/FSTView.h +++ b/Firestore/Source/Core/FSTView.h @@ -16,6 +16,7 @@ #import <Foundation/Foundation.h> +#import "Firestore/Source/Core/FSTTypes.h" #import "Firestore/Source/Model/FSTDocumentDictionary.h" #import "Firestore/Source/Model/FSTDocumentKeySet.h" @@ -138,6 +139,12 @@ typedef NS_ENUM(NSInteger, FSTLimboDocumentChangeType) { - (FSTViewChange *)applyChangesToDocuments:(FSTViewDocumentChanges *)docChanges targetChange:(nullable FSTTargetChange *)targetChange; +/** + * Applies an FSTOnlineState change to the view, potentially generating an FSTViewChange if the + * view's syncState changes as a result. + */ +- (FSTViewChange *)applyOnlineStateChange:(FSTOnlineState)onlineState; + @end NS_ASSUME_NONNULL_END |