From 820d83fe140a4266533ff3018e354f6f893b4c21 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 10 Mar 2023 14:35:23 -0800 Subject: [PATCH 1/7] initial code --- .../firebase/firestore/spec/SpecTestCase.java | 11 +- .../json/existence_filter_spec_test.json | 213 ++++++++---- .../test/resources/json/limbo_spec_test.json | 311 ++++++++++++++---- .../test/resources/json/limit_spec_test.json | 146 +++++++- .../resources/json/recovery_spec_test.json | 52 ++- 5 files changed, 576 insertions(+), 157 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 cf136ab45d8..d316fc84e59 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 @@ -993,9 +993,15 @@ private void validateExpectedState(@Nullable JSONObject expectedState) throws JS // TODO: populate the purpose of the target once it's possible to encode that in the // spec tests. For now, hard-code that it's a listen despite the fact that it's not // always the right value. + + QueryPurpose purpose = QueryPurpose.LISTEN; + if (queryDataJson.has("targetPurpose")) { + purpose = QueryPurpose.values()[queryDataJson.getInt("targetPurpose")]; + } + TargetData targetData = new TargetData( - query.toTarget(), targetId, ARBITRARY_SEQUENCE_NUMBER, QueryPurpose.LISTEN); + query.toTarget(), targetId, ARBITRARY_SEQUENCE_NUMBER, purpose); if (queryDataJson.has("resumeToken")) { targetData = targetData.withResumeToken( @@ -1137,6 +1143,9 @@ private void validateActiveTargets() { // TODO: validate the purpose of the target once it's possible to encode that in the // spec tests. For now, only validate properties that can be validated. // assertEquals(expectedTarget, actualTarget); + + assertEquals(expectedTarget.getPurpose(), actualTarget.getPurpose()); + assertEquals(expectedTarget.getTarget(), actualTarget.getTarget()); assertEquals(expectedTarget.getTargetId(), actualTarget.getTargetId()); assertEquals(expectedTarget.getSnapshotVersion(), actualTarget.getSnapshotVersion()); 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 3083b762224..bd875c4847b 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 @@ -92,6 +92,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -103,6 +104,7 @@ "version": 1000 }, { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -128,12 +130,14 @@ ] }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1" ], - "collection/1" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -154,7 +158,24 @@ "path": "collection" } } - ] + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } }, { "restart": true, @@ -182,6 +203,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -193,6 +215,7 @@ "version": 1000 }, { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -316,6 +339,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -341,13 +365,15 @@ ] }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1", + "collection/2" ], - "collection/1", - "collection/2" - ] + "targetIds": [ + 2 + ] + } }, { "watchEntity": { @@ -379,6 +405,7 @@ { "added": [ { + "key": "collection/3", "options": { "hasCommittedMutations": false, @@ -414,7 +441,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -491,6 +519,7 @@ { "added": [ { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -598,6 +627,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -653,6 +683,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -694,11 +725,13 @@ } }, { - "watchFilter": [ - [ + "watchFilter": { + "keys": [ + ], + "targetIds": [ 2 ] - ] + } }, { "watchRemove": { @@ -835,6 +868,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -846,6 +880,7 @@ "version": 1000 }, { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -871,12 +906,14 @@ ] }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1" ], - "collection/1" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -910,7 +947,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -976,7 +1014,8 @@ "path": "collection/2" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -988,7 +1027,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -1016,6 +1056,7 @@ }, "removed": [ { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1043,7 +1084,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -1131,6 +1173,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -1156,12 +1199,14 @@ ] }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1" ], - "collection/1" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -1265,12 +1310,14 @@ } }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1" ], - "collection/1" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -1282,6 +1329,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -1400,6 +1448,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -1411,6 +1460,7 @@ "version": 1000 }, { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1436,12 +1486,14 @@ ] }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1" ], - "collection/1" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -1475,7 +1527,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -1541,7 +1594,8 @@ "path": "collection/2" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -1553,7 +1607,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -1591,6 +1646,7 @@ }, "removed": [ { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1618,7 +1674,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -1717,6 +1774,7 @@ { "added": [ { + "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -1728,6 +1786,7 @@ "version": 1000 }, { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1783,12 +1842,14 @@ ] }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1" ], - "collection/1" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -1822,7 +1883,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -1888,7 +1950,8 @@ "path": "collection/2" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -1900,7 +1963,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -1938,6 +2002,7 @@ }, "removed": [ { + "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1965,7 +2030,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -2053,6 +2119,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2078,11 +2145,13 @@ ] }, { - "watchFilter": [ - [ + "watchFilter": { + "keys": [ + ], + "targetIds": [ 2 ] - ] + } }, { "watchSnapshot": { @@ -2104,6 +2173,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2193,12 +2263,14 @@ ] }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/1" ], - "collection/1" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -2219,7 +2291,24 @@ "path": "collection" } } - ] + ], + "expectedState": { + "activeTargets": { + "2": { + "queries": [ + { + "filters": [ + ], + "orderBys": [ + ], + "path": "collection" + } + ], + "resumeToken": "", + "targetPurpose": 1 + } + } + } } ] } 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 0b6abe08a2b..d92fd90e92f 100644 --- a/firebase-firestore/src/test/resources/json/limbo_spec_test.json +++ b/firebase-firestore/src/test/resources/json/limbo_spec_test.json @@ -81,6 +81,7 @@ { "added": [ { + "key": "collection1/doc", "options": { "hasCommittedMutations": false, @@ -141,6 +142,7 @@ { "added": [ { + "key": "collection1/doc", "options": { "hasCommittedMutations": false, @@ -234,7 +236,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -279,7 +282,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -356,6 +360,7 @@ { "added": [ { + "key": "collection2/doc", "options": { "hasCommittedMutations": false, @@ -403,7 +408,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -445,6 +451,7 @@ { "added": [ { + "key": "collection2/doc", "options": { "hasCommittedMutations": false, @@ -485,7 +492,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -567,7 +575,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -629,6 +638,7 @@ { "added": [ { + "key": "collection2/doc", "options": { "hasCommittedMutations": false, @@ -669,7 +679,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "10": { "queries": [ @@ -768,7 +779,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "10": { "queries": [ @@ -858,7 +870,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -931,7 +944,8 @@ "path": "collection1/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -1039,6 +1053,7 @@ { "added": [ { + "key": "collection1/doc1", "options": { "hasCommittedMutations": false, @@ -1099,6 +1114,7 @@ { "added": [ { + "key": "collection1/doc1", "options": { "hasCommittedMutations": false, @@ -1192,7 +1208,8 @@ "path": "collection1/doc1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -1237,7 +1254,8 @@ "path": "collection1/doc1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -1314,6 +1332,7 @@ { "added": [ { + "key": "collection2/doc2", "options": { "hasCommittedMutations": false, @@ -1361,7 +1380,8 @@ "path": "collection1/doc1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -1403,6 +1423,7 @@ { "added": [ { + "key": "collection2/doc2", "options": { "hasCommittedMutations": false, @@ -1443,7 +1464,8 @@ "path": "collection1/doc1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -1525,7 +1547,8 @@ "path": "collection1/doc1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -1587,6 +1610,7 @@ { "added": [ { + "key": "collection2/doc2", "options": { "hasCommittedMutations": false, @@ -1627,7 +1651,8 @@ "path": "collection1/doc1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "10": { "queries": [ @@ -1726,7 +1751,8 @@ "path": "collection1/doc1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "10": { "queries": [ @@ -1868,6 +1894,7 @@ { "added": [ { + "key": "collection/doc", "options": { "hasCommittedMutations": false, @@ -1928,6 +1955,7 @@ { "added": [ { + "key": "collection/doc", "options": { "hasCommittedMutations": false, @@ -2021,7 +2049,8 @@ "path": "collection/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -2065,6 +2094,7 @@ { "added": [ { + "key": "collection/doc", "options": { "hasCommittedMutations": false, @@ -2105,7 +2135,8 @@ "path": "collection/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -2187,7 +2218,8 @@ "path": "collection/doc" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -2322,6 +2354,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2333,6 +2366,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2400,7 +2434,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -2450,6 +2485,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2575,6 +2611,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2618,6 +2655,7 @@ "hasPendingWrites": true, "modified": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2681,6 +2719,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2778,6 +2817,7 @@ "hasPendingWrites": false, "modified": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2813,7 +2853,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -2860,6 +2901,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3027,6 +3069,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3038,6 +3081,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3097,7 +3141,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -3194,6 +3239,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3291,6 +3337,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3363,7 +3410,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -3386,11 +3434,13 @@ ] }, { - "watchFilter": [ - [ + "watchFilter": { + "keys": [ + ], + "targetIds": [ 1 ] - ] + } }, { "watchCurrent": [ @@ -3420,6 +3470,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3535,6 +3586,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3607,7 +3659,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -3657,6 +3710,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3824,6 +3878,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3835,6 +3890,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3894,7 +3950,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -4009,7 +4066,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -4062,6 +4120,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4187,6 +4246,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4269,7 +4329,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -4349,6 +4410,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4479,6 +4541,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4616,7 +4679,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -4719,6 +4783,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4734,6 +4799,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4889,6 +4955,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": true, @@ -4900,6 +4967,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": true, @@ -4994,7 +5062,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -5031,6 +5100,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5042,6 +5112,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": true, @@ -5082,7 +5153,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -5166,6 +5238,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5177,6 +5250,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": true, @@ -5352,6 +5426,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5363,6 +5438,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5374,6 +5450,7 @@ "version": 1001 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -5453,7 +5530,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -5477,7 +5555,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } } } @@ -5588,7 +5667,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -5612,7 +5692,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } } } @@ -5666,7 +5747,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } } } @@ -5688,6 +5770,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5784,7 +5867,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } } } @@ -5825,6 +5909,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -5953,6 +6038,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5965,6 +6051,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6028,6 +6115,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6156,6 +6244,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6187,6 +6276,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6216,7 +6306,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -6479,6 +6570,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6491,6 +6583,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6554,6 +6647,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6682,6 +6776,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6713,6 +6808,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6742,7 +6838,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -6813,6 +6910,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6976,6 +7074,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6987,6 +7086,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7068,7 +7168,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -7111,6 +7212,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7151,7 +7253,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -7181,6 +7284,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7343,6 +7447,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7354,6 +7459,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7365,6 +7471,7 @@ "version": 1000 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7376,6 +7483,7 @@ "version": 1000 }, { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -7387,6 +7495,7 @@ "version": 1000 }, { + "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -7469,7 +7578,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -7493,7 +7603,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -7549,6 +7660,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7560,6 +7672,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7601,7 +7714,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "7": { "queries": [ @@ -7613,7 +7727,8 @@ "path": "collection/d" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -7667,6 +7782,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7678,6 +7794,7 @@ "version": 1000 }, { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -7718,7 +7835,8 @@ "path": "collection/e" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -7758,6 +7876,7 @@ }, "removed": [ { + "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -7898,6 +8017,7 @@ { "added": [ { + "key": "collection/a1", "options": { "hasCommittedMutations": false, @@ -7909,6 +8029,7 @@ "version": 1000 }, { + "key": "collection/a2", "options": { "hasCommittedMutations": false, @@ -7920,6 +8041,7 @@ "version": 1000 }, { + "key": "collection/a3", "options": { "hasCommittedMutations": false, @@ -8036,14 +8158,16 @@ } }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/b1", + "collection/b2", + "collection/b3" ], - "collection/b1", - "collection/b2", - "collection/b3" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -8055,6 +8179,7 @@ { "added": [ { + "key": "collection/b1", "options": { "hasCommittedMutations": false, @@ -8066,6 +8191,7 @@ "version": 1000 }, { + "key": "collection/b2", "options": { "hasCommittedMutations": false, @@ -8077,6 +8203,7 @@ "version": 1000 }, { + "key": "collection/b3", "options": { "hasCommittedMutations": false, @@ -8112,7 +8239,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -8201,7 +8329,8 @@ "path": "collection/a1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -8213,7 +8342,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 }, "3": { "queries": [ @@ -8225,7 +8355,8 @@ "path": "collection/a2" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -8279,6 +8410,7 @@ }, "removed": [ { + "key": "collection/a1", "options": { "hasCommittedMutations": false, @@ -8290,6 +8422,7 @@ "version": 1000 }, { + "key": "collection/a2", "options": { "hasCommittedMutations": false, @@ -8318,7 +8451,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 }, "5": { "queries": [ @@ -8330,7 +8464,8 @@ "path": "collection/a3" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -8370,6 +8505,7 @@ }, "removed": [ { + "key": "collection/a3", "options": { "hasCommittedMutations": false, @@ -8397,7 +8533,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } }, "enqueuedLimboDocs": [ @@ -8532,6 +8669,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8543,6 +8681,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -8554,6 +8693,7 @@ "version": 1000 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -8565,6 +8705,7 @@ "version": 1000 }, { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -8576,6 +8717,7 @@ "version": 1000 }, { + "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -8658,7 +8800,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -8682,7 +8825,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -8730,6 +8874,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8771,7 +8916,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "5": { "queries": [ @@ -8783,7 +8929,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -8825,6 +8972,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -8866,7 +9014,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "7": { "queries": [ @@ -8878,7 +9027,8 @@ "path": "collection/d" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -8919,6 +9069,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -8960,7 +9111,8 @@ "path": "collection/d" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "9": { "queries": [ @@ -8972,7 +9124,8 @@ "path": "collection/e" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -9012,6 +9165,7 @@ }, "removed": [ { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -9052,7 +9206,8 @@ "path": "collection/e" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } }, "enqueuedLimboDocs": [ @@ -9087,6 +9242,7 @@ }, "removed": [ { + "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -9288,6 +9444,7 @@ { "added": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9299,6 +9456,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9310,6 +9468,7 @@ "version": 1000 }, { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9423,7 +9582,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -9637,6 +9797,7 @@ { "added": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9648,6 +9809,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9659,6 +9821,7 @@ "version": 1000 }, { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9765,6 +9928,7 @@ { "added": [ { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -9781,6 +9945,7 @@ "hasPendingWrites": false, "modified": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9792,6 +9957,7 @@ "version": 2000 }, { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9818,6 +9984,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, 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 40e48205956..ac7b7a26013 100644 --- a/firebase-firestore/src/test/resources/json/limit_spec_test.json +++ b/firebase-firestore/src/test/resources/json/limit_spec_test.json @@ -95,6 +95,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -106,6 +107,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -213,7 +215,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -255,6 +258,7 @@ { "added": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -280,6 +284,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -502,6 +507,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -513,6 +519,7 @@ "version": 1000 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -540,6 +547,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -551,6 +559,7 @@ "version": 1000 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -616,6 +625,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -641,6 +651,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -656,6 +667,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -814,6 +826,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -825,6 +838,7 @@ "version": 1000 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -901,6 +915,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -926,6 +941,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1038,6 +1054,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1049,6 +1066,7 @@ "version": 1000 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1113,6 +1131,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1138,6 +1157,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1270,6 +1290,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1281,6 +1302,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1350,6 +1372,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1361,6 +1384,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1510,6 +1534,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1521,6 +1546,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1532,6 +1558,7 @@ "version": 1002 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1600,6 +1627,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1611,6 +1639,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1792,6 +1821,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1803,6 +1833,7 @@ "version": 1002 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1970,6 +2001,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1981,6 +2013,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1992,6 +2025,7 @@ "version": 1002 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2064,6 +2098,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2075,6 +2110,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2261,6 +2297,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2272,6 +2309,7 @@ "version": 1002 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2431,6 +2469,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2442,6 +2481,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2453,6 +2493,7 @@ "version": 1002 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2521,6 +2562,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2532,6 +2574,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2699,6 +2742,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2710,6 +2754,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2721,6 +2766,7 @@ "version": 1002 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2807,6 +2853,7 @@ "hasPendingWrites": false, "modified": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2849,6 +2896,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2860,6 +2908,7 @@ "version": 1002 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3068,6 +3117,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3079,6 +3129,7 @@ "version": 1001 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3125,6 +3176,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3150,6 +3202,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3234,6 +3287,7 @@ "hasPendingWrites": false, "metadata": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3414,6 +3468,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3425,6 +3480,7 @@ "version": 1000 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3512,6 +3568,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3537,6 +3594,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3666,6 +3724,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3677,6 +3736,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3688,6 +3748,7 @@ "version": 1002 }, { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3760,6 +3821,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3771,6 +3833,7 @@ "version": 1001 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3836,6 +3899,7 @@ { "added": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3866,6 +3930,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3978,6 +4043,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3989,6 +4055,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4030,6 +4097,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4041,6 +4109,7 @@ "version": 1000 }, { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4193,6 +4262,7 @@ { "added": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -4204,6 +4274,7 @@ "version": 1002 }, { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -4215,6 +4286,7 @@ "version": 1003 }, { + "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -4226,6 +4298,7 @@ "version": 1004 }, { + "key": "collection/f", "options": { "hasCommittedMutations": false, @@ -4332,7 +4405,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -4358,7 +4432,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -4408,6 +4483,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4423,6 +4499,7 @@ { "added": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -4448,6 +4525,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4491,7 +4569,8 @@ "path": "collection/b" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -4515,7 +4594,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } } } @@ -4560,6 +4640,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4575,6 +4656,7 @@ { "added": [ { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -4600,6 +4682,7 @@ }, "removed": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4655,7 +4738,8 @@ "path": "collection/c" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "7": { "queries": [ @@ -4667,7 +4751,8 @@ "path": "collection/d" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } } } @@ -4712,6 +4797,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -4727,6 +4813,7 @@ { "added": [ { + "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -4752,6 +4839,7 @@ }, "removed": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -4806,7 +4894,8 @@ "path": "collection/d" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 } } } @@ -4851,6 +4940,7 @@ }, "removed": [ { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -4866,6 +4956,7 @@ { "added": [ { + "key": "collection/f", "options": { "hasCommittedMutations": false, @@ -4891,6 +4982,7 @@ }, "removed": [ { + "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -5040,6 +5132,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5118,6 +5211,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5220,6 +5314,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5295,7 +5390,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -5377,6 +5473,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5455,12 +5552,14 @@ } }, { - "watchFilter": [ - [ - 2 + "watchFilter": { + "keys": [ + "collection/b" ], - "collection/b" - ] + "targetIds": [ + 2 + ] + } }, { "watchSnapshot": { @@ -5486,7 +5585,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -5552,7 +5652,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ @@ -5570,7 +5671,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -5598,6 +5700,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5627,6 +5730,7 @@ }, "removed": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5660,7 +5764,8 @@ "path": "collection" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 1 } } } @@ -5760,6 +5865,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5838,6 +5944,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5940,6 +6047,7 @@ { "added": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -5956,6 +6064,7 @@ "hasPendingWrites": false, "modified": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6029,6 +6138,7 @@ { "added": [ { + "key": "collection/c", "options": { "hasCommittedMutations": false, 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 9ae9f2349ff..57bb109177b 100644 --- a/firebase-firestore/src/test/resources/json/recovery_spec_test.json +++ b/firebase-firestore/src/test/resources/json/recovery_spec_test.json @@ -284,6 +284,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -354,6 +355,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -437,6 +439,7 @@ { "added": [ { + "key": "collection/key2", "options": { "hasCommittedMutations": false, @@ -619,6 +622,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -679,6 +683,7 @@ { "added": [ { + "key": "collection/key3", "options": { "hasCommittedMutations": false, @@ -788,6 +793,7 @@ "hasPendingWrites": false, "metadata": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -799,6 +805,7 @@ "version": 1 }, { + "key": "collection/key3", "options": { "hasCommittedMutations": false, @@ -905,6 +912,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -968,6 +976,7 @@ }, "removed": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1330,6 +1339,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1437,6 +1447,7 @@ { "added": [ { + "key": "collection/key2", "options": { "hasCommittedMutations": false, @@ -1553,6 +1564,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1640,6 +1652,7 @@ "hasPendingWrites": false, "modified": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1848,6 +1861,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1922,6 +1936,7 @@ }, "removed": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1958,6 +1973,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -2274,6 +2290,7 @@ { "added": [ { + "key": "collection/doc", "options": { "hasCommittedMutations": false, @@ -2436,6 +2453,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2545,6 +2563,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2699,6 +2718,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2832,6 +2852,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2941,6 +2962,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3001,6 +3023,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3094,7 +3117,8 @@ "path": "collection/key1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -3182,7 +3206,8 @@ "path": "collection/key1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -3291,6 +3316,7 @@ }, "removed": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3413,6 +3439,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3473,6 +3500,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3566,7 +3594,8 @@ "path": "collection/key1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -3625,7 +3654,8 @@ "path": "collection/key1" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "4": { "queries": [ @@ -3704,6 +3734,7 @@ }, "removed": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3826,6 +3857,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3965,6 +3997,7 @@ { "added": [ { + "key": "collection/key2", "options": { "hasCommittedMutations": false, @@ -4441,6 +4474,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4544,6 +4578,7 @@ { "added": [ { + "key": "collection/key2", "options": { "hasCommittedMutations": false, @@ -4560,6 +4595,7 @@ "hasPendingWrites": false, "metadata": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4666,6 +4702,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4752,6 +4789,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4823,6 +4861,7 @@ }, "removed": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4874,6 +4913,7 @@ { "added": [ { + "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -5089,6 +5129,7 @@ { "added": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5124,6 +5165,7 @@ { "added": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5251,6 +5293,7 @@ "hasPendingWrites": true, "metadata": [ { + "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5319,6 +5362,7 @@ "hasPendingWrites": false, "metadata": [ { + "key": "collection/b", "options": { "hasCommittedMutations": false, From a858a3055f6f6925ae97138fe407b3b8f904baab Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:13:04 -0800 Subject: [PATCH 2/7] remove changes to watch filter --- .../json/existence_filter_spec_test.json | 111 +++++---------- .../test/resources/json/limbo_spec_test.json | 126 ++---------------- .../test/resources/json/limit_spec_test.json | 95 ------------- .../resources/json/recovery_spec_test.json | 40 ------ 4 files changed, 41 insertions(+), 331 deletions(-) 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 bd875c4847b..8b5b5157f4b 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 @@ -92,7 +92,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -104,7 +103,6 @@ "version": 1000 }, { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -130,14 +128,11 @@ ] }, { - "watchFilter": { - "keys": [ - "collection/1" - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchSnapshot": { @@ -203,7 +198,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -215,7 +209,6 @@ "version": 1000 }, { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -339,7 +332,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -365,15 +357,11 @@ ] }, { - "watchFilter": { - "keys": [ - "collection/1", - "collection/2" - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchEntity": { @@ -405,7 +393,6 @@ { "added": [ { - "key": "collection/3", "options": { "hasCommittedMutations": false, @@ -519,7 +506,6 @@ { "added": [ { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -627,7 +613,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -683,7 +668,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -725,13 +709,11 @@ } }, { - "watchFilter": { - "keys": [ - ], - "targetIds": [ + "watchFilter":[ + [ 2 ] - } + ] }, { "watchRemove": { @@ -868,7 +850,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -880,7 +861,6 @@ "version": 1000 }, { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -906,14 +886,11 @@ ] }, { - "watchFilter": { - "keys": [ - "collection/1" - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchSnapshot": { @@ -1056,7 +1033,6 @@ }, "removed": [ { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1173,7 +1149,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -1199,14 +1174,11 @@ ] }, { - "watchFilter": { - "keys": [ - "collection/1" - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchSnapshot": { @@ -1310,14 +1282,11 @@ } }, { - "watchFilter": { - "keys": [ - "collection/1" - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchSnapshot": { @@ -1329,7 +1298,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -1448,7 +1416,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -1460,7 +1427,6 @@ "version": 1000 }, { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1486,14 +1452,11 @@ ] }, { - "watchFilter": { - "keys": [ - "collection/1" - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchSnapshot": { @@ -1646,7 +1609,6 @@ }, "removed": [ { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1774,7 +1736,6 @@ { "added": [ { - "key": "collection/1", "options": { "hasCommittedMutations": false, @@ -1786,7 +1747,6 @@ "version": 1000 }, { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -1842,14 +1802,11 @@ ] }, { - "watchFilter": { - "keys": [ - "collection/1" - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchSnapshot": { @@ -2002,7 +1959,6 @@ }, "removed": [ { - "key": "collection/2", "options": { "hasCommittedMutations": false, @@ -2119,7 +2075,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2145,13 +2100,11 @@ ] }, { - "watchFilter": { - "keys": [ - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchSnapshot": { @@ -2173,7 +2126,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2263,14 +2215,11 @@ ] }, { - "watchFilter": { - "keys": [ - "collection/1" - ], - "targetIds": [ + "watchFilter": [ + [ 2 ] - } + ] }, { "watchSnapshot": { 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 d92fd90e92f..6edf4b3589a 100644 --- a/firebase-firestore/src/test/resources/json/limbo_spec_test.json +++ b/firebase-firestore/src/test/resources/json/limbo_spec_test.json @@ -81,7 +81,6 @@ { "added": [ { - "key": "collection1/doc", "options": { "hasCommittedMutations": false, @@ -142,7 +141,6 @@ { "added": [ { - "key": "collection1/doc", "options": { "hasCommittedMutations": false, @@ -360,7 +358,6 @@ { "added": [ { - "key": "collection2/doc", "options": { "hasCommittedMutations": false, @@ -451,7 +448,6 @@ { "added": [ { - "key": "collection2/doc", "options": { "hasCommittedMutations": false, @@ -638,7 +634,6 @@ { "added": [ { - "key": "collection2/doc", "options": { "hasCommittedMutations": false, @@ -1053,7 +1048,6 @@ { "added": [ { - "key": "collection1/doc1", "options": { "hasCommittedMutations": false, @@ -1114,7 +1108,6 @@ { "added": [ { - "key": "collection1/doc1", "options": { "hasCommittedMutations": false, @@ -1332,7 +1325,6 @@ { "added": [ { - "key": "collection2/doc2", "options": { "hasCommittedMutations": false, @@ -1423,7 +1415,6 @@ { "added": [ { - "key": "collection2/doc2", "options": { "hasCommittedMutations": false, @@ -1610,7 +1601,6 @@ { "added": [ { - "key": "collection2/doc2", "options": { "hasCommittedMutations": false, @@ -1894,7 +1884,6 @@ { "added": [ { - "key": "collection/doc", "options": { "hasCommittedMutations": false, @@ -1955,7 +1944,6 @@ { "added": [ { - "key": "collection/doc", "options": { "hasCommittedMutations": false, @@ -2094,7 +2082,6 @@ { "added": [ { - "key": "collection/doc", "options": { "hasCommittedMutations": false, @@ -2354,7 +2341,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2366,7 +2352,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2485,7 +2470,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2611,7 +2595,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2655,7 +2638,6 @@ "hasPendingWrites": true, "modified": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2719,7 +2701,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2817,7 +2798,6 @@ "hasPendingWrites": false, "modified": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2901,7 +2881,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3069,7 +3048,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3081,7 +3059,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3239,7 +3216,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3337,7 +3313,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3434,13 +3409,11 @@ ] }, { - "watchFilter": { - "keys": [ - ], - "targetIds": [ + "watchFilter": [ + [ 1 ] - } + ] }, { "watchCurrent": [ @@ -3470,7 +3443,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3586,7 +3558,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3710,7 +3681,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3878,7 +3848,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3890,7 +3859,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4120,7 +4088,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4246,7 +4213,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4410,7 +4376,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4541,7 +4506,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4783,7 +4747,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4799,7 +4762,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4955,7 +4917,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": true, @@ -4967,7 +4928,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": true, @@ -5100,7 +5060,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5112,7 +5071,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": true, @@ -5238,7 +5196,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5250,7 +5207,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": true, @@ -5426,7 +5382,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5438,7 +5393,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5450,7 +5404,6 @@ "version": 1001 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -5770,7 +5723,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5909,7 +5861,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6038,7 +5989,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6051,7 +6001,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6115,7 +6064,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6244,7 +6192,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6276,7 +6223,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6570,7 +6516,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6583,7 +6528,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6647,7 +6591,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6776,7 +6719,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -6808,7 +6750,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6910,7 +6851,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7074,7 +7014,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7086,7 +7025,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7212,7 +7150,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7284,7 +7221,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7447,7 +7383,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7459,7 +7394,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7471,7 +7405,6 @@ "version": 1000 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7483,7 +7416,6 @@ "version": 1000 }, { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -7495,7 +7427,6 @@ "version": 1000 }, { - "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -7660,7 +7591,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -7672,7 +7602,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -7782,7 +7711,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -7794,7 +7722,6 @@ "version": 1000 }, { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -7876,7 +7803,6 @@ }, "removed": [ { - "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -8017,7 +7943,6 @@ { "added": [ { - "key": "collection/a1", "options": { "hasCommittedMutations": false, @@ -8029,7 +7954,6 @@ "version": 1000 }, { - "key": "collection/a2", "options": { "hasCommittedMutations": false, @@ -8041,7 +7965,6 @@ "version": 1000 }, { - "key": "collection/a3", "options": { "hasCommittedMutations": false, @@ -8158,16 +8081,15 @@ } }, { - "watchFilter": { - "keys": [ - "collection/b1", - "collection/b2", - "collection/b3" - ], - "targetIds": [ + "watchFilter": [ + [ 2 - ] - } + ], + "collection/b1", + "collection/b2", + "collection/b3" + ] + }, { "watchSnapshot": { @@ -8179,7 +8101,6 @@ { "added": [ { - "key": "collection/b1", "options": { "hasCommittedMutations": false, @@ -8191,7 +8112,6 @@ "version": 1000 }, { - "key": "collection/b2", "options": { "hasCommittedMutations": false, @@ -8203,7 +8123,6 @@ "version": 1000 }, { - "key": "collection/b3", "options": { "hasCommittedMutations": false, @@ -8410,7 +8329,6 @@ }, "removed": [ { - "key": "collection/a1", "options": { "hasCommittedMutations": false, @@ -8422,7 +8340,6 @@ "version": 1000 }, { - "key": "collection/a2", "options": { "hasCommittedMutations": false, @@ -8505,7 +8422,6 @@ }, "removed": [ { - "key": "collection/a3", "options": { "hasCommittedMutations": false, @@ -8669,7 +8585,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8681,7 +8596,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -8693,7 +8607,6 @@ "version": 1000 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -8705,7 +8618,6 @@ "version": 1000 }, { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -8717,7 +8629,6 @@ "version": 1000 }, { - "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -8874,7 +8785,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -8972,7 +8882,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9069,7 +8978,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9165,7 +9073,6 @@ }, "removed": [ { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -9242,7 +9149,6 @@ }, "removed": [ { - "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -9444,7 +9350,6 @@ { "added": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9456,7 +9361,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9468,7 +9372,6 @@ "version": 1000 }, { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9797,7 +9700,6 @@ { "added": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -9809,7 +9711,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9821,7 +9722,6 @@ "version": 1000 }, { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9928,7 +9828,6 @@ { "added": [ { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -9945,7 +9844,6 @@ "hasPendingWrites": false, "modified": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -9957,7 +9855,6 @@ "version": 2000 }, { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -9984,7 +9881,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, 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 ac7b7a26013..3b226ee1061 100644 --- a/firebase-firestore/src/test/resources/json/limit_spec_test.json +++ b/firebase-firestore/src/test/resources/json/limit_spec_test.json @@ -95,7 +95,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -107,7 +106,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -258,7 +256,6 @@ { "added": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -284,7 +281,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -507,7 +503,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -519,7 +514,6 @@ "version": 1000 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -547,7 +541,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -559,7 +552,6 @@ "version": 1000 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -625,7 +617,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -651,7 +642,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -667,7 +657,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -826,7 +815,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -838,7 +826,6 @@ "version": 1000 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -915,7 +902,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -941,7 +927,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1054,7 +1039,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1066,7 +1050,6 @@ "version": 1000 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1131,7 +1114,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1157,7 +1139,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1290,7 +1271,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1302,7 +1282,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1372,7 +1351,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1384,7 +1362,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1534,7 +1511,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1546,7 +1522,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1558,7 +1533,6 @@ "version": 1002 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -1627,7 +1601,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -1639,7 +1612,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1821,7 +1793,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -1833,7 +1804,6 @@ "version": 1002 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2001,7 +1971,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2013,7 +1982,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2025,7 +1993,6 @@ "version": 1002 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2098,7 +2065,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2110,7 +2076,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2297,7 +2262,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2309,7 +2273,6 @@ "version": 1002 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2469,7 +2432,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2481,7 +2443,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2493,7 +2454,6 @@ "version": 1002 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2562,7 +2522,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2574,7 +2533,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2742,7 +2700,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2754,7 +2711,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2766,7 +2722,6 @@ "version": 1002 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -2853,7 +2808,6 @@ "hasPendingWrites": false, "modified": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2896,7 +2850,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2908,7 +2861,6 @@ "version": 1002 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3117,7 +3069,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3129,7 +3080,6 @@ "version": 1001 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3176,7 +3126,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3202,7 +3151,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3287,7 +3235,6 @@ "hasPendingWrites": false, "metadata": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3468,7 +3415,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3480,7 +3426,6 @@ "version": 1000 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3568,7 +3513,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3594,7 +3538,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3724,7 +3667,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3736,7 +3678,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3748,7 +3689,6 @@ "version": 1002 }, { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3821,7 +3761,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -3833,7 +3772,6 @@ "version": 1001 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -3899,7 +3837,6 @@ { "added": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -3930,7 +3867,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4043,7 +3979,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4055,7 +3990,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4097,7 +4031,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4109,7 +4042,6 @@ "version": 1000 }, { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4262,7 +4194,6 @@ { "added": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -4274,7 +4205,6 @@ "version": 1002 }, { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -4286,7 +4216,6 @@ "version": 1003 }, { - "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -4298,7 +4227,6 @@ "version": 1004 }, { - "key": "collection/f", "options": { "hasCommittedMutations": false, @@ -4483,7 +4411,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4499,7 +4426,6 @@ { "added": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -4525,7 +4451,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -4640,7 +4565,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4656,7 +4580,6 @@ { "added": [ { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -4682,7 +4605,6 @@ }, "removed": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -4797,7 +4719,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -4813,7 +4734,6 @@ { "added": [ { - "key": "collection/e", "options": { "hasCommittedMutations": false, @@ -4839,7 +4759,6 @@ }, "removed": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -4940,7 +4859,6 @@ }, "removed": [ { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -4956,7 +4874,6 @@ { "added": [ { - "key": "collection/f", "options": { "hasCommittedMutations": false, @@ -4982,7 +4899,6 @@ }, "removed": [ { - "key": "collection/d", "options": { "hasCommittedMutations": false, @@ -5132,7 +5048,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5211,7 +5126,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5314,7 +5228,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5473,7 +5386,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5700,7 +5612,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5730,7 +5641,6 @@ }, "removed": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5865,7 +5775,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5944,7 +5853,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6047,7 +5955,6 @@ { "added": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, @@ -6064,7 +5971,6 @@ "hasPendingWrites": false, "modified": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -6138,7 +6044,6 @@ { "added": [ { - "key": "collection/c", "options": { "hasCommittedMutations": false, 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 57bb109177b..bb7306476a3 100644 --- a/firebase-firestore/src/test/resources/json/recovery_spec_test.json +++ b/firebase-firestore/src/test/resources/json/recovery_spec_test.json @@ -284,7 +284,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -355,7 +354,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -439,7 +437,6 @@ { "added": [ { - "key": "collection/key2", "options": { "hasCommittedMutations": false, @@ -622,7 +619,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -683,7 +679,6 @@ { "added": [ { - "key": "collection/key3", "options": { "hasCommittedMutations": false, @@ -793,7 +788,6 @@ "hasPendingWrites": false, "metadata": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -805,7 +799,6 @@ "version": 1 }, { - "key": "collection/key3", "options": { "hasCommittedMutations": false, @@ -912,7 +905,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -976,7 +968,6 @@ }, "removed": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1339,7 +1330,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1447,7 +1437,6 @@ { "added": [ { - "key": "collection/key2", "options": { "hasCommittedMutations": false, @@ -1564,7 +1553,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1652,7 +1640,6 @@ "hasPendingWrites": false, "modified": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1861,7 +1848,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1936,7 +1922,6 @@ }, "removed": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -1973,7 +1958,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -2290,7 +2274,6 @@ { "added": [ { - "key": "collection/doc", "options": { "hasCommittedMutations": false, @@ -2453,7 +2436,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2563,7 +2545,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2718,7 +2699,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -2852,7 +2832,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -2962,7 +2941,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3023,7 +3001,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3316,7 +3293,6 @@ }, "removed": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3439,7 +3415,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3500,7 +3475,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3734,7 +3708,6 @@ }, "removed": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3857,7 +3830,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -3997,7 +3969,6 @@ { "added": [ { - "key": "collection/key2", "options": { "hasCommittedMutations": false, @@ -4474,7 +4445,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4578,7 +4548,6 @@ { "added": [ { - "key": "collection/key2", "options": { "hasCommittedMutations": false, @@ -4595,7 +4564,6 @@ "hasPendingWrites": false, "metadata": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4702,7 +4670,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4789,7 +4756,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4861,7 +4827,6 @@ }, "removed": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -4913,7 +4878,6 @@ { "added": [ { - "key": "collection/key1", "options": { "hasCommittedMutations": false, @@ -5129,7 +5093,6 @@ { "added": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5165,7 +5128,6 @@ { "added": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, @@ -5293,7 +5255,6 @@ "hasPendingWrites": true, "metadata": [ { - "key": "collection/a", "options": { "hasCommittedMutations": false, @@ -5362,7 +5323,6 @@ "hasPendingWrites": false, "metadata": [ { - "key": "collection/b", "options": { "hasCommittedMutations": false, From 18ef45535bad7c5a071fe12cf9bcdaa7b44705d6 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:18:14 -0800 Subject: [PATCH 3/7] remove noice --- .../json/existence_filter_spec_test.json | 27 ++++++++++++------- .../test/resources/json/limit_spec_test.json | 12 ++++----- 2 files changed, 23 insertions(+), 16 deletions(-) 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 8b5b5157f4b..1004cd567dc 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 @@ -131,7 +131,8 @@ "watchFilter": [ [ 2 - ] + ], + "collection/1" ] }, { @@ -360,7 +361,9 @@ "watchFilter": [ [ 2 - ] + ], + "collection/1", + "collection/2" ] }, { @@ -709,7 +712,7 @@ } }, { - "watchFilter":[ + "watchFilter": [ [ 2 ] @@ -889,7 +892,8 @@ "watchFilter": [ [ 2 - ] + ], + "collection/1" ] }, { @@ -1177,7 +1181,8 @@ "watchFilter": [ [ 2 - ] + ], + "collection/1" ] }, { @@ -1285,7 +1290,8 @@ "watchFilter": [ [ 2 - ] + ], + "collection/1" ] }, { @@ -1455,7 +1461,8 @@ "watchFilter": [ [ 2 - ] + ], + "collection/1" ] }, { @@ -1805,7 +1812,8 @@ "watchFilter": [ [ 2 - ] + ], + "collection/1" ] }, { @@ -2218,7 +2226,8 @@ "watchFilter": [ [ 2 - ] + ], + "collection/1" ] }, { 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 3b226ee1061..521e8e41b42 100644 --- a/firebase-firestore/src/test/resources/json/limit_spec_test.json +++ b/firebase-firestore/src/test/resources/json/limit_spec_test.json @@ -5464,14 +5464,12 @@ } }, { - "watchFilter": { - "keys": [ - "collection/b" - ], - "targetIds": [ + "watchFilter": [ + [ 2 - ] - } + ], + "collection/b" + ] }, { "watchSnapshot": { From a488e3b785eb7795c4db706a646d28dd9bba5f9d Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:32:47 -0800 Subject: [PATCH 4/7] Update bundle_spec_test.json --- .../src/test/resources/json/bundle_spec_test.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 e45f01e937a..94bc9cc0da1 100644 --- a/firebase-firestore/src/test/resources/json/bundle_spec_test.json +++ b/firebase-firestore/src/test/resources/json/bundle_spec_test.json @@ -1165,7 +1165,8 @@ "path": "collection/a" } ], - "resumeToken": "" + "resumeToken": "", + "targetPurpose": 2 }, "2": { "queries": [ From ec4af61ae470b4faafd67a90ebd33708cb643dc6 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:37:26 -0800 Subject: [PATCH 5/7] update comments --- .../google/firebase/firestore/spec/SpecTestCase.java | 10 +++------- 1 file changed, 3 insertions(+), 7 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 d316fc84e59..5044bc05965 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 @@ -990,9 +990,6 @@ private void validateExpectedState(@Nullable JSONObject expectedState) throws JS expectedActiveTargets.put(targetId, new ArrayList<>()); for (int i = 0; i < queryArrayJson.length(); i++) { Query query = parseQuery(queryArrayJson.getJSONObject(i)); - // TODO: populate the purpose of the target once it's possible to encode that in the - // spec tests. For now, hard-code that it's a listen despite the fact that it's not - // always the right value. QueryPurpose purpose = QueryPurpose.LISTEN; if (queryDataJson.has("targetPurpose")) { @@ -1000,8 +997,7 @@ private void validateExpectedState(@Nullable JSONObject expectedState) throws JS } TargetData targetData = - new TargetData( - query.toTarget(), targetId, ARBITRARY_SEQUENCE_NUMBER, purpose); + new TargetData(query.toTarget(), targetId, ARBITRARY_SEQUENCE_NUMBER, purpose); if (queryDataJson.has("resumeToken")) { targetData = targetData.withResumeToken( @@ -1140,8 +1136,8 @@ private void validateActiveTargets() { TargetData expectedTarget = expectedQueries.get(0); TargetData actualTarget = actualTargets.get(expected.getKey()); - // TODO: validate the purpose of the target once it's possible to encode that in the - // spec tests. For now, only validate properties that can be validated. + // TODO: check why the sequenceNumber are different, when resolved, simplify the TargetData + // validation. // assertEquals(expectedTarget, actualTarget); assertEquals(expectedTarget.getPurpose(), actualTarget.getPurpose()); From e47d39584206fba0824949298a63a1bae10615a1 Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:41:43 -0800 Subject: [PATCH 6/7] Update SpecTestCase.java --- .../java/com/google/firebase/firestore/spec/SpecTestCase.java | 3 +-- 1 file changed, 1 insertion(+), 2 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 5044bc05965..65823a5ce8c 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 @@ -1136,8 +1136,7 @@ private void validateActiveTargets() { TargetData expectedTarget = expectedQueries.get(0); TargetData actualTarget = actualTargets.get(expected.getKey()); - // TODO: check why the sequenceNumber are different, when resolved, simplify the TargetData - // validation. + // TODO: Simplify the TargetData validation when the sequenceNumber can be consistent as well. // assertEquals(expectedTarget, actualTarget); assertEquals(expectedTarget.getPurpose(), actualTarget.getPurpose()); From 6b03974c3a08bafaaeec267e2531a1a31459656e Mon Sep 17 00:00:00 2001 From: milaGGL <107142260+milaGGL@users.noreply.github.com> Date: Fri, 10 Mar 2023 21:19:40 -0800 Subject: [PATCH 7/7] resolve comments --- .../com/google/firebase/firestore/spec/SpecTestCase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 65823a5ce8c..4d37deb2eba 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 @@ -1136,11 +1136,12 @@ private void validateActiveTargets() { TargetData expectedTarget = expectedQueries.get(0); TargetData actualTarget = actualTargets.get(expected.getKey()); - // TODO: Simplify the TargetData validation when the sequenceNumber can be consistent as well. + // TODO: Replace the assertEquals() checks on the individual properties of TargetData below + // with the single assertEquals on the TargetData objects themselves if the sequenceNumber is + // ever made to be consistent. // assertEquals(expectedTarget, actualTarget); assertEquals(expectedTarget.getPurpose(), actualTarget.getPurpose()); - assertEquals(expectedTarget.getTarget(), actualTarget.getTarget()); assertEquals(expectedTarget.getTargetId(), actualTarget.getTargetId()); assertEquals(expectedTarget.getSnapshotVersion(), actualTarget.getSnapshotVersion());