aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm
diff options
context:
space:
mode:
authorGravatar Sebastian Schmidt <mrschmidt@google.com>2018-07-06 20:46:00 +0200
committerGravatar GitHub <noreply@github.com>2018-07-06 20:46:00 +0200
commit4c9df5a6661e12d6b3d11f69746ff256f0526653 (patch)
treea6bf509556d5190afc4b6699528bd615fa2fc106 /Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm
parente732be51e299774fa766d6ed2bcf4656f00ad1b0 (diff)
Add spec test support for target-scoped resume tokens (#1498)
Diffstat (limited to 'Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm')
-rw-r--r--Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm
index 63c3d72..e27fc65 100644
--- a/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm
+++ b/Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm
@@ -138,7 +138,7 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Helper methods.
-- (void)writeWatchChange:(FSTWatchChange *)change snapshotVersion:(const SnapshotVersion &)snap {
+- (void)writeWatchChange:(FSTWatchChange *)change snapshotVersion:(SnapshotVersion)snap {
if ([change isKindOfClass:[FSTWatchTargetChange class]]) {
FSTWatchTargetChange *targetChange = (FSTWatchTargetChange *)change;
if (targetChange.cause) {
@@ -152,6 +152,11 @@ NS_ASSUME_NONNULL_BEGIN
[self.activeTargets removeObjectForKey:targetID];
}
}
+ if ([targetChange.targetIDs count] != 0) {
+ // If the list of target IDs is not empty, we reset the snapshot version to NONE as
+ // done in `FSTSerializerBeta.versionFromListenResponse:`.
+ snap = SnapshotVersion::None();
+ }
}
[self.delegate watchStreamDidChange:change snapshotVersion:snap];
}