From ff97c006523343c87781965d955d3822c30ff0ae Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Wed, 18 Jan 2023 22:25:19 -0800 Subject: [PATCH 1/7] upload initial code --- .../firebase/firestore/core/SyncEngine.java | 3 +- .../firestore/local/LocalSerializer.java | 3 +- .../firebase/firestore/local/TargetData.java | 44 ++++++++++++++++--- .../firestore/remote/RemoteSerializer.java | 4 ++ .../firestore/remote/RemoteStore.java | 9 +++- .../firestore/local/LocalSerializerTest.java | 3 +- .../firestore/local/TargetCacheTestCase.java | 3 +- 7 files changed, 58 insertions(+), 11 deletions(-) diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/core/SyncEngine.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/core/SyncEngine.java index c7da9e27e18..b8655d91656 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/core/SyncEngine.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/core/SyncEngine.java @@ -203,13 +203,14 @@ public int listen(Query query) { hardAssert(!queryViewsByQuery.containsKey(query), "We already listen to query: %s", query); TargetData targetData = localStore.allocateTarget(query.toTarget()); - remoteStore.listen(targetData); ViewSnapshot viewSnapshot = initializeViewAndComputeSnapshot( query, targetData.getTargetId(), targetData.getResumeToken()); syncEngineListener.onViewSnapshots(Collections.singletonList(viewSnapshot)); + remoteStore.listen(targetData); + return targetData.getTargetId(); } diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalSerializer.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalSerializer.java index fb4e476b411..98fb7230821 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalSerializer.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/LocalSerializer.java @@ -260,7 +260,8 @@ TargetData decodeTargetData(com.google.firebase.firestore.proto.Target targetPro QueryPurpose.LISTEN, version, lastLimboFreeSnapshotVersion, - resumeToken); + resumeToken, + null); } public com.google.firestore.bundle.BundledQuery encodeBundledQuery(BundledQuery bundledQuery) { diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java index 18375731fe0..60413198c15 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java @@ -16,6 +16,7 @@ import static com.google.firebase.firestore.util.Preconditions.checkNotNull; +import androidx.annotation.Nullable; import com.google.firebase.firestore.core.Target; import com.google.firebase.firestore.model.SnapshotVersion; import com.google.firebase.firestore.remote.WatchStream; @@ -30,6 +31,7 @@ public final class TargetData { private final SnapshotVersion snapshotVersion; private final SnapshotVersion lastLimboFreeSnapshotVersion; private final ByteString resumeToken; + private final @Nullable Integer expectedCount; /** * Creates a new TargetData with the given values. @@ -45,6 +47,9 @@ public final class TargetData { * @param resumeToken An opaque, server-assigned token that allows watching a target to be resumed * after disconnecting without retransmitting all the data that matches the target. The resume * token essentially identifies a point in time from which the server should resume sending + * @param expectedCount The number of documents that last matched the query at the resume token or + * read time. Documents are counted only when making a listen request with resume token or + * read time, otherwise, keep it null. */ TargetData( Target target, @@ -53,7 +58,8 @@ public final class TargetData { QueryPurpose purpose, SnapshotVersion snapshotVersion, SnapshotVersion lastLimboFreeSnapshotVersion, - ByteString resumeToken) { + ByteString resumeToken, + @Nullable Integer expectedCount) { this.target = checkNotNull(target); this.targetId = targetId; this.sequenceNumber = sequenceNumber; @@ -61,6 +67,7 @@ public final class TargetData { this.purpose = purpose; this.snapshotVersion = checkNotNull(snapshotVersion); this.resumeToken = checkNotNull(resumeToken); + this.expectedCount = expectedCount; } /** Convenience constructor for use when creating a TargetData for the first time. */ @@ -72,7 +79,8 @@ public TargetData(Target target, int targetId, long sequenceNumber, QueryPurpose purpose, SnapshotVersion.NONE, SnapshotVersion.NONE, - WatchStream.EMPTY_RESUME_TOKEN); + WatchStream.EMPTY_RESUME_TOKEN, + null); } /** Creates a new target data instance with an updated sequence number. */ @@ -84,7 +92,8 @@ public TargetData withSequenceNumber(long sequenceNumber) { purpose, snapshotVersion, lastLimboFreeSnapshotVersion, - resumeToken); + resumeToken, + expectedCount); } /** Creates a new target data instance with an updated resume token and snapshot version. */ @@ -96,7 +105,21 @@ public TargetData withResumeToken(ByteString resumeToken, SnapshotVersion snapsh purpose, snapshotVersion, lastLimboFreeSnapshotVersion, - resumeToken); + resumeToken, + expectedCount); + } + + /** Creates a new target data instance with an updated expected count. */ + public TargetData withExpectedCount(Integer expectedCount) { + return new TargetData( + target, + targetId, + sequenceNumber, + purpose, + snapshotVersion, + lastLimboFreeSnapshotVersion, + resumeToken, + expectedCount); } /** Creates a new target data instance with an updated last limbo free snapshot version number. */ @@ -108,7 +131,8 @@ public TargetData withLastLimboFreeSnapshotVersion(SnapshotVersion lastLimboFree purpose, snapshotVersion, lastLimboFreeSnapshotVersion, - resumeToken); + resumeToken, + expectedCount); } public Target getTarget() { @@ -135,6 +159,10 @@ public ByteString getResumeToken() { return resumeToken; } + public Integer getExpectedCount() { + return expectedCount; + } + /** * Returns the last snapshot version for which the associated view contained no limbo documents. */ @@ -158,7 +186,8 @@ public boolean equals(Object o) { && purpose.equals(targetData.purpose) && snapshotVersion.equals(targetData.snapshotVersion) && lastLimboFreeSnapshotVersion.equals(targetData.lastLimboFreeSnapshotVersion) - && resumeToken.equals(targetData.resumeToken); + && resumeToken.equals(targetData.resumeToken) + && (expectedCount==null && expectedCount.equals(targetData.expectedCount)); } @Override @@ -170,6 +199,7 @@ public int hashCode() { result = 31 * result + snapshotVersion.hashCode(); result = 31 * result + lastLimboFreeSnapshotVersion.hashCode(); result = 31 * result + resumeToken.hashCode(); + result = 31 * result + expectedCount.hashCode(); return result; } @@ -190,6 +220,8 @@ public String toString() { + lastLimboFreeSnapshotVersion + ", resumeToken=" + resumeToken + + ", expectedCount=" + + expectedCount + '}'; } } diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java index 57f51a7b8cc..74ba575386b 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java @@ -499,6 +499,10 @@ public Target encodeTarget(TargetData targetData) { builder.setResumeToken(targetData.getResumeToken()); } + if (targetData.getExpectedCount() != null) { + builder.setExpectedCount(Int32Value.newBuilder().setValue(targetData.getExpectedCount())); + } + return builder.build(); } diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java index 3999f22a939..cc52fa6f6cb 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java @@ -369,7 +369,14 @@ public void listen(TargetData targetData) { private void sendWatchRequest(TargetData targetData) { watchChangeAggregator.recordPendingTargetRequest(targetData.getTargetId()); - watchStream.watchQuery(targetData); + if (!targetData.getResumeToken().isEmpty() + || targetData.getSnapshotVersion().compareTo(SnapshotVersion.NONE) > 0) { + int expectedCount = this.getRemoteKeysForTarget(targetData.getTargetId()).size(); + TargetData newTargetData = targetData.withExpectedCount(expectedCount); + watchStream.watchQuery(newTargetData); + } else { + watchStream.watchQuery(targetData); + } } /** diff --git a/firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalSerializerTest.java b/firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalSerializerTest.java index 124727f5681..c7fbf4a9d5a 100644 --- a/firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalSerializerTest.java +++ b/firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalSerializerTest.java @@ -378,7 +378,8 @@ public void testEncodesTargetData() { QueryPurpose.LISTEN, snapshotVersion, limboFreeVersion, - resumeToken); + resumeToken, + null); // Let the RPC serializer test various permutations of query serialization. com.google.firestore.v1.Target.QueryTarget queryTarget = diff --git a/firebase-firestore/src/test/java/com/google/firebase/firestore/local/TargetCacheTestCase.java b/firebase-firestore/src/test/java/com/google/firebase/firestore/local/TargetCacheTestCase.java index e098f7666f1..9a25afa94cc 100644 --- a/firebase-firestore/src/test/java/com/google/firebase/firestore/local/TargetCacheTestCase.java +++ b/firebase-firestore/src/test/java/com/google/firebase/firestore/local/TargetCacheTestCase.java @@ -331,7 +331,8 @@ private TargetData newTargetData(Query query, int targetId, long version) { QueryPurpose.LISTEN, version(version), version(version), - resumeToken(version)); + resumeToken(version), + null); } /** Adds the given query data to the targetCache under test, committing immediately. */ From f8768249a92516fd839aa564cc4762aea0fee799 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Wed, 18 Jan 2023 22:49:15 -0800 Subject: [PATCH 2/7] format --- .../java/com/google/firebase/firestore/local/TargetData.java | 3 +-- .../google/firebase/firestore/local/LocalSerializerTest.java | 2 +- .../google/firebase/firestore/local/TargetCacheTestCase.java | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java index 60413198c15..a0bec3e3e17 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java @@ -186,8 +186,7 @@ public boolean equals(Object o) { && purpose.equals(targetData.purpose) && snapshotVersion.equals(targetData.snapshotVersion) && lastLimboFreeSnapshotVersion.equals(targetData.lastLimboFreeSnapshotVersion) - && resumeToken.equals(targetData.resumeToken) - && (expectedCount==null && expectedCount.equals(targetData.expectedCount)); + && resumeToken.equals(targetData.resumeToken); } @Override diff --git a/firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalSerializerTest.java b/firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalSerializerTest.java index c7fbf4a9d5a..20223e78dec 100644 --- a/firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalSerializerTest.java +++ b/firebase-firestore/src/test/java/com/google/firebase/firestore/local/LocalSerializerTest.java @@ -379,7 +379,7 @@ public void testEncodesTargetData() { snapshotVersion, limboFreeVersion, resumeToken, - null); + null); // Let the RPC serializer test various permutations of query serialization. com.google.firestore.v1.Target.QueryTarget queryTarget = diff --git a/firebase-firestore/src/test/java/com/google/firebase/firestore/local/TargetCacheTestCase.java b/firebase-firestore/src/test/java/com/google/firebase/firestore/local/TargetCacheTestCase.java index 9a25afa94cc..58a3a57ba69 100644 --- a/firebase-firestore/src/test/java/com/google/firebase/firestore/local/TargetCacheTestCase.java +++ b/firebase-firestore/src/test/java/com/google/firebase/firestore/local/TargetCacheTestCase.java @@ -332,7 +332,7 @@ private TargetData newTargetData(Query query, int targetId, long version) { version(version), version(version), resumeToken(version), - null); + null); } /** Adds the given query data to the targetCache under test, committing immediately. */ From d7806f38533eee2e0f8572facbac73fb7aa29b58 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Thu, 19 Jan 2023 10:26:50 -0800 Subject: [PATCH 3/7] add expectedCount assertion to spec test --- .../com/google/firebase/firestore/local/TargetData.java | 6 ++++-- .../com/google/firebase/firestore/spec/SpecTestCase.java | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java index a0bec3e3e17..836c014338a 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java @@ -159,6 +159,7 @@ public ByteString getResumeToken() { return resumeToken; } + @Nullable public Integer getExpectedCount() { return expectedCount; } @@ -186,7 +187,8 @@ public boolean equals(Object o) { && purpose.equals(targetData.purpose) && snapshotVersion.equals(targetData.snapshotVersion) && lastLimboFreeSnapshotVersion.equals(targetData.lastLimboFreeSnapshotVersion) - && resumeToken.equals(targetData.resumeToken); + && resumeToken.equals(targetData.resumeToken) + && expectedCount == targetData.expectedCount; } @Override @@ -198,7 +200,7 @@ public int hashCode() { result = 31 * result + snapshotVersion.hashCode(); result = 31 * result + lastLimboFreeSnapshotVersion.hashCode(); result = 31 * result + resumeToken.hashCode(); - result = 31 * result + expectedCount.hashCode(); + result = 31 * result + (expectedCount != null ? expectedCount.hashCode() : 0); return result; } diff --git a/firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java b/firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java index cf136ab45d8..659c3cc3f18 100644 --- a/firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java +++ b/firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java @@ -1143,6 +1143,9 @@ private void validateActiveTargets() { assertEquals( expectedTarget.getResumeToken().toStringUtf8(), actualTarget.getResumeToken().toStringUtf8()); + if (expectedTarget.getExpectedCount() != null) { + assertEquals(expectedTarget.getExpectedCount(), actualTarget.getExpectedCount()); + } actualTargets.remove(expected.getKey()); } From ae7edd0ae022bad5cbabec4b7c67f9a28882e07e Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 20 Jan 2023 15:41:22 -0800 Subject: [PATCH 4/7] port spec tests --- .../firebase/firestore/spec/SpecTestCase.java | 4 + .../test/resources/json/listen_spec_test.json | 930 ++++++++++++++++++ 2 files changed, 934 insertions(+) diff --git a/firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java b/firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java index 659c3cc3f18..7be9479da3b 100644 --- a/firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java +++ b/firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java @@ -1006,6 +1006,9 @@ private void validateExpectedState(@Nullable JSONObject expectedState) throws JS targetData.withResumeToken( ByteString.EMPTY, version(queryDataJson.getInt("readTime"))); } + if (queryDataJson.has("expectedCount")) { + targetData = targetData.withExpectedCount(queryDataJson.getInt("expectedCount")); + } expectedActiveTargets.get(targetId).add(targetData); } @@ -1143,6 +1146,7 @@ private void validateActiveTargets() { assertEquals( expectedTarget.getResumeToken().toStringUtf8(), actualTarget.getResumeToken().toStringUtf8()); + if (expectedTarget.getExpectedCount() != null) { assertEquals(expectedTarget.getExpectedCount(), actualTarget.getExpectedCount()); } diff --git a/firebase-firestore/src/test/resources/json/listen_spec_test.json b/firebase-firestore/src/test/resources/json/listen_spec_test.json index 5755019b048..57d253e6e43 100644 --- a/firebase-firestore/src/test/resources/json/listen_spec_test.json +++ b/firebase-firestore/src/test/resources/json/listen_spec_test.json @@ -99,6 +99,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -139,6 +140,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -221,6 +223,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -438,6 +441,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -449,6 +453,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -483,6 +488,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -494,6 +500,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -525,6 +532,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -536,6 +544,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -610,6 +619,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -644,6 +654,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -673,6 +684,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -708,6 +720,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -719,6 +732,7 @@ "version": 2000 }, { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -887,6 +901,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -921,6 +936,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1038,6 +1054,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1072,6 +1089,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1100,6 +1118,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1126,6 +1145,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1219,6 +1239,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1230,6 +1251,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1264,6 +1286,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1319,6 +1342,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1534,6 +1558,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "value": null, "version": 1000 @@ -1629,6 +1654,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1655,6 +1681,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1739,6 +1766,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1822,6 +1850,7 @@ { "added": [ { + "createTime": 0, "key": "collection/exists", "options": { "hasCommittedMutations": false, @@ -1911,6 +1940,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1945,6 +1975,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1985,6 +2016,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2017,6 +2049,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "value": null, "version": 2000 @@ -2188,6 +2221,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection2/a", "options": { "hasCommittedMutations": false, @@ -2231,6 +2265,7 @@ { "added": [ { + "createTime": 0, "key": "collection2/a", "options": { "hasCommittedMutations": false, @@ -2731,6 +2766,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2765,6 +2801,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2914,6 +2951,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2950,6 +2988,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3096,6 +3135,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "value": null, "version": 2000 @@ -3193,6 +3233,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3204,6 +3245,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3238,6 +3280,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3279,6 +3322,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3337,6 +3381,160 @@ } ] }, + "ExpectedCount in listen request should work after coming back online": { + "describeName": "Listens:", + "itName": "ExpectedCount in listen request should work after coming back online", + "tags": [ + ], + "config": { + "numClients": 1, + "useGarbageCollection": false + }, + "steps": [ + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a" + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a" + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "enableNetwork": false, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeLimboDocs": [ + ], + "activeTargets": { + }, + "enqueuedLimboDocs": [ + ] + } + }, + { + "enableNetwork": true, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "resume-token-1000", + "expectedCount": 1 + } + } + } + } + ] + }, "Ignores update from inactive target": { "describeName": "Listens:", "itName": "Ignores update from inactive target", @@ -3384,6 +3582,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3418,6 +3617,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3462,6 +3662,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3507,6 +3708,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3606,6 +3808,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3641,6 +3844,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3714,6 +3918,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3764,6 +3969,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "value": null, "version": 3000 @@ -3802,6 +4008,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3906,6 +4113,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4129,6 +4337,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4164,6 +4373,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4237,6 +4447,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4287,6 +4498,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4325,6 +4537,7 @@ "hasPendingWrites": false, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4436,6 +4649,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4530,6 +4744,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4674,6 +4889,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4710,6 +4926,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4758,6 +4975,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4850,6 +5068,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4890,6 +5109,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4998,6 +5218,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5038,6 +5259,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5110,6 +5332,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5150,6 +5373,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5258,6 +5482,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5298,6 +5523,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5342,6 +5568,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5434,6 +5661,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5470,6 +5698,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5501,6 +5730,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5575,6 +5805,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5609,6 +5840,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5687,6 +5919,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5721,6 +5954,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5908,6 +6142,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5919,6 +6154,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5959,6 +6195,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5970,6 +6207,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6007,6 +6245,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6018,6 +6257,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6102,6 +6342,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6133,6 +6374,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6162,6 +6404,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6335,6 +6578,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6346,6 +6590,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6382,6 +6627,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6393,6 +6639,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6430,6 +6677,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6441,6 +6689,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6525,6 +6774,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6552,6 +6802,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6581,6 +6832,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6621,6 +6873,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6632,6 +6885,7 @@ "version": 2000 }, { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6769,6 +7023,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -6800,6 +7055,7 @@ { "added": [ { + "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -6829,6 +7085,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7046,6 +7303,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7057,6 +7315,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7097,6 +7356,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7108,6 +7368,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7139,6 +7400,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7150,6 +7412,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7252,6 +7515,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7283,6 +7547,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7312,6 +7577,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -8074,6 +8340,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8108,6 +8375,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8166,6 +8434,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8290,6 +8559,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8324,6 +8594,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8382,6 +8653,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8505,6 +8777,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8539,6 +8812,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8609,6 +8883,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8770,6 +9045,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8805,6 +9081,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8867,6 +9144,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9081,6 +9359,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9140,6 +9419,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9265,6 +9545,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9305,6 +9586,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9382,6 +9664,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9422,6 +9705,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9484,6 +9768,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9524,6 +9809,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9635,6 +9921,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9666,6 +9953,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9813,6 +10101,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9853,6 +10142,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9886,6 +10176,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9926,6 +10217,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9937,6 +10229,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9982,6 +10275,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -10009,6 +10303,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -10040,6 +10335,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -10065,6 +10361,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -10633,6 +10930,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10673,6 +10971,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10750,6 +11049,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10821,6 +11121,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -10861,6 +11162,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -10948,6 +11250,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10984,6 +11287,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11028,6 +11332,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11088,6 +11393,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11137,6 +11443,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11164,6 +11471,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11195,6 +11503,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11226,6 +11535,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11313,6 +11623,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11349,6 +11660,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11393,6 +11705,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11471,6 +11784,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11502,6 +11816,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11675,6 +11990,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11719,6 +12035,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11750,6 +12067,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11834,6 +12152,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11870,6 +12189,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11914,6 +12234,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11988,6 +12309,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -12024,6 +12346,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -12061,6 +12384,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -12088,6 +12412,7 @@ { "added": [ { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -12123,6 +12448,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -12134,6 +12460,7 @@ "version": 2000 }, { + "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -12210,6 +12537,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12244,6 +12572,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12306,6 +12635,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12355,6 +12685,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "value": null, "version": 2000 @@ -12393,6 +12724,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12409,6 +12741,535 @@ } ] }, + "Resuming a query should specify expectedCount that does not include pending mutations": { + "describeName": "Listens:", + "itName": "Resuming a query should specify expectedCount that does not include pending mutations", + "tags": [ + ], + "config": { + "numClients": 1, + "useGarbageCollection": false + }, + "steps": [ + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a" + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a" + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "userUnlisten": [ + 2, + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "expectedState": { + "activeTargets": { + } + } + }, + { + "userSet": [ + "collection/b", + { + "key": "b" + } + ] + }, + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": true + }, + "value": { + "key": "b" + }, + "version": 0 + } + ], + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": true, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "resume-token-1000", + "expectedCount": 1 + } + } + } + } + ] + }, + "Resuming a query should specify expectedCount when adding the target": { + "describeName": "Listens:", + "itName": "Resuming a query should specify expectedCount when adding the target", + "tags": [ + ], + "config": { + "numClients": 1, + "useGarbageCollection": false + }, + "steps": [ + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "userUnlisten": [ + 2, + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "expectedState": { + "activeTargets": { + } + } + }, + { + "watchRemove": { + "targetIds": [ + 2 + ] + } + }, + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "resume-token-1000", + "expectedCount": 0 + } + } + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b" + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-2000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b" + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "userUnlisten": [ + 2, + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "expectedState": { + "activeTargets": { + } + } + }, + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b" + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "resume-token-2000", + "expectedCount": 2 + } + } + } + } + ] + }, "Secondary client advances query state with global snapshot from primary": { "describeName": "Listens:", "itName": "Secondary client advances query state with global snapshot from primary", @@ -12473,6 +13334,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12509,6 +13371,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12578,6 +13441,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12649,6 +13513,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12725,6 +13590,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12769,6 +13635,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "value": null, "version": 2000 @@ -12820,6 +13687,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12910,6 +13778,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12946,6 +13815,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13015,6 +13885,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13086,6 +13957,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13160,6 +14032,7 @@ "hasPendingWrites": true, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13565,6 +14438,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13596,6 +14470,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13707,6 +14582,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13718,6 +14594,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -13752,6 +14629,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13763,6 +14641,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -13825,6 +14704,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13836,6 +14716,7 @@ "version": 1000 }, { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -13907,6 +14788,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13980,6 +14862,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14032,6 +14915,7 @@ { "added": [ { + "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -14173,6 +15057,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14237,6 +15122,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14273,6 +15159,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14346,6 +15233,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14380,6 +15268,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14420,6 +15309,7 @@ }, "removed": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14438,6 +15328,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14479,6 +15370,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14506,6 +15398,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14532,6 +15425,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14605,6 +15499,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14639,6 +15534,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14667,6 +15563,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14696,6 +15593,7 @@ "hasPendingWrites": false, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14755,6 +15653,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14804,6 +15703,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14839,6 +15739,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14926,6 +15827,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14960,6 +15862,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14988,6 +15891,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15017,6 +15921,7 @@ "hasPendingWrites": false, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15064,6 +15969,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15113,6 +16019,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15148,6 +16055,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15279,6 +16187,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection1/a", "options": { "hasCommittedMutations": false, @@ -15299,6 +16208,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection2/a", "options": { "hasCommittedMutations": false, @@ -15373,6 +16283,7 @@ { "added": [ { + "createTime": 0, "key": "collection2/a", "options": { "hasCommittedMutations": false, @@ -15663,6 +16574,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15697,6 +16609,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15739,6 +16652,7 @@ "hasPendingWrites": true, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15765,6 +16679,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15799,6 +16714,7 @@ "hasPendingWrites": false, "metadata": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15879,6 +16795,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15913,6 +16830,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15955,6 +16873,7 @@ "hasPendingWrites": true, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15999,6 +16918,7 @@ "hasPendingWrites": true, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16038,6 +16958,7 @@ "hasPendingWrites": true, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16109,6 +17030,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16143,6 +17065,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16182,6 +17105,7 @@ { "added": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16243,6 +17167,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16306,6 +17231,7 @@ "hasPendingWrites": true, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16331,6 +17257,7 @@ "hasPendingWrites": true, "modified": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16357,6 +17284,7 @@ "watchEntity": { "docs": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16392,6 +17320,7 @@ "hasPendingWrites": false, "metadata": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16417,6 +17346,7 @@ "hasPendingWrites": false, "metadata": [ { + "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, From ef1a6e932f7bd3e4e2fabab35a44023a5ba4ed93 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Thu, 26 Jan 2023 13:22:27 -0800 Subject: [PATCH 5/7] resolve comments --- .../firebase/firestore/local/TargetData.java | 9 +- .../firestore/remote/RemoteSerializer.java | 4 +- .../firestore/remote/RemoteStore.java | 7 +- .../test/resources/json/listen_spec_test.json | 156 ------------------ 4 files changed, 11 insertions(+), 165 deletions(-) diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java index 836c014338a..ff2e3274cee 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/local/TargetData.java @@ -21,6 +21,7 @@ import com.google.firebase.firestore.model.SnapshotVersion; import com.google.firebase.firestore.remote.WatchStream; import com.google.protobuf.ByteString; +import java.util.Objects; /** An immutable set of metadata that the store will need to keep track of for each target. */ public final class TargetData { @@ -93,7 +94,7 @@ public TargetData withSequenceNumber(long sequenceNumber) { snapshotVersion, lastLimboFreeSnapshotVersion, resumeToken, - expectedCount); + /* expectedCount= */ null); } /** Creates a new target data instance with an updated resume token and snapshot version. */ @@ -110,7 +111,7 @@ public TargetData withResumeToken(ByteString resumeToken, SnapshotVersion snapsh } /** Creates a new target data instance with an updated expected count. */ - public TargetData withExpectedCount(Integer expectedCount) { + public TargetData withExpectedCount(@Nullable Integer expectedCount) { return new TargetData( target, targetId, @@ -188,7 +189,7 @@ public boolean equals(Object o) { && snapshotVersion.equals(targetData.snapshotVersion) && lastLimboFreeSnapshotVersion.equals(targetData.lastLimboFreeSnapshotVersion) && resumeToken.equals(targetData.resumeToken) - && expectedCount == targetData.expectedCount; + && Objects.equals(expectedCount, targetData.expectedCount); } @Override @@ -200,7 +201,7 @@ public int hashCode() { result = 31 * result + snapshotVersion.hashCode(); result = 31 * result + lastLimboFreeSnapshotVersion.hashCode(); result = 31 * result + resumeToken.hashCode(); - result = 31 * result + (expectedCount != null ? expectedCount.hashCode() : 0); + result = 31 * result + Objects.hashCode(expectedCount); return result; } diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java index 74ba575386b..0b5b90cdc2b 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java @@ -499,7 +499,9 @@ public Target encodeTarget(TargetData targetData) { builder.setResumeToken(targetData.getResumeToken()); } - if (targetData.getExpectedCount() != null) { + if (targetData.getExpectedCount() != null + && (!targetData.getResumeToken().isEmpty() + || targetData.getSnapshotVersion().compareTo(SnapshotVersion.NONE) > 0)) { builder.setExpectedCount(Int32Value.newBuilder().setValue(targetData.getExpectedCount())); } diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java index cc52fa6f6cb..965ceee35da 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteStore.java @@ -372,11 +372,10 @@ private void sendWatchRequest(TargetData targetData) { if (!targetData.getResumeToken().isEmpty() || targetData.getSnapshotVersion().compareTo(SnapshotVersion.NONE) > 0) { int expectedCount = this.getRemoteKeysForTarget(targetData.getTargetId()).size(); - TargetData newTargetData = targetData.withExpectedCount(expectedCount); - watchStream.watchQuery(newTargetData); - } else { - watchStream.watchQuery(targetData); + targetData = targetData.withExpectedCount(expectedCount); } + + watchStream.watchQuery(targetData); } /** diff --git a/firebase-firestore/src/test/resources/json/listen_spec_test.json b/firebase-firestore/src/test/resources/json/listen_spec_test.json index 57d253e6e43..e1c7f23b4ee 100644 --- a/firebase-firestore/src/test/resources/json/listen_spec_test.json +++ b/firebase-firestore/src/test/resources/json/listen_spec_test.json @@ -140,7 +140,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -223,7 +222,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -488,7 +486,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -500,7 +497,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -532,7 +528,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -544,7 +539,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -654,7 +648,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -684,7 +677,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -720,7 +712,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -732,7 +723,6 @@ "version": 2000 }, { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -936,7 +926,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1089,7 +1078,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1145,7 +1133,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1286,7 +1273,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1342,7 +1328,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1681,7 +1666,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1766,7 +1750,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1850,7 +1833,6 @@ { "added": [ { - "createTime": 0, "key": "collection/exists", "options": { "hasCommittedMutations": false, @@ -1975,7 +1957,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2016,7 +1997,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2265,7 +2245,6 @@ { "added": [ { - "createTime": 0, "key": "collection2/a", "options": { "hasCommittedMutations": false, @@ -2801,7 +2780,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2988,7 +2966,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3280,7 +3257,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3322,7 +3298,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3463,7 +3438,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3617,7 +3591,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3708,7 +3681,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3844,7 +3816,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3918,7 +3889,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4008,7 +3978,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4373,7 +4342,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4447,7 +4415,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4537,7 +4504,6 @@ "hasPendingWrites": false, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4744,7 +4710,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4926,7 +4891,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4975,7 +4939,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5109,7 +5072,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5259,7 +5221,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5373,7 +5334,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5523,7 +5483,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5568,7 +5527,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5698,7 +5656,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5730,7 +5687,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5840,7 +5796,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5954,7 +5909,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6195,7 +6149,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6207,7 +6160,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6245,7 +6197,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6257,7 +6208,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6374,7 +6324,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6404,7 +6353,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6627,7 +6575,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6639,7 +6586,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6677,7 +6623,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6689,7 +6634,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6802,7 +6746,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6832,7 +6775,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6873,7 +6815,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6885,7 +6826,6 @@ "version": 2000 }, { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7055,7 +6995,6 @@ { "added": [ { - "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -7085,7 +7024,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7356,7 +7294,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7368,7 +7305,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7400,7 +7336,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7412,7 +7347,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7547,7 +7481,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7577,7 +7510,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -8375,7 +8307,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8434,7 +8365,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8594,7 +8524,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8653,7 +8582,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8812,7 +8740,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8883,7 +8810,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9081,7 +9007,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9144,7 +9069,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9419,7 +9343,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9586,7 +9509,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9705,7 +9627,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9809,7 +9730,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9953,7 +9873,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10142,7 +10061,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10217,7 +10135,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10229,7 +10146,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -10303,7 +10219,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -10335,7 +10250,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -10361,7 +10275,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -10971,7 +10884,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11049,7 +10961,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11162,7 +11073,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11287,7 +11197,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11332,7 +11241,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11393,7 +11301,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11471,7 +11378,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11503,7 +11409,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11535,7 +11440,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11660,7 +11564,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11705,7 +11608,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11816,7 +11718,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -12035,7 +11936,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12067,7 +11967,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12189,7 +12088,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12234,7 +12132,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12346,7 +12243,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -12412,7 +12308,6 @@ { "added": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -12448,7 +12343,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -12460,7 +12354,6 @@ "version": 2000 }, { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -12572,7 +12465,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12635,7 +12527,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12724,7 +12615,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12823,7 +12713,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12887,7 +12776,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12899,7 +12787,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -13146,7 +13033,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13158,7 +13044,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -13214,7 +13099,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13226,7 +13110,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -13371,7 +13254,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13441,7 +13323,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13590,7 +13471,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13687,7 +13567,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13815,7 +13694,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13885,7 +13763,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14032,7 +13909,6 @@ "hasPendingWrites": true, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14470,7 +14346,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14629,7 +14504,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14641,7 +14515,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -14704,7 +14577,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14716,7 +14588,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -14788,7 +14659,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14862,7 +14732,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14915,7 +14784,6 @@ { "added": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -15159,7 +15027,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15268,7 +15135,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15309,7 +15175,6 @@ }, "removed": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15425,7 +15290,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15534,7 +15398,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15593,7 +15456,6 @@ "hasPendingWrites": false, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15653,7 +15515,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15862,7 +15723,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15921,7 +15781,6 @@ "hasPendingWrites": false, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15969,7 +15828,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16283,7 +16141,6 @@ { "added": [ { - "createTime": 0, "key": "collection2/a", "options": { "hasCommittedMutations": false, @@ -16609,7 +16466,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16652,7 +16508,6 @@ "hasPendingWrites": true, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16714,7 +16569,6 @@ "hasPendingWrites": false, "metadata": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16830,7 +16684,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16873,7 +16726,6 @@ "hasPendingWrites": true, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16918,7 +16770,6 @@ "hasPendingWrites": true, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16958,7 +16809,6 @@ "hasPendingWrites": true, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -17065,7 +16915,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -17105,7 +16954,6 @@ { "added": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -17231,7 +17079,6 @@ "hasPendingWrites": true, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -17257,7 +17104,6 @@ "hasPendingWrites": true, "modified": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -17320,7 +17166,6 @@ "hasPendingWrites": false, "metadata": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -17346,7 +17191,6 @@ "hasPendingWrites": false, "metadata": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, From a241d07189589c3165290a5a260ddcbcdb52aba4 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 27 Jan 2023 09:48:20 -0800 Subject: [PATCH 6/7] remove createtime --- .../test/resources/json/listen_spec_test.json | 103 ------------------ 1 file changed, 103 deletions(-) diff --git a/firebase-firestore/src/test/resources/json/listen_spec_test.json b/firebase-firestore/src/test/resources/json/listen_spec_test.json index e1c7f23b4ee..85170a91d71 100644 --- a/firebase-firestore/src/test/resources/json/listen_spec_test.json +++ b/firebase-firestore/src/test/resources/json/listen_spec_test.json @@ -99,7 +99,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -439,7 +438,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -451,7 +449,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -613,7 +610,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -891,7 +887,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1043,7 +1038,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1106,7 +1100,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1226,7 +1219,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1238,7 +1230,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1543,7 +1534,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "value": null, "version": 1000 @@ -1639,7 +1629,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1922,7 +1911,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2029,7 +2017,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "value": null, "version": 2000 @@ -2201,7 +2188,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection2/a", "options": { "hasCommittedMutations": false, @@ -2745,7 +2731,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2929,7 +2914,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3112,7 +3096,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "value": null, "version": 2000 @@ -3210,7 +3193,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3222,7 +3204,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3403,7 +3384,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3556,7 +3536,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3635,7 +3614,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3780,7 +3758,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3939,7 +3916,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "value": null, "version": 3000 @@ -4082,7 +4058,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4306,7 +4281,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4465,7 +4439,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4615,7 +4588,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4854,7 +4826,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5031,7 +5002,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5180,7 +5150,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5293,7 +5262,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5442,7 +5410,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5619,7 +5586,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5761,7 +5727,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5874,7 +5839,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6096,7 +6060,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6108,7 +6071,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6292,7 +6254,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6526,7 +6487,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6538,7 +6498,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6718,7 +6677,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6963,7 +6921,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -7241,7 +7198,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7253,7 +7209,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7449,7 +7404,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -8272,7 +8226,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8489,7 +8442,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8705,7 +8657,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8971,7 +8922,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9283,7 +9233,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9468,7 +9417,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9586,7 +9534,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9689,7 +9636,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9841,7 +9787,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10020,7 +9965,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -10094,7 +10038,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -10191,7 +10134,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -10843,7 +10785,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11032,7 +10973,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11160,7 +11100,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11350,7 +11289,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11527,7 +11465,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -11686,7 +11623,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -11891,7 +11827,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12051,7 +11986,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12206,7 +12140,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -12280,7 +12213,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -12430,7 +12362,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12576,7 +12507,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "value": null, "version": 2000 @@ -12678,7 +12608,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12986,7 +12915,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -12998,7 +12926,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -13217,7 +13144,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13394,7 +13320,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13515,7 +13440,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "value": null, "version": 2000 @@ -13657,7 +13581,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -13834,7 +13757,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14314,7 +14236,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14457,7 +14378,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14469,7 +14389,6 @@ "version": 1000 }, { - "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -14925,7 +14844,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -14990,7 +14908,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15100,7 +15017,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15193,7 +15109,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15235,7 +15150,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15263,7 +15177,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15363,7 +15276,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15426,7 +15338,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15564,7 +15475,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15600,7 +15510,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15688,7 +15597,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15751,7 +15659,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15877,7 +15784,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -15913,7 +15819,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16045,7 +15950,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection1/a", "options": { "hasCommittedMutations": false, @@ -16066,7 +15970,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection2/a", "options": { "hasCommittedMutations": false, @@ -16431,7 +16334,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16534,7 +16436,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16649,7 +16550,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -16880,7 +16780,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -17015,7 +16914,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -17130,7 +17028,6 @@ "watchEntity": { "docs": [ { - "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, From c26b4e5e56a0176ad52a01d15756bc044fdef193 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 27 Jan 2023 13:11:16 -0800 Subject: [PATCH 7/7] add todo comment --- .../com/google/firebase/firestore/remote/RemoteSerializer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java index 0b5b90cdc2b..7f1f7781045 100644 --- a/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java +++ b/firebase-firestore/src/main/java/com/google/firebase/firestore/remote/RemoteSerializer.java @@ -499,6 +499,7 @@ public Target encodeTarget(TargetData targetData) { builder.setResumeToken(targetData.getResumeToken()); } + // TODO(Mila) Incorporate this into the if statement above. if (targetData.getExpectedCount() != null && (!targetData.getResumeToken().isEmpty() || targetData.getSnapshotVersion().compareTo(SnapshotVersion.NONE) > 0)) {