From 0f870e937a26c7068cb8bb84b8a458ef402c70c4 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Mon, 24 Apr 2023 16:26:41 -0400 Subject: [PATCH] Port spec test changes from https://github.com/firebase/firebase-js-sdk/pull/7229 (Optimize local cache sync when resuming a query that had docs deleted) --- .../firebase/firestore/spec/SpecTestCase.java | 18 +- .../test/resources/json/bundle_spec_test.json | 2 +- .../json/existence_filter_spec_test.json | 7167 +++++++++++++++-- .../test/resources/json/limbo_spec_test.json | 512 +- .../test/resources/json/limit_spec_test.json | 20 +- .../test/resources/json/listen_spec_test.json | 685 ++ .../resources/json/offline_spec_test.json | 4 +- .../resources/json/recovery_spec_test.json | 8 +- 8 files changed, 7643 insertions(+), 773 deletions(-) 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 1b2dcc4c66e..622261258ea 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 @@ -420,6 +420,22 @@ private Query parseQuery(Object querySpec) throws JSONException { } } + private static QueryPurpose parseQueryPurpose(Object value) { + if (!(value instanceof Integer)) { + throw new IllegalArgumentException("invalid query purpose: " + value); + } + switch ((Integer) value) { + case 0: + return QueryPurpose.LISTEN; + case 1: + return QueryPurpose.EXISTENCE_FILTER_MISMATCH; + case 3: + return QueryPurpose.LIMBO_RESOLUTION; + default: + throw new IllegalArgumentException("unknown query purpose value: " + value); + } + } + private DocumentViewChange parseChange(JSONObject jsonDoc, DocumentViewChange.Type type) throws JSONException { long version = jsonDoc.getLong("version"); @@ -1027,7 +1043,7 @@ private void validateExpectedState(@Nullable JSONObject expectedState) throws JS QueryPurpose purpose = QueryPurpose.LISTEN; if (queryDataJson.has("targetPurpose")) { - purpose = QueryPurpose.values()[queryDataJson.getInt("targetPurpose")]; + purpose = parseQueryPurpose(queryDataJson.get("targetPurpose")); } TargetData targetData = diff --git a/firebase-firestore/src/test/resources/json/bundle_spec_test.json b/firebase-firestore/src/test/resources/json/bundle_spec_test.json index 0ef88d3f1a0..d3ccf3e7b2d 100644 --- a/firebase-firestore/src/test/resources/json/bundle_spec_test.json +++ b/firebase-firestore/src/test/resources/json/bundle_spec_test.json @@ -1179,7 +1179,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ diff --git a/firebase-firestore/src/test/resources/json/existence_filter_spec_test.json b/firebase-firestore/src/test/resources/json/existence_filter_spec_test.json index 0a4ecb48201..24da8086f70 100644 --- a/firebase-firestore/src/test/resources/json/existence_filter_spec_test.json +++ b/firebase-firestore/src/test/resources/json/existence_filter_spec_test.json @@ -1,9 +1,10 @@ { - "Existence filter clears resume token": { + "Bloom filter can process special characters in document name": { "describeName": "Existence Filters:", - "itName": "Existence filter clears resume token", + "itName": "Bloom filter can process special characters in document name", "tags": [ - "durable-persistence" + "no-ios", + "no-android" ], "config": { "numClients": 1, @@ -48,7 +49,7 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/ÀÒ∑", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -60,13 +61,13 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/À∑Ò", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 }, "version": 1000 } @@ -95,7 +96,7 @@ "added": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/ÀÒ∑", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -107,13 +108,13 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/À∑Ò", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 }, "version": 1000 } @@ -133,8 +134,15 @@ }, { "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "IIAAIIAIIAAIIAIIAA==", + "padding": 4 + }, + "hashCount": 10 + }, "keys": [ - "collection/1" + "collection/ÀÒ∑" ], "targetIds": [ 2 @@ -162,7 +170,23 @@ } ], "expectedState": { + "activeLimboDocs": [ + "collection/À∑Ò" + ], "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/À∑Ò" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, "2": { "queries": [ { @@ -173,23 +197,25 @@ "path": "collection" } ], - "resumeToken": "", - "targetPurpose": 1 + "resumeToken": "" } } } - }, - { - "restart": true, - "expectedState": { - "activeLimboDocs": [ - ], - "activeTargets": { - }, - "enqueuedLimboDocs": [ - ] - } - }, + } + ] + }, + "Bloom filter fills in default values for undefined padding and hashCount": { + "describeName": "Existence Filters:", + "itName": "Bloom filter fills in default values for undefined padding and hashCount", + "tags": [ + "no-ios", + "no-android" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "steps": [ { "userListen": { "query": { @@ -201,12 +227,81 @@ }, "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": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -218,7 +313,7 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -229,6 +324,42 @@ "version": 1000 } ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "AhAAApAAAIAEBIAABA==" + } + }, + "keys": [ + "collection/a" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, @@ -253,17 +384,20 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } } ] }, - "Existence filter handled at global snapshot": { + "Bloom filter is handled at global snapshot": { "describeName": "Existence Filters:", - "itName": "Existence filter handled at global snapshot", + "itName": "Bloom filter is handled at global snapshot", "tags": [ + "no-ios", + "no-android" ], "config": { "numClients": 1, @@ -308,7 +442,7 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -317,6 +451,18 @@ "v": 1 }, "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 } ], "targets": [ @@ -343,7 +489,7 @@ "added": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -352,6 +498,18 @@ "v": 1 }, "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 } ], "errorCode": 0, @@ -369,9 +527,15 @@ }, { "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "AhAAApAAAIAEBIAABA==", + "padding": 4 + }, + "hashCount": 10 + }, "keys": [ - "collection/1", - "collection/2" + "collection/a" ], "targetIds": [ 2 @@ -383,7 +547,7 @@ "docs": [ { "createTime": 0, - "key": "collection/3", + "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -410,7 +574,7 @@ "added": [ { "createTime": 0, - "key": "collection/3", + "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -434,7 +598,23 @@ } ], "expectedState": { + "activeLimboDocs": [ + "collection/b" + ], "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/b" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, "2": { "queries": [ { @@ -445,17 +625,51 @@ "path": "collection" } ], - "resumeToken": "", - "targetPurpose": 1 + "resumeToken": "" } } } - }, + } + ] + }, + "Bloom filter limbo resolution is denied": { + "describeName": "Existence Filters:", + "itName": "Bloom filter limbo resolution is denied", + "tags": [ + "no-ios", + "no-android" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "steps": [ { - "watchRemove": { - "targetIds": [ - 2 - ] + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } } }, { @@ -468,7 +682,7 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -480,27 +694,5431 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 }, - "version": 2000 + "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": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "AhAAApAAAIAEBIAABA==", + "padding": 4 + }, + "hashCount": 10 + }, + "keys": [ + "collection/a" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeLimboDocs": [ + "collection/b" + ], + "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/b" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } + } + }, + { + "watchRemove": { + "cause": { + "code": 7 + }, + "targetIds": [ + 1 + ] + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "removed": [ + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ] + } + ], + "expectedState": { + "activeLimboDocs": [ + ], + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } + } + } + ] + }, + "Bloom filter with large size works as expected": { + "describeName": "Existence Filters:", + "itName": "Bloom filter with large size works as expected", + "tags": [ + "no-ios", + "no-android" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "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/doc0", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc4", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc5", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc6", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc7", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc8", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc9", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc10", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc11", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc12", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc13", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc14", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc15", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc16", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc17", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc18", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc19", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc20", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc21", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc22", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc23", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc24", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc25", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc26", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc27", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc28", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc29", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc30", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc31", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc32", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc33", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc34", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc35", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc36", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc37", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc38", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc39", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc40", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc41", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc42", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc43", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc44", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc45", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc46", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc47", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc48", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc49", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc50", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc51", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc52", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc53", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc54", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc55", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc56", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc57", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc58", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc59", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc60", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc61", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc62", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc63", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc64", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc65", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc66", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc67", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc68", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc69", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc70", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc71", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc72", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc73", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc74", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc75", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc76", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc77", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc78", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc79", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc80", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc81", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc82", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc83", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc84", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc85", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc86", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc87", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc88", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc89", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc90", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc91", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc92", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc93", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc94", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc95", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc96", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc97", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc98", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc99", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/doc0", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc4", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc5", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc6", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc7", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc8", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc9", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc10", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc11", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc12", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc13", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc14", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc15", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc16", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc17", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc18", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc19", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc20", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc21", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc22", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc23", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc24", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc25", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc26", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc27", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc28", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc29", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc30", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc31", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc32", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc33", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc34", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc35", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc36", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc37", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc38", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc39", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc40", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc41", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc42", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc43", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc44", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc45", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc46", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc47", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc48", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc49", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc50", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc51", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc52", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc53", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc54", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc55", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc56", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc57", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc58", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc59", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc60", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc61", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc62", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc63", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc64", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc65", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc66", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc67", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc68", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc69", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc70", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc71", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc72", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc73", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc74", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc75", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc76", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc77", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc78", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc79", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc80", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc81", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc82", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc83", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc84", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc85", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc86", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc87", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc88", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc89", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc90", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc91", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc92", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc93", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc94", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc95", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc96", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc97", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc98", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/doc99", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "+9oMQXUptl274DOaET8sfebQ4aCu0Roiddbja3z8TfadKuyPV/9XWV5Ksv+vywRXTfZSNIn8z+xk/oq1+cbOPepeNvbXVOF6H92fCOAz/KiS3Mcw338R9tXE3Y7QB1L2kbvbvVHW3Kn/k3Vx8k9Oa19eWX6RYE97Q+oCcVU=", + "padding": 0 + }, + "hashCount": 16 + }, + "keys": [ + "collection/doc0", + "collection/doc1", + "collection/doc2", + "collection/doc3", + "collection/doc4", + "collection/doc5", + "collection/doc6", + "collection/doc7", + "collection/doc8", + "collection/doc9", + "collection/doc10", + "collection/doc11", + "collection/doc12", + "collection/doc13", + "collection/doc14", + "collection/doc15", + "collection/doc16", + "collection/doc17", + "collection/doc18", + "collection/doc19", + "collection/doc20", + "collection/doc21", + "collection/doc22", + "collection/doc23", + "collection/doc24", + "collection/doc25", + "collection/doc26", + "collection/doc27", + "collection/doc28", + "collection/doc29", + "collection/doc30", + "collection/doc31", + "collection/doc32", + "collection/doc33", + "collection/doc34", + "collection/doc35", + "collection/doc36", + "collection/doc37", + "collection/doc38", + "collection/doc39", + "collection/doc40", + "collection/doc41", + "collection/doc42", + "collection/doc43", + "collection/doc44", + "collection/doc45", + "collection/doc46", + "collection/doc47", + "collection/doc48", + "collection/doc49" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeLimboDocs": [ + "collection/doc50", + "collection/doc51", + "collection/doc52", + "collection/doc53", + "collection/doc54", + "collection/doc55", + "collection/doc56", + "collection/doc57", + "collection/doc58", + "collection/doc59", + "collection/doc60", + "collection/doc61", + "collection/doc62", + "collection/doc63", + "collection/doc64", + "collection/doc65", + "collection/doc66", + "collection/doc67", + "collection/doc68", + "collection/doc69", + "collection/doc70", + "collection/doc71", + "collection/doc72", + "collection/doc73", + "collection/doc74", + "collection/doc75", + "collection/doc76", + "collection/doc77", + "collection/doc78", + "collection/doc79", + "collection/doc80", + "collection/doc81", + "collection/doc82", + "collection/doc83", + "collection/doc84", + "collection/doc85", + "collection/doc86", + "collection/doc87", + "collection/doc88", + "collection/doc89", + "collection/doc90", + "collection/doc91", + "collection/doc92", + "collection/doc93", + "collection/doc94", + "collection/doc95", + "collection/doc96", + "collection/doc97", + "collection/doc98", + "collection/doc99" + ], + "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc50" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "11": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc55" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "13": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc56" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "15": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc57" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "17": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc58" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "19": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc59" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + }, + "21": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc60" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "23": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc61" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "25": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc62" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "27": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc63" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "29": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc64" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "3": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc51" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "31": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc65" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "33": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc66" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "35": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc67" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "37": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc68" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "39": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc69" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "41": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc70" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "43": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc71" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "45": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc72" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "47": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc73" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "49": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc74" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "5": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc52" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "51": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc75" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "53": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc76" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "55": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc77" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "57": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc78" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "59": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc79" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "61": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc80" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "63": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc81" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "65": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc82" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "67": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc83" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "69": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc84" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "7": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc53" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "71": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc85" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "73": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc86" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "75": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc87" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "77": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc88" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "79": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc89" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "81": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc90" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "83": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc91" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "85": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc92" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "87": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc93" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "89": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc94" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "9": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc54" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "91": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc95" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "93": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc96" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "95": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc97" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "97": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc98" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "99": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/doc99" + } + ], + "resumeToken": "", + "targetPurpose": 3 + } + } + } + } + ] + }, + "Existence filter clears resume token": { + "describeName": "Existence Filters:", + "itName": "Existence filter clears resume token", + "tags": [ + "durable-persistence" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "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/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "keys": [ + "collection/1" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + }, + { + "restart": true, + "expectedState": { + "activeLimboDocs": [ + ], + "activeTargets": { + }, + "enqueuedLimboDocs": [ + ] + } + }, + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } + } + } + ] + }, + "Existence filter handled at global snapshot": { + "describeName": "Existence Filters:", + "itName": "Existence filter handled at global snapshot", + "tags": [ + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "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/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "keys": [ + "collection/1", + "collection/2" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 3 + }, + "version": 3000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 3 + }, + "version": 3000 + } + ], + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + }, + { + "watchRemove": { + "targetIds": [ + 2 + ] + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 + }, + { + "createTime": 0, + "key": "collection/3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 3 + }, + "version": 3000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-3000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 3000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + } + ] + }, + "Existence filter ignored with pending target": { + "describeName": "Existence Filters:", + "itName": "Existence filter ignored with pending target", + "tags": [ + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": 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/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 + } + ], + "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/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 + } + ], + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "resume-token-1000" + } + } + } + }, + { + "watchFilter": { + "keys": [ + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchRemove": { + "targetIds": [ + 2 + ] + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-2000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + } + ] + }, + "Existence filter limbo resolution is denied": { + "describeName": "Existence Filters:", + "itName": "Existence filter limbo resolution is denied", + "tags": [ + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "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/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "keys": [ + "collection/1" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + }, + { + "watchRemove": { + "targetIds": [ + 2 + ] + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-2000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedState": { + "activeLimboDocs": [ + "collection/2" + ], + "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/2" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + }, + { + "watchRemove": { + "cause": { + "code": 7 + }, + "targetIds": [ + 1 + ] + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "removed": [ + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ] + } + ], + "expectedState": { + "activeLimboDocs": [ + ], + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + } + ] + }, + "Existence filter match": { + "describeName": "Existence Filters:", + "itName": "Existence filter match", + "tags": [ + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "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/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "keys": [ + "collection/1" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + } + } + ] + }, + "Existence filter match after pending update": { + "describeName": "Existence Filters:", + "itName": "Existence filter match after pending update", + "tags": [ + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "steps": [ + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchFilter": { + "keys": [ + "collection/1" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 2000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + } + ] + }, + "Existence filter mismatch triggers re-run of query": { + "describeName": "Existence Filters:", + "itName": "Existence filter mismatch triggers re-run of query", + "tags": [ + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "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/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "keys": [ + "collection/1" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + }, + { + "watchRemove": { + "targetIds": [ + 2 + ] + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-2000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedState": { + "activeLimboDocs": [ + "collection/2" + ], + "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/2" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + }, + { + "watchAck": [ + 1 + ] + }, + { + "watchCurrent": [ + [ + 1 + ], + "resume-token-2000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "removed": [ + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ] + } + ], + "expectedState": { + "activeLimboDocs": [ + ], + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + } + ] + }, + "Existence filter mismatch will drop resume token": { + "describeName": "Existence Filters:", + "itName": "Existence filter mismatch will drop resume token", + "tags": [ + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "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/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 }, { "createTime": 0, - "key": "collection/3", + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "existence-filter-resume-token" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchStreamClose": { + "error": { + "code": 14, + "message": "Simulated Backend Error" + }, + "runBackoffTimer": true + }, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "existence-filter-resume-token" + } + } + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchFilter": { + "keys": [ + "collection/1" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + }, + { + "watchRemove": { + "targetIds": [ + 2 + ] + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/1", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 3 + "v": 1 }, - "version": 3000 + "version": 1000 } ], "targets": [ @@ -513,18 +6131,81 @@ [ 2 ], - "resume-token-3000" + "resume-token-2000" ] }, { "watchSnapshot": { "targetIds": [ ], - "version": 3000 + "version": 2000 + }, + "expectedState": { + "activeLimboDocs": [ + "collection/2" + ], + "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/2" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } + }, + { + "watchAck": [ + 1 + ] + }, + { + "watchCurrent": [ + [ + 1 + ], + "resume-token-2000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 }, "expectedSnapshotEvents": [ { - "added": [ + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "removed": [ { "createTime": 0, "key": "collection/2", @@ -535,32 +6216,41 @@ "value": { "v": 2 }, - "version": 2000 + "version": 1000 } - ], - "errorCode": 0, - "fromCache": false, - "hasPendingWrites": false, - "query": { - "filters": [ - ], - "orderBys": [ + ] + } + ], + "expectedState": { + "activeLimboDocs": [ + ], + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } ], - "path": "collection" + "resumeToken": "", + "targetPurpose": 1 } } - ] + } } ] }, - "Existence filter ignored with pending target": { + "Existence filter synthesizes deletes": { "describeName": "Existence Filters:", - "itName": "Existence filter ignored with pending target", + "itName": "Existence filter synthesizes deletes", "tags": [ ], "config": { "numClients": 1, - "useEagerGCForMemory": false + "useEagerGCForMemory": true }, "steps": [ { @@ -570,7 +6260,7 @@ ], "orderBys": [ ], - "path": "collection" + "path": "collection/a" }, "targetId": 2 }, @@ -583,7 +6273,7 @@ ], "orderBys": [ ], - "path": "collection" + "path": "collection/a" } ], "resumeToken": "" @@ -601,15 +6291,15 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 }, - "version": 2000 + "version": 1000 } ], "targets": [ @@ -636,15 +6326,15 @@ "added": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 }, - "version": 2000 + "version": 1000 } ], "errorCode": 0, @@ -655,66 +6345,78 @@ ], "orderBys": [ ], - "path": "collection" + "path": "collection/a" } } ] }, { - "userUnlisten": [ - 2, - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - } - ], - "expectedState": { - "activeTargets": { - } + "watchFilter": { + "keys": [ + ], + "targetIds": [ + 2 + ] } }, { - "userListen": { - "query": { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - }, - "targetId": 2 + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 }, "expectedSnapshotEvents": [ { - "added": [ + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/a" + }, + "removed": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 }, - "version": 2000 + "version": 1000 } - ], - "errorCode": 0, - "fromCache": true, - "hasPendingWrites": false, - "query": { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - } + ] } - ], + ] + } + ] + }, + "Existence filter with empty target": { + "describeName": "Existence Filters:", + "itName": "Existence filter with empty target", + "tags": [ + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "steps": [ + { + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, "expectedState": { "activeTargets": { "2": { @@ -727,39 +6429,54 @@ "path": "collection" } ], - "resumeToken": "resume-token-1000" + "resumeToken": "" } } } }, { - "watchFilter": { - "keys": [ - ], - "targetIds": [ - 2 - ] - } + "watchAck": [ + 2 + ] }, { - "watchRemove": { - "targetIds": [ + "watchCurrent": [ + [ 2 - ] - } + ], + "resume-token-1000" + ] }, { - "watchAck": [ - 2 + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } ] }, { - "watchCurrent": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1" ], - "resume-token-2000" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -770,7 +6487,7 @@ "expectedSnapshotEvents": [ { "errorCode": 0, - "fromCache": false, + "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ @@ -780,14 +6497,33 @@ "path": "collection" } } - ] + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } } ] }, - "Existence filter limbo resolution is denied": { + "Full re-query is skipped when bloom filter can identify documents deleted": { "describeName": "Existence Filters:", - "itName": "Existence filter limbo resolution is denied", + "itName": "Full re-query is skipped when bloom filter can identify documents deleted", "tags": [ + "no-ios", + "no-android" ], "config": { "numClients": 1, @@ -832,7 +6568,7 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -844,7 +6580,7 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -879,7 +6615,7 @@ "added": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -891,7 +6627,7 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -917,8 +6653,15 @@ }, { "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "AhAAApAAAIAEBIAABA==", + "padding": 4 + }, + "hashCount": 10 + }, "keys": [ - "collection/1" + "collection/a" ], "targetIds": [ 2 @@ -946,7 +6689,23 @@ } ], "expectedState": { + "activeLimboDocs": [ + "collection/b" + ], "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/b" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, "2": { "queries": [ { @@ -957,49 +6716,20 @@ "path": "collection" } ], - "resumeToken": "", - "targetPurpose": 1 + "resumeToken": "" } } } }, - { - "watchRemove": { - "targetIds": [ - 2 - ] - } - }, { "watchAck": [ - 2 + 1 ] }, - { - "watchEntity": { - "docs": [ - { - "createTime": 0, - "key": "collection/1", - "options": { - "hasCommittedMutations": false, - "hasLocalMutations": false - }, - "value": { - "v": 1 - }, - "version": 1000 - } - ], - "targets": [ - 2 - ] - } - }, { "watchCurrent": [ [ - 2 + 1 ], "resume-token-2000" ] @@ -1010,49 +6740,6 @@ ], "version": 2000 }, - "expectedState": { - "activeLimboDocs": [ - "collection/2" - ], - "activeTargets": { - "1": { - "queries": [ - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection/2" - } - ], - "resumeToken": "", - "targetPurpose": 2 - }, - "2": { - "queries": [ - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - } - ], - "resumeToken": "", - "targetPurpose": 1 - } - } - } - }, - { - "watchRemove": { - "cause": { - "code": 7 - }, - "targetIds": [ - 1 - ] - }, "expectedSnapshotEvents": [ { "errorCode": 0, @@ -1068,7 +6755,7 @@ "removed": [ { "createTime": 0, - "key": "collection/2", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1095,18 +6782,19 @@ "path": "collection" } ], - "resumeToken": "", - "targetPurpose": 1 + "resumeToken": "" } } } } ] }, - "Existence filter match": { + "Full re-query is triggered when bloom filter bitmap is invalid": { "describeName": "Existence Filters:", - "itName": "Existence filter match", + "itName": "Full re-query is triggered when bloom filter bitmap is invalid", "tags": [ + "no-ios", + "no-android" ], "config": { "numClients": 1, @@ -1150,128 +6838,35 @@ "watchEntity": { "docs": [ { - "createTime": 0, - "key": "collection/1", - "options": { - "hasCommittedMutations": false, - "hasLocalMutations": false - }, - "value": { - "v": 1 - }, - "version": 1000 - } - ], - "targets": [ - 2 - ] - } - }, - { - "watchCurrent": [ - [ - 2 - ], - "resume-token-1000" - ] - }, - { - "watchSnapshot": { - "targetIds": [ - ], - "version": 1000 - }, - "expectedSnapshotEvents": [ - { - "added": [ - { - "createTime": 0, - "key": "collection/1", - "options": { - "hasCommittedMutations": false, - "hasLocalMutations": false - }, - "value": { - "v": 1 - }, - "version": 1000 - } - ], - "errorCode": 0, - "fromCache": false, - "hasPendingWrites": false, - "query": { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - } - } - ] - }, - { - "watchFilter": { - "keys": [ - "collection/1" - ], - "targetIds": [ - 2 - ] - } - }, - { - "watchSnapshot": { - "targetIds": [ - ], - "version": 2000 - } - } - ] - }, - "Existence filter match after pending update": { - "describeName": "Existence Filters:", - "itName": "Existence filter match after pending update", - "tags": [ - ], - "config": { - "numClients": 1, - "useEagerGCForMemory": true - }, - "steps": [ - { - "userListen": { - "query": { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - }, - "targetId": 2 - }, - "expectedState": { - "activeTargets": { - "2": { - "queries": [ - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - } - ], - "resumeToken": "" + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 } - } + ], + "targets": [ + 2 + ] } }, - { - "watchAck": [ - 2 - ] - }, { "watchCurrent": [ [ @@ -1284,10 +6879,36 @@ "watchSnapshot": { "targetIds": [ ], - "version": 2000 + "version": 1000 }, "expectedSnapshotEvents": [ { + "added": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + } + ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, @@ -1301,31 +6922,17 @@ } ] }, - { - "watchEntity": { - "docs": [ - { - "createTime": 0, - "key": "collection/1", - "options": { - "hasCommittedMutations": false, - "hasLocalMutations": false - }, - "value": { - "v": 2 - }, - "version": 2000 - } - ], - "targets": [ - 2 - ] - } - }, { "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "INVALID_BASE_64", + "padding": 4 + }, + "hashCount": 10 + }, "keys": [ - "collection/1" + "collection/a" ], "targetIds": [ 2 @@ -1340,22 +6947,8 @@ }, "expectedSnapshotEvents": [ { - "added": [ - { - "createTime": 0, - "key": "collection/1", - "options": { - "hasCommittedMutations": false, - "hasLocalMutations": false - }, - "value": { - "v": 2 - }, - "version": 2000 - } - ], "errorCode": 0, - "fromCache": false, + "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ @@ -1365,14 +6958,33 @@ "path": "collection" } } - ] + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } } ] }, - "Existence filter mismatch triggers re-run of query": { + "Full re-query is triggered when bloom filter can not identify documents deleted": { "describeName": "Existence Filters:", - "itName": "Existence filter mismatch triggers re-run of query", + "itName": "Full re-query is triggered when bloom filter can not identify documents deleted", "tags": [ + "no-ios", + "no-android" ], "config": { "numClients": 1, @@ -1417,7 +7029,7 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1429,7 +7041,19 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1464,7 +7088,7 @@ "added": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1476,7 +7100,19 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1502,8 +7138,15 @@ }, { "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "AxBIApBIAIAWBoCQBA==", + "padding": 4 + }, + "hashCount": 10 + }, "keys": [ - "collection/1" + "collection/a" ], "targetIds": [ 2 @@ -1543,16 +7186,51 @@ } ], "resumeToken": "", - "targetPurpose": 1 + "targetPurpose": 2 } } } - }, + } + ] + }, + "Full re-query is triggered when bloom filter hashCount is invalid": { + "describeName": "Existence Filters:", + "itName": "Full re-query is triggered when bloom filter hashCount is invalid", + "tags": [ + "no-ios", + "no-android" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "steps": [ { - "watchRemove": { - "targetIds": [ - 2 - ] + "userListen": { + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } } }, { @@ -1565,7 +7243,19 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1577,108 +7267,103 @@ } ], "targets": [ - 2 - ] - } - }, - { - "watchCurrent": [ - [ - 2 - ], - "resume-token-2000" - ] - }, - { - "watchSnapshot": { - "targetIds": [ - ], - "version": 2000 - }, - "expectedState": { - "activeLimboDocs": [ - "collection/2" - ], - "activeTargets": { - "1": { - "queries": [ - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection/2" - } - ], - "resumeToken": "", - "targetPurpose": 2 - }, - "2": { - "queries": [ - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - } - ], - "resumeToken": "", - "targetPurpose": 1 - } - } + 2 + ] } }, - { - "watchAck": [ - 1 - ] - }, { "watchCurrent": [ [ - 1 + 2 ], - "resume-token-2000" + "resume-token-1000" ] }, { "watchSnapshot": { "targetIds": [ ], - "version": 2000 + "version": 1000 }, "expectedSnapshotEvents": [ { - "errorCode": 0, - "fromCache": false, - "hasPendingWrites": false, - "query": { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - }, - "removed": [ + "added": [ { "createTime": 0, - "key": "collection/2", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 }, "version": 1000 } - ] + ], + "errorCode": 0, + "fromCache": false, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "AhAAApAAAIAEBIAABA==", + "padding": 4 + }, + "hashCount": -1 + }, + "keys": [ + "collection/a" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 2000 + }, + "expectedSnapshotEvents": [ + { + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } } ], "expectedState": { - "activeLimboDocs": [ - ], "activeTargets": { "2": { "queries": [ @@ -1698,10 +7383,12 @@ } ] }, - "Existence filter mismatch will drop resume token": { + "Full re-query is triggered when bloom filter is empty": { "describeName": "Existence Filters:", - "itName": "Existence filter mismatch will drop resume token", + "itName": "Full re-query is triggered when bloom filter is empty", "tags": [ + "no-ios", + "no-android" ], "config": { "numClients": 1, @@ -1746,7 +7433,7 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1758,13 +7445,13 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 }, "version": 1000 } @@ -1779,7 +7466,7 @@ [ 2 ], - "existence-filter-resume-token" + "resume-token-1000" ] }, { @@ -1793,7 +7480,7 @@ "added": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1805,13 +7492,13 @@ }, { "createTime": 0, - "key": "collection/2", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 2 + "v": 1 }, "version": 1000 } @@ -1829,40 +7516,17 @@ } ] }, - { - "watchStreamClose": { - "error": { - "code": 14, - "message": "Simulated Backend Error" - }, - "runBackoffTimer": true - }, - "expectedState": { - "activeTargets": { - "2": { - "queries": [ - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - } - ], - "resumeToken": "existence-filter-resume-token" - } - } - } - }, - { - "watchAck": [ - 2 - ] - }, { "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "", + "padding": 0 + }, + "hashCount": 0 + }, "keys": [ - "collection/1" + "collection/a" ], "targetIds": [ 2 @@ -1906,12 +7570,57 @@ } } } - }, + } + ] + }, + "Same documents can have different bloom filters": { + "describeName": "Existence Filters:", + "itName": "Same documents can have different bloom filters", + "tags": [ + "no-ios", + "no-android" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": true + }, + "steps": [ { - "watchRemove": { - "targetIds": [ - 2 - ] + "userListen": { + "query": { + "filters": [ + [ + "v", + "<=", + 2 + ] + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 2 + }, + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + [ + "v", + "<=", + 2 + ] + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" + } + } } }, { @@ -1924,7 +7633,7 @@ "docs": [ { "createTime": 0, - "key": "collection/1", + "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -1933,6 +7642,18 @@ "v": 1 }, "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 } ], "targets": [ @@ -1945,84 +7666,83 @@ [ 2 ], - "resume-token-2000" - ] - }, - { - "watchSnapshot": { - "targetIds": [ - ], - "version": 2000 - }, - "expectedState": { - "activeLimboDocs": [ - "collection/2" - ], - "activeTargets": { - "1": { - "queries": [ - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection/2" - } - ], - "resumeToken": "", - "targetPurpose": 2 - }, - "2": { - "queries": [ - { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - } - ], - "resumeToken": "", - "targetPurpose": 1 - } - } - } - }, - { - "watchAck": [ - 1 - ] - }, - { - "watchCurrent": [ - [ - 1 - ], - "resume-token-2000" + "resume-token-1000" ] }, { "watchSnapshot": { "targetIds": [ ], - "version": 2000 + "version": 1000 }, "expectedSnapshotEvents": [ { + "added": [ + { + "createTime": 0, + "key": "collection/a", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 1 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 2 + }, + "version": 1000 + } + ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ + [ + "v", + "<=", + 2 + ] ], "orderBys": [ ], "path": "collection" - }, - "removed": [ + } + } + ] + }, + { + "userListen": { + "query": { + "filters": [ + [ + "v", + ">=", + 2 + ] + ], + "orderBys": [ + ], + "path": "collection" + }, + "targetId": 4 + }, + "expectedSnapshotEvents": [ + { + "added": [ { "createTime": 0, - "key": "collection/2", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false @@ -2032,62 +7752,56 @@ }, "version": 1000 } - ] + ], + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + [ + "v", + ">=", + 2 + ] + ], + "orderBys": [ + ], + "path": "collection" + } } ], "expectedState": { - "activeLimboDocs": [ - ], "activeTargets": { "2": { "queries": [ { "filters": [ + [ + "v", + "<=", + 2 + ] ], "orderBys": [ ], "path": "collection" } ], - "resumeToken": "", - "targetPurpose": 1 - } - } - } - } - ] - }, - "Existence filter synthesizes deletes": { - "describeName": "Existence Filters:", - "itName": "Existence filter synthesizes deletes", - "tags": [ - ], - "config": { - "numClients": 1, - "useEagerGCForMemory": true - }, - "steps": [ - { - "userListen": { - "query": { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection/a" - }, - "targetId": 2 - }, - "expectedState": { - "activeTargets": { - "2": { + "resumeToken": "" + }, + "4": { "queries": [ { "filters": [ + [ + "v", + ">=", + 2 + ] ], "orderBys": [ ], - "path": "collection/a" + "path": "collection" } ], "resumeToken": "" @@ -2097,7 +7811,7 @@ }, { "watchAck": [ - 2 + 4 ] }, { @@ -2105,48 +7819,60 @@ "docs": [ { "createTime": 0, - "key": "collection/a", + "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 1 + "v": 2 + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/c", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "v": 3 }, "version": 1000 } ], "targets": [ - 2 + 4 ] } }, { "watchCurrent": [ [ - 2 + 4 ], - "resume-token-1000" + "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], - "version": 1000 + "version": 1001 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, - "key": "collection/a", + "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { - "v": 1 + "v": 3 }, "version": 1000 } @@ -2156,17 +7882,30 @@ "hasPendingWrites": false, "query": { "filters": [ + [ + "v", + ">=", + 2 + ] ], "orderBys": [ ], - "path": "collection/a" + "path": "collection" } } ] }, { "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "CQ==", + "padding": 3 + }, + "hashCount": 2 + }, "keys": [ + "collection/b" ], "targetIds": [ 2 @@ -2182,61 +7921,49 @@ "expectedSnapshotEvents": [ { "errorCode": 0, - "fromCache": false, + "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ + [ + "v", + "<=", + 2 + ] ], "orderBys": [ ], - "path": "collection/a" - }, - "removed": [ - { - "createTime": 0, - "key": "collection/a", - "options": { - "hasCommittedMutations": false, - "hasLocalMutations": false - }, - "value": { - "v": 1 - }, - "version": 1000 - } - ] + "path": "collection" + } } - ] - } - ] - }, - "Existence filter with empty target": { - "describeName": "Existence Filters:", - "itName": "Existence filter with empty target", - "tags": [ - ], - "config": { - "numClients": 1, - "useEagerGCForMemory": true - }, - "steps": [ - { - "userListen": { - "query": { - "filters": [ - ], - "orderBys": [ - ], - "path": "collection" - }, - "targetId": 2 - }, + ], "expectedState": { + "activeLimboDocs": [ + "collection/a" + ], "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/a" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, "2": { "queries": [ { "filters": [ + [ + "v", + "<=", + 2 + ] ], "orderBys": [ ], @@ -2244,51 +7971,41 @@ } ], "resumeToken": "" - } - } - } - }, - { - "watchAck": [ - 2 - ] - }, - { - "watchCurrent": [ - [ - 2 - ], - "resume-token-1000" - ] - }, - { - "watchSnapshot": { - "targetIds": [ - ], - "version": 2000 - }, - "expectedSnapshotEvents": [ - { - "errorCode": 0, - "fromCache": false, - "hasPendingWrites": false, - "query": { - "filters": [ - ], - "orderBys": [ + }, + "4": { + "queries": [ + { + "filters": [ + [ + "v", + ">=", + 2 + ] + ], + "orderBys": [ + ], + "path": "collection" + } ], - "path": "collection" + "resumeToken": "" } } - ] + } }, { "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "CA==", + "padding": 4 + }, + "hashCount": 1 + }, "keys": [ - "collection/1" + "collection/b" ], "targetIds": [ - 2 + 4 ] } }, @@ -2296,7 +8013,7 @@ "watchSnapshot": { "targetIds": [ ], - "version": 2000 + "version": 3000 }, "expectedSnapshotEvents": [ { @@ -2305,6 +8022,11 @@ "hasPendingWrites": false, "query": { "filters": [ + [ + "v", + ">=", + 2 + ] ], "orderBys": [ ], @@ -2313,19 +8035,70 @@ } ], "expectedState": { + "activeLimboDocs": [ + "collection/a", + "collection/c" + ], "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/a" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, "2": { "queries": [ { "filters": [ + [ + "v", + "<=", + 2 + ] ], "orderBys": [ ], "path": "collection" } ], + "resumeToken": "" + }, + "3": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/c" + } + ], "resumeToken": "", - "targetPurpose": 1 + "targetPurpose": 3 + }, + "4": { + "queries": [ + { + "filters": [ + [ + "v", + ">=", + 2 + ] + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "" } } } diff --git a/firebase-firestore/src/test/resources/json/limbo_spec_test.json b/firebase-firestore/src/test/resources/json/limbo_spec_test.json index 8172a189689..f28e5809478 100644 --- a/firebase-firestore/src/test/resources/json/limbo_spec_test.json +++ b/firebase-firestore/src/test/resources/json/limbo_spec_test.json @@ -238,7 +238,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -284,7 +284,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -411,7 +411,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -495,7 +495,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -578,7 +578,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -682,7 +682,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "10": { "queries": [ @@ -782,7 +782,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "10": { "queries": [ @@ -873,7 +873,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -947,7 +947,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -1212,7 +1212,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -1258,7 +1258,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -1385,7 +1385,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -1469,7 +1469,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -1552,7 +1552,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -1656,7 +1656,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "10": { "queries": [ @@ -1756,7 +1756,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "10": { "queries": [ @@ -2055,7 +2055,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -2141,7 +2141,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -2224,7 +2224,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -2442,7 +2442,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -2862,7 +2862,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -3152,7 +3152,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -3422,7 +3422,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -3672,7 +3672,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -3965,7 +3965,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -4081,7 +4081,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -4345,7 +4345,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -4697,7 +4697,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -5082,7 +5082,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -5173,7 +5173,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -5553,7 +5553,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -5578,7 +5578,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } } } @@ -5690,7 +5690,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -5715,7 +5715,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } } } @@ -5770,7 +5770,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } } } @@ -5890,7 +5890,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } } } @@ -6332,7 +6332,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -6870,7 +6870,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -7203,7 +7203,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -7288,7 +7288,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -7618,7 +7618,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -7643,7 +7643,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -7754,7 +7754,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "7": { "queries": [ @@ -7767,7 +7767,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -7875,7 +7875,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -7952,6 +7952,402 @@ } ] }, + "Limbo resolution throttling with bloom filter application": { + "describeName": "Limbo Documents:", + "itName": "Limbo resolution throttling with bloom filter application", + "tags": [ + "no-ios", + "no-android" + ], + "config": { + "maxConcurrentLimboResolutions": 2, + "numClients": 1, + "useEagerGCForMemory": true + }, + "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/a1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a1" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/a2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a2" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/a3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a3" + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1000" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1000 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/a1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a1" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/a2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a2" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/a3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "a3" + }, + "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" + } + } + } + }, + { + "watchAck": [ + 2 + ] + }, + { + "watchEntity": { + "docs": [ + { + "createTime": 0, + "key": "collection/b1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b1" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b2" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b3" + }, + "version": 1000 + } + ], + "targets": [ + 2 + ] + } + }, + { + "watchFilter": { + "bloomFilter": { + "bits": { + "bitmap": "yABCEAeZURNRGAkgAQ==", + "padding": 4 + }, + "hashCount": 10 + }, + "keys": [ + "collection/b1", + "collection/b2", + "collection/b3" + ], + "targetIds": [ + 2 + ] + } + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1001 + }, + "expectedSnapshotEvents": [ + { + "added": [ + { + "createTime": 0, + "key": "collection/b1", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b1" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b2", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b2" + }, + "version": 1000 + }, + { + "createTime": 0, + "key": "collection/b3", + "options": { + "hasCommittedMutations": false, + "hasLocalMutations": false + }, + "value": { + "key": "b3" + }, + "version": 1000 + } + ], + "errorCode": 0, + "fromCache": true, + "hasPendingWrites": false, + "query": { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + } + ] + }, + { + "watchCurrent": [ + [ + 2 + ], + "resume-token-1002" + ] + }, + { + "watchSnapshot": { + "targetIds": [ + ], + "version": 1002 + }, + "expectedState": { + "activeLimboDocs": [ + "collection/a1", + "collection/a2" + ], + "activeTargets": { + "1": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/a1" + } + ], + "resumeToken": "", + "targetPurpose": 3 + }, + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "resume-token-1000" + }, + "3": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection/a2" + } + ], + "resumeToken": "", + "targetPurpose": 3 + } + }, + "enqueuedLimboDocs": [ + "collection/a3" + ] + } + } + ] + }, "Limbo resolution throttling with existence filter mismatch": { "describeName": "Limbo Documents:", "itName": "Limbo resolution throttling with existence filter mismatch", @@ -8378,7 +8774,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -8404,7 +8800,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -8513,7 +8909,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -8854,7 +9250,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -8879,7 +9275,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -8970,7 +9366,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "5": { "queries": [ @@ -8983,7 +9379,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -9068,7 +9464,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "7": { "queries": [ @@ -9081,7 +9477,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -9165,7 +9561,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "9": { "queries": [ @@ -9178,7 +9574,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -9260,7 +9656,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } }, "enqueuedLimboDocs": [ @@ -9642,7 +10038,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ diff --git a/firebase-firestore/src/test/resources/json/limit_spec_test.json b/firebase-firestore/src/test/resources/json/limit_spec_test.json index 257c53eeb4c..c6172e241fa 100644 --- a/firebase-firestore/src/test/resources/json/limit_spec_test.json +++ b/firebase-firestore/src/test/resources/json/limit_spec_test.json @@ -220,7 +220,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -4461,7 +4461,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -4488,7 +4488,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -4625,7 +4625,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -4650,7 +4650,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } } } @@ -4794,7 +4794,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "7": { "queries": [ @@ -4807,7 +4807,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } } } @@ -4950,7 +4950,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 } } } @@ -5449,7 +5449,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -5713,7 +5713,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ 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 1537f3ccaad..adf88a62dca 100644 --- a/firebase-firestore/src/test/resources/json/listen_spec_test.json +++ b/firebase-firestore/src/test/resources/json/listen_spec_test.json @@ -3381,6 +3381,161 @@ } ] }, + "ExpectedCount in listen request should work after coming back online": { + "describeName": "Listens:", + "itName": "ExpectedCount in listen request should work after coming back online", + "tags": [ + "no-ios", + "no-android" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": 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" + } + } + } + } + ] + }, "Ignores update from inactive target": { "describeName": "Listens:", "itName": "Ignores update from inactive target", @@ -12587,6 +12742,536 @@ } ] }, + "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": [ + "no-ios", + "no-android" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": 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" + } + } + } + } + ] + }, + "Resuming a query should specify expectedCount when adding the target": { + "describeName": "Listens:", + "itName": "Resuming a query should specify expectedCount when adding the target", + "tags": [ + "no-ios", + "no-android" + ], + "config": { + "numClients": 1, + "useEagerGCForMemory": 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" + } + } + } + }, + { + "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" + } + } + } + } + ] + }, "Secondary client advances query state with global snapshot from primary": { "describeName": "Listens:", "itName": "Secondary client advances query state with global snapshot from primary", diff --git a/firebase-firestore/src/test/resources/json/offline_spec_test.json b/firebase-firestore/src/test/resources/json/offline_spec_test.json index 5685ae1588e..e180f5f3198 100644 --- a/firebase-firestore/src/test/resources/json/offline_spec_test.json +++ b/firebase-firestore/src/test/resources/json/offline_spec_test.json @@ -1156,7 +1156,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ @@ -1194,7 +1194,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "2": { "queries": [ diff --git a/firebase-firestore/src/test/resources/json/recovery_spec_test.json b/firebase-firestore/src/test/resources/json/recovery_spec_test.json index 4b1f9401e1f..672bd161146 100644 --- a/firebase-firestore/src/test/resources/json/recovery_spec_test.json +++ b/firebase-firestore/src/test/resources/json/recovery_spec_test.json @@ -3133,7 +3133,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -3223,7 +3223,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -3613,7 +3613,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [ @@ -3673,7 +3673,7 @@ } ], "resumeToken": "", - "targetPurpose": 2 + "targetPurpose": 3 }, "4": { "queries": [