{ "A limbo resolution for a document should be removed from the queue when the last query listen stops": { "describeName": "Limbo Documents:", "itName": "A limbo resolution for a document should be removed from the queue when the last query listen stops", "tags": [ ], "config": { "maxConcurrentLimboResolutions": 1, "numClients": 1, "useEagerGCForMemory": false }, "steps": [ { "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection1" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection1/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1000 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection1/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection1" } } ] }, { "userUnlisten": [ 2, { "filters": [ ], "orderBys": [ ], "path": "collection1" } ], "expectedState": { "activeTargets": { } } }, { "userListen": { "query": { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" }, "targetId": 4 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection1/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } } ], "expectedState": { "activeTargets": { "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } } } }, { "watchAck": [ 4 ] }, { "watchEntity": { "docs": [ ], "targets": [ 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1001 }, "expectedState": { "activeLimboDocs": [ "collection1/doc" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } } } }, { "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection2" }, "targetId": 6 }, "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "6": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } } } }, { "watchAck": [ 6 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection2/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 2 }, "version": 1000 } ], "targets": [ 6 ] } }, { "watchCurrent": [ [ 6 ], "resume-token-1002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1002 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection2/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 2 }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection2" } } ] }, { "userUnlisten": [ 6, { "filters": [ ], "orderBys": [ ], "path": "collection2" } ], "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } } } }, { "userListen": { "query": { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" }, "targetId": 8 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection2/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 2 }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } } ], "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } } } }, { "watchAck": [ 8 ] }, { "watchEntity": { "docs": [ ], "targets": [ 8 ] } }, { "watchCurrent": [ [ 8 ], "resume-token-1003" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1003 }, "expectedState": { "activeLimboDocs": [ "collection1/doc" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ "collection2/doc" ] } }, { "userListen": { "query": { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" }, "targetId": 10 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection2/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 2 }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" } } ], "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "10": { "queries": [ { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } } } }, { "watchAck": [ 10 ] }, { "watchEntity": { "docs": [ ], "targets": [ 10 ] } }, { "watchCurrent": [ [ 10 ], "resume-token-1004" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1004 }, "expectedState": { "activeLimboDocs": [ "collection1/doc" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "10": { "queries": [ { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ "collection2/doc" ] } }, { "userUnlisten": [ 10, { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "expectedState": { "activeLimboDocs": [ "collection1/doc" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ "collection2/doc" ] } }, { "userUnlisten": [ 8, { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "expectedState": { "activeLimboDocs": [ "collection1/doc" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ ] } } ] }, "A limbo resolution for a document should not be enqueued if one is already enqueued": { "describeName": "Limbo Documents:", "itName": "A limbo resolution for a document should not be enqueued if one is already enqueued", "tags": [ ], "config": { "maxConcurrentLimboResolutions": 1, "numClients": 1, "useEagerGCForMemory": false }, "steps": [ { "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection1" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection1/doc1", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1000 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection1/doc1", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection1" } } ] }, { "userUnlisten": [ 2, { "filters": [ ], "orderBys": [ ], "path": "collection1" } ], "expectedState": { "activeTargets": { } } }, { "userListen": { "query": { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" }, "targetId": 4 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection1/doc1", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } } ], "expectedState": { "activeTargets": { "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } } } }, { "watchAck": [ 4 ] }, { "watchEntity": { "docs": [ ], "targets": [ 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1001 }, "expectedState": { "activeLimboDocs": [ "collection1/doc1" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc1" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } } } }, { "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection2" }, "targetId": 6 }, "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc1" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "6": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } } } }, { "watchAck": [ 6 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection2/doc2", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 2 }, "version": 1000 } ], "targets": [ 6 ] } }, { "watchCurrent": [ [ 6 ], "resume-token-1002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1002 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection2/doc2", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 2 }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection2" } } ] }, { "userUnlisten": [ 6, { "filters": [ ], "orderBys": [ ], "path": "collection2" } ], "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc1" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" } } } }, { "userListen": { "query": { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" }, "targetId": 8 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection2/doc2", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 2 }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } } ], "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc1" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } } } }, { "watchAck": [ 8 ] }, { "watchEntity": { "docs": [ ], "targets": [ 8 ] } }, { "watchCurrent": [ [ 8 ], "resume-token-1003" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1003 }, "expectedState": { "activeLimboDocs": [ "collection1/doc1" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc1" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ "collection2/doc2" ] } }, { "userListen": { "query": { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" }, "targetId": 10 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection2/doc2", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 2 }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" } } ], "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc1" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "10": { "queries": [ { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } } } }, { "watchAck": [ 10 ] }, { "watchEntity": { "docs": [ ], "targets": [ 10 ] } }, { "watchCurrent": [ [ 10 ], "resume-token-1004" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1004 }, "expectedState": { "activeLimboDocs": [ "collection1/doc1" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection1/doc1" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "10": { "queries": [ { "filters": [ [ "key", ">=", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection1" } ], "resumeToken": "" }, "8": { "queries": [ { "filters": [ [ "key", "==", 2 ] ], "orderBys": [ ], "path": "collection2" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ "collection2/doc2" ] } } ] }, "A limbo resolution for a document should not be started if one is already active": { "describeName": "Limbo Documents:", "itName": "A limbo resolution for a document should not be started if one is already active", "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/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1000 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "userUnlisten": [ 2, { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "expectedState": { "activeTargets": { } } }, { "userListen": { "query": { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection" }, "targetId": 4 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeTargets": { "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 4 ] }, { "watchEntity": { "docs": [ ], "targets": [ 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1001 }, "expectedState": { "activeLimboDocs": [ "collection/doc" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ ] } }, { "userListen": { "query": { "filters": [ [ "key", ">=", 1 ] ], "orderBys": [ ], "path": "collection" }, "targetId": 6 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/doc", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": 1 }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", ">=", 1 ] ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "6": { "queries": [ { "filters": [ [ "key", ">=", 1 ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 6 ] }, { "watchEntity": { "docs": [ ], "targets": [ 6 ] } }, { "watchCurrent": [ [ 6 ], "resume-token-1002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1002 }, "expectedState": { "activeLimboDocs": [ "collection/doc" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/doc" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "key", "==", 1 ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "6": { "queries": [ { "filters": [ [ "key", ">=", 1 ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ ] } } ] }, "Document remove message will cause docs to go in limbo": { "describeName": "Limbo Documents:", "itName": "Document remove message will cause docs to go in limbo", "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/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": 1001 } ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1002 }, "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": 1001 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "watchEntity": { "key": "collection/b", "removedTargets": [ 2 ] } }, { "watchSnapshot": { "targetIds": [ ], "version": 1003 }, "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": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 1 ] }, { "watchCurrent": [ [ 1 ], "resume-token-1004" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1004 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1001 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } } ] }, "Failed limbo resolution removes document from view": { "describeName": "Limbo Documents:", "itName": "Failed limbo resolution removes document from view", "tags": [ ], "config": { "numClients": 1, "useEagerGCForMemory": true }, "steps": [ { "userListen": { "query": { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "matches": true }, "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": { "matches": true }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" } } ] }, { "userPatch": [ "collection/a", { "modified": true } ], "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": true, "modified": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": true }, "value": { "matches": true, "modified": true }, "version": 0 } ], "query": { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" } } ] }, { "userUnlisten": [ 2, { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" } ], "expectedState": { "activeTargets": { } } }, { "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "targetId": 4 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": true }, "value": { "matches": true, "modified": true }, "version": 0 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": true, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeTargets": { "4": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 4 ] }, { "watchEntity": { "docs": [ ], "targets": [ 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1001 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": true, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "failWrite": { "error": { "code": 9 } }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "modified": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1000 } ], "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/a" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } }, "userCallbacks": { "acknowledgedDocs": [ ], "rejectedDocs": [ "collection/a" ] } } }, { "watchRemove": { "cause": { "code": 7 }, "targetIds": [ 1 ] }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "4": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } } ] }, "Limbo docs are resolved by primary client": { "describeName": "Limbo Documents:", "itName": "Limbo docs are resolved by primary client", "tags": [ "multi-client" ], "config": { "numClients": 2, "useEagerGCForMemory": false }, "steps": [ { "clientIndex": 0, "drainQueue": true, "expectedState": { "isPrimary": true } }, { "clientIndex": 1, "drainQueue": true }, { "clientIndex": 1, "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "drainQueue": true, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "watchAck": [ 2 ] }, { "clientIndex": 0, "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": 1001 } ], "targets": [ 2 ] } }, { "clientIndex": 0, "watchCurrent": [ [ 2 ], "resume-token-1002" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 1002 } }, { "clientIndex": 1, "drainQueue": true, "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": 1001 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "clientIndex": 0, "drainQueue": true }, { "clientIndex": 0, "watchEntity": { "key": "collection/b", "removedTargets": [ 2 ] } }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 1003 }, "expectedState": { "activeLimboDocs": [ "collection/b" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 1, "drainQueue": true, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "clientIndex": 0, "drainQueue": true }, { "clientIndex": 0, "watchAck": [ 1 ] }, { "clientIndex": 0, "watchCurrent": [ [ 1 ], "resume-token-1004" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 1004 }, "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 1, "drainQueue": true, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1001 } ] } ] } ] }, "Limbo documents are deleted with an existence filter": { "describeName": "Limbo Documents:", "itName": "Limbo documents are deleted with an existence filter", "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/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" } } ] }, { "watchReset": [ 2 ] }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1001 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/a" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 1 ] }, { "watchFilter": { "keys": [ ], "targetIds": [ 1 ] } }, { "watchCurrent": [ [ 1 ], "resume-token-1002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1002 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "a" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } } ] }, "Limbo documents are deleted without an existence filter": { "describeName": "Limbo Documents:", "itName": "Limbo documents are deleted without an existence filter", "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/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" } } ] }, { "watchReset": [ 2 ] }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1001 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/a" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 1 ] }, { "watchCurrent": [ [ 1 ], "resume-token-2" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1002 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "a" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } } ] }, "Limbo documents are resolved after primary tab failover": { "describeName": "Limbo Documents:", "itName": "Limbo documents are resolved after primary tab failover", "tags": [ "multi-client" ], "config": { "numClients": 2, "useEagerGCForMemory": false }, "steps": [ { "clientIndex": 0, "drainQueue": true, "expectedState": { "isPrimary": true } }, { "clientIndex": 1, "drainQueue": true }, { "clientIndex": 1, "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "drainQueue": true, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "watchAck": [ 2 ] }, { "clientIndex": 0, "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": 1001 } ], "targets": [ 2 ] } }, { "clientIndex": 0, "watchCurrent": [ [ 2 ], "resume-token-1000000" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 1000000 } }, { "clientIndex": 1, "drainQueue": true, "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": 1001 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "clientIndex": 0, "drainQueue": true }, { "clientIndex": 0, "watchEntity": { "key": "collection/b", "removedTargets": [ 2 ] } }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 2000000 }, "expectedState": { "activeLimboDocs": [ "collection/b" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "shutdown": true, "expectedState": { "activeLimboDocs": [ ], "activeTargets": { }, "enqueuedLimboDocs": [ ] } }, { "clientIndex": 1, "drainQueue": true, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "clientIndex": 1, "runTimer": "client_metadata_refresh", "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" } }, "isPrimary": true } }, { "clientIndex": 1, "watchAck": [ 2 ] }, { "clientIndex": 1, "watchEntity": { "docs": [ ], "targets": [ 2 ] } }, { "clientIndex": 1, "watchCurrent": [ [ 2 ], "resume-token-3000000" ] }, { "clientIndex": 1, "watchSnapshot": { "targetIds": [ ], "version": 3000000 }, "expectedState": { "activeLimboDocs": [ "collection/b" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" } } } }, { "clientIndex": 1, "watchAck": [ 1 ] }, { "clientIndex": 1, "watchCurrent": [ [ 1 ], "resume-token-4000000" ] }, { "clientIndex": 1, "watchSnapshot": { "targetIds": [ ], "version": 4000000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1001 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" } } } } ] }, "Limbo documents are resolved with updates": { "describeName": "Limbo Documents:", "itName": "Limbo documents are resolved with updates", "tags": [ ], "config": { "numClients": 1, "useEagerGCForMemory": true }, "steps": [ { "userListen": { "query": { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ [ "key", "==", "a" ] ], "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": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } } ] }, { "watchReset": [ 2 ] }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1001 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/a" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 1 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1002 } ], "targets": [ 1 ] } }, { "watchCurrent": [ [ 1 ], "resume-token-1002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1002 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "a" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } } ] }, "Limbo documents are resolved with updates in different snapshot than \"current\"": { "describeName": "Limbo Documents:", "itName": "Limbo documents are resolved with updates in different snapshot than \"current\"", "tags": [ ], "config": { "numClients": 1, "useEagerGCForMemory": true }, "steps": [ { "userListen": { "query": { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ [ "key", "==", "a" ] ], "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": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } } ] }, { "userListen": { "query": { "filters": [ [ "key", "==", "b" ] ], "orderBys": [ ], "path": "collection" }, "targetId": 4 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "4": { "queries": [ { "filters": [ [ "key", "==", "b" ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchReset": [ 2 ] }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1001 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/a" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "4": { "queries": [ { "filters": [ [ "key", "==", "b" ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 4 ] }, { "watchAck": [ 1 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1002 } ], "targets": [ 1, 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-1002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1002 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "a" }, "version": 1000 } ] }, { "added": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1002 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ [ "key", "==", "b" ] ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ [ "key", "==", "a" ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "4": { "queries": [ { "filters": [ [ "key", "==", "b" ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchCurrent": [ [ 1 ], "resume-token-1003" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1003 } } ] }, "Limbo documents stay consistent between views": { "describeName": "Limbo Documents:", "itName": "Limbo documents stay consistent between views", "tags": [ ], "config": { "numClients": 1, "useEagerGCForMemory": false }, "steps": [ { "userSet": [ "collection/a", { "matches": true } ] }, { "userSet": [ "collection/b", { "matches": true } ] }, { "writeAck": { "version": 1000 }, "expectedState": { "userCallbacks": { "acknowledgedDocs": [ "collection/a" ], "rejectedDocs": [ ] } } }, { "writeAck": { "version": 1001 }, "expectedState": { "userCallbacks": { "acknowledgedDocs": [ "collection/b" ], "rejectedDocs": [ ] } } }, { "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "targetId": 2 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": true, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": true, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1001 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1000 } ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-2000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2000 }, "expectedState": { "activeLimboDocs": [ "collection/b" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "userListen": { "query": { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" }, "targetId": 4 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": true, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1001 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "4": { "queries": [ { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "userUnlisten": [ 2, { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "4": { "queries": [ { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "targetId": 2 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": true, "hasLocalMutations": false }, "value": { "matches": true }, "version": 1001 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-2000" }, "4": { "queries": [ { "filters": [ [ "matches", "==", true ] ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } } ] }, "Limbo documents survive primary state transitions": { "describeName": "Limbo Documents:", "itName": "Limbo documents survive primary state transitions", "tags": [ "multi-client" ], "config": { "numClients": 2, "useEagerGCForMemory": false }, "steps": [ { "clientIndex": 0, "drainQueue": true, "expectedState": { "isPrimary": true } }, { "clientIndex": 0, "userListen": { "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "watchAck": [ 2 ] }, { "clientIndex": 0, "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": 1001 }, { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1002 } ], "targets": [ 2 ] } }, { "clientIndex": 0, "watchCurrent": [ [ 2 ], "resume-token-1000000" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 1000000 }, "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": 1001 }, { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1002 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "clientIndex": 0, "watchEntity": { "key": "collection/b", "removedTargets": [ 2 ] } }, { "clientIndex": 0, "watchEntity": { "key": "collection/c", "removedTargets": [ 2 ] } }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 2000000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/b", "collection/c" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/c" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } } } }, { "clientIndex": 1, "drainQueue": true }, { "applyClientState": { "primary": true }, "clientIndex": 1, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" } }, "isPrimary": true } }, { "clientIndex": 0, "drainQueue": true }, { "clientIndex": 0, "runTimer": "client_metadata_refresh", "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } }, "isPrimary": false } }, { "clientIndex": 1, "drainQueue": true }, { "clientIndex": 1, "watchAck": [ 2 ] }, { "clientIndex": 1, "watchEntity": { "docs": [ ], "targets": [ 2 ] } }, { "clientIndex": 1, "watchCurrent": [ [ 2 ], "resume-token-3000000" ] }, { "clientIndex": 1, "watchSnapshot": { "targetIds": [ ], "version": 3000000 }, "expectedState": { "activeLimboDocs": [ "collection/b", "collection/c" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/c" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } } } }, { "clientIndex": 1, "watchAck": [ 1 ] }, { "clientIndex": 1, "watchCurrent": [ [ 1 ], "resume-token-3000000" ] }, { "clientIndex": 1, "watchSnapshot": { "targetIds": [ ], "version": 3000000 }, "expectedState": { "activeLimboDocs": [ "collection/c" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/c" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } } } }, { "clientIndex": 0, "drainQueue": true, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1001 } ] } ] }, { "applyClientState": { "primary": true }, "clientIndex": 0, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" } }, "isPrimary": true } }, { "clientIndex": 0, "watchAck": [ 2 ] }, { "clientIndex": 0, "watchEntity": { "docs": [ ], "targets": [ 2 ] } }, { "clientIndex": 0, "watchCurrent": [ [ 2 ], "resume-token-5000000" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 5000000 }, "expectedState": { "activeLimboDocs": [ "collection/c" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" }, "5": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/c" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } } } }, { "clientIndex": 0, "watchAck": [ 5 ] }, { "clientIndex": 0, "watchCurrent": [ [ 5 ], "resume-token-6000000" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 6000000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1002 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000000" } } } } ] }, "Limbo resolution handles snapshot before CURRENT": { "describeName": "Limbo Documents:", "itName": "Limbo resolution handles snapshot before CURRENT", "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/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "b" }, "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": { "include": true, "key": "a" }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "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": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" }, "targetId": 4 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeTargets": { "4": { "queries": [ { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 4 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 } ], "targets": [ 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-2000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } } ] }, { "userPatch": [ "collection/a", { "include": false } ], "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "b" }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/b" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 1 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "b" }, "version": 1000 } ], "targets": [ 1 ] } }, { "watchSnapshot": { "targetIds": [ ], "version": 2000 } }, { "watchCurrent": [ [ 1 ], "resume-token-3000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 3000 } }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 } ], "removedTargets": [ 4 ] } }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "b" }, "version": 1000 } ], "targets": [ 4 ] } }, { "watchSnapshot": { "targetIds": [ ], "version": 4000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "4": { "queries": [ { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } } ] }, "Limbo resolution handles snapshot before CURRENT [no document update]": { "describeName": "Limbo Documents:", "itName": "Limbo resolution handles snapshot before CURRENT [no document update]", "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/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "b" }, "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": { "include": true, "key": "a" }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "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": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" }, "targetId": 4 }, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeTargets": { "4": { "queries": [ { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 4 ] }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 } ], "targets": [ 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-2000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } } ] }, { "userPatch": [ "collection/a", { "include": false } ], "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "b" }, "version": 1000 } ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/b" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "4": { "queries": [ { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchAck": [ 1 ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2000 } }, { "watchCurrent": [ [ 1 ], "resume-token-3000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 3000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "b" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "4": { "queries": [ { "filters": [ [ "include", "==", true ] ], "limit": 1, "limitType": "LimitToFirst", "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } } } }, { "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "include": true, "key": "a" }, "version": 1000 } ], "removedTargets": [ 4 ] } }, { "watchSnapshot": { "targetIds": [ ], "version": 4000 } } ] }, "Limbo resolution throttling when a limbo listen is rejected.": { "describeName": "Limbo Documents:", "itName": "Limbo resolution throttling when a limbo listen is rejected.", "tags": [ ], "config": { "maxConcurrentLimboResolutions": 1, "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/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-1000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1000 }, "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" } } ] }, { "watchReset": [ 2 ] }, { "watchEntity": { "docs": [ ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/a" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ "collection/b" ] } }, { "watchRemove": { "cause": { "code": 8 }, "targetIds": [ 1 ] }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "a" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/b" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ ] } }, { "watchRemove": { "cause": { "code": 8 }, "targetIds": [ 3 ] }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ ] } } ] }, "Limbo resolution throttling with all results at once from watch": { "describeName": "Limbo Documents:", "itName": "Limbo resolution throttling with all results at once from watch", "tags": [ ], "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/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 }, { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1000 }, { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "d" }, "version": 1000 }, { "createTime": 0, "key": "collection/e", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "e" }, "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 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1000 }, { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1000 }, { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "d" }, "version": 1000 }, { "createTime": 0, "key": "collection/e", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "e" }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "watchReset": [ 2 ] }, { "watchEntity": { "docs": [ ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-2000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/a", "collection/b" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ "collection/c", "collection/d", "collection/e" ] } }, { "watchAck": [ 1 ] }, { "watchAck": [ 3 ] }, { "watchCurrent": [ [ 1 ], "resume-token-2001" ] }, { "watchCurrent": [ [ 3 ], "resume-token-2001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2001 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "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 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/c", "collection/d" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "5": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/c" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "7": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/d" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ "collection/e" ] } }, { "watchAck": [ 5 ] }, { "watchAck": [ 7 ] }, { "watchCurrent": [ [ 5 ], "resume-token-2002" ] }, { "watchCurrent": [ [ 7 ], "resume-token-2002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2002 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1000 }, { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "d" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/e" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "9": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/e" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ ] } }, { "watchAck": [ 9 ] }, { "watchCurrent": [ [ 9 ], "resume-token-2003" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2003 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/e", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "e" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ ] } } ] }, "Limbo resolution throttling with bloom filter application": { "describeName": "Limbo Documents:", "itName": "Limbo resolution throttling with bloom filter application", "tags": [ ], "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": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "resume-token-1000" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a2" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ "collection/a3" ] } } ] }, "Limbo resolution throttling with existence filter mismatch": { "describeName": "Limbo Documents:", "itName": "Limbo resolution throttling with existence filter mismatch", "tags": [ ], "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": { "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" } } ], "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "", "targetPurpose": "TargetPurposeExistenceFilterMismatch" } } } }, { "watchRemove": { "targetIds": [ 2 ] } }, { "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 ] } }, { "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": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "", "targetPurpose": "TargetPurposeExistenceFilterMismatch" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a2" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ "collection/a3" ] } }, { "watchAck": [ 1 ] }, { "watchAck": [ 3 ] }, { "watchCurrent": [ [ 1 ], "resume-token-1003" ] }, { "watchCurrent": [ [ 3 ], "resume-token-1003" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1003 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "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 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/a3" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "", "targetPurpose": "TargetPurposeExistenceFilterMismatch" }, "5": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a3" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ ] } }, { "watchAck": [ 5 ] }, { "watchCurrent": [ [ 5 ], "resume-token-1004" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 1004 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a3", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "a3" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "", "targetPurpose": "TargetPurposeExistenceFilterMismatch" } }, "enqueuedLimboDocs": [ ] } } ] }, "Limbo resolution throttling with results one at a time from watch": { "describeName": "Limbo Documents:", "itName": "Limbo resolution throttling with results one at a time from watch", "tags": [ ], "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/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 }, { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1000 }, { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "d" }, "version": 1000 }, { "createTime": 0, "key": "collection/e", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "e" }, "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 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1000 }, { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1000 }, { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "d" }, "version": 1000 }, { "createTime": 0, "key": "collection/e", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "e" }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ] }, { "watchReset": [ 2 ] }, { "watchEntity": { "docs": [ ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-2000" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2000 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" } } ], "expectedState": { "activeLimboDocs": [ "collection/a", "collection/b" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/a" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ "collection/c", "collection/d", "collection/e" ] } }, { "watchAck": [ 1 ] }, { "watchAck": [ 3 ] }, { "watchCurrent": [ [ 1 ], "resume-token-2001" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2001 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "a" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/b", "collection/c" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "3": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/b" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "5": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/c" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ "collection/d", "collection/e" ] } }, { "watchAck": [ 5 ] }, { "watchCurrent": [ [ 3 ], "resume-token-2002" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2002 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "b" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/c", "collection/d" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "5": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/c" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "7": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/d" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ "collection/e" ] } }, { "watchAck": [ 7 ] }, { "watchCurrent": [ [ 5 ], "resume-token-2003" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2003 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "c" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/d", "collection/e" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "7": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/d" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "9": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/e" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ ] } }, { "watchAck": [ 9 ] }, { "watchCurrent": [ [ 7 ], "resume-token-2004" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2004 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "d" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ "collection/e" ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" }, "9": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/e" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" } }, "enqueuedLimboDocs": [ ] } }, { "watchCurrent": [ [ 9 ], "resume-token-2005" ] }, { "watchSnapshot": { "targetIds": [ ], "version": 2005 }, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "orderBys": [ ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/e", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "key": "e" }, "version": 1000 } ] } ], "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection" } ], "resumeToken": "" } }, "enqueuedLimboDocs": [ ] } } ] }, "LimitToLast query from secondary results in expected limbo doc": { "describeName": "Limbo Documents:", "itName": "LimitToLast query from secondary results in expected limbo doc", "tags": [ "multi-client" ], "config": { "numClients": 2, "useEagerGCForMemory": false }, "steps": [ { "clientIndex": 0, "drainQueue": true }, { "applyClientState": { "visibility": "visible" }, "clientIndex": 0 }, { "clientIndex": 1, "drainQueue": true }, { "clientIndex": 1, "userListen": { "query": { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "drainQueue": true, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "watchAck": [ 2 ] }, { "clientIndex": 0, "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 11 }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 12 }, "version": 1000 }, { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 13 }, "version": 1000 } ], "targets": [ 2 ] } }, { "clientIndex": 0, "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 1000 } }, { "clientIndex": 1, "drainQueue": true, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 13 }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 12 }, "version": 1000 }, { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 11 }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } } ] }, { "clientIndex": 0, "drainQueue": true }, { "clientIndex": 0, "watchReset": [ ] }, { "clientIndex": 0, "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 11 }, "version": 2000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 12 }, "version": 2000 }, { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 100 }, "version": 2000 } ], "targets": [ 2 ] } }, { "clientIndex": 0, "watchCurrent": [ [ 2 ], "resume-token-2000" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 2000 }, "expectedState": { "activeLimboDocs": [ "collection/c" ], "activeTargets": { "1": { "queries": [ { "filters": [ ], "orderBys": [ ], "path": "collection/c" } ], "resumeToken": "", "targetPurpose": "TargetPurposeLimboResolution" }, "2": { "queries": [ { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 1, "drainQueue": true, "expectedSnapshotEvents": [ { "errorCode": 0, "fromCache": true, "hasPendingWrites": false, "query": { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } } ] } ] }, "LimitToLast query from secondary results in no expected limbo doc": { "describeName": "Limbo Documents:", "itName": "LimitToLast query from secondary results in no expected limbo doc", "tags": [ "multi-client" ], "config": { "numClients": 2, "useEagerGCForMemory": false }, "steps": [ { "clientIndex": 0, "drainQueue": true }, { "applyClientState": { "visibility": "visible" }, "clientIndex": 0 }, { "clientIndex": 1, "drainQueue": true }, { "clientIndex": 1, "userListen": { "query": { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" }, "targetId": 2 }, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "drainQueue": true, "expectedState": { "activeTargets": { "2": { "queries": [ { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } ], "resumeToken": "" } } } }, { "clientIndex": 0, "watchAck": [ 2 ] }, { "clientIndex": 0, "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 11 }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 12 }, "version": 1000 }, { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 13 }, "version": 1000 } ], "targets": [ 2 ] } }, { "clientIndex": 0, "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 1000 } }, { "clientIndex": 1, "drainQueue": true, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 13 }, "version": 1000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 12 }, "version": 1000 }, { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 11 }, "version": 1000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "query": { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } } ] }, { "clientIndex": 0, "drainQueue": true }, { "clientIndex": 0, "watchReset": [ ] }, { "clientIndex": 0, "watchEntity": { "docs": [ { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 5 }, "version": 2000 }, { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 6 }, "version": 2000 }, { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 7 }, "version": 2000 } ], "targets": [ 2 ] } }, { "clientIndex": 0, "watchCurrent": [ [ 2 ], "resume-token-2000" ] }, { "clientIndex": 0, "watchSnapshot": { "targetIds": [ ], "version": 2000 } }, { "clientIndex": 1, "drainQueue": true, "expectedSnapshotEvents": [ { "added": [ { "createTime": 0, "key": "collection/d", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 7 }, "version": 2000 } ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false, "modified": [ { "createTime": 0, "key": "collection/b", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 6 }, "version": 2000 }, { "createTime": 0, "key": "collection/a", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 5 }, "version": 2000 } ], "query": { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" }, "removed": [ { "createTime": 0, "key": "collection/c", "options": { "hasCommittedMutations": false, "hasLocalMutations": false }, "value": { "val": 13 }, "version": 1000 } ] } ] }, { "clientIndex": 0, "drainQueue": true, "expectedState": { "activeLimboDocs": [ ], "activeTargets": { "2": { "queries": [ { "filters": [ ], "limit": 3, "limitType": "LimitToLast", "orderBys": [ [ "val", "desc" ] ], "path": "collection" } ], "resumeToken": "" } } } } ] } }