{ "Limbo documents are deleted without an existence filter": { "describeName": "Limbo Documents:", "itName": "Limbo documents are deleted without an existence filter", "tags": [], "config": { "useGarbageCollection": true }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "watchSnapshot": { "version": 1000 }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] }, { "watchReset": [ 2 ] }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 }, "stateExpect": { "limboDocs": [ "collection/a" ], "activeTargets": { "1": { "query": { "path": "collection/a", "filters": [], "orderBys": [] }, "resumeToken": "" }, "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "errorCode": 0, "fromCache": true, "hasPendingWrites": false } ] }, { "watchAck": [ 1 ] }, { "watchCurrent": [ [ 1 ], "resume-token-2" ] }, { "watchSnapshot": { "version": 1002 }, "stateExpect": { "limboDocs": [], "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "removed": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] } ] }, "Limbo documents are deleted with an existence filter": { "describeName": "Limbo Documents:", "itName": "Limbo documents are deleted with an existence filter", "tags": [], "config": { "useGarbageCollection": true }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "watchSnapshot": { "version": 1000 }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] }, { "watchReset": [ 2 ] }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 }, "stateExpect": { "limboDocs": [ "collection/a" ], "activeTargets": { "1": { "query": { "path": "collection/a", "filters": [], "orderBys": [] }, "resumeToken": "" }, "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "errorCode": 0, "fromCache": true, "hasPendingWrites": false } ] }, { "watchAck": [ 1 ] }, { "watchFilter": [ [ 1 ] ] }, { "watchCurrent": [ [ 1 ], "resume-token-1002" ] }, { "watchSnapshot": { "version": 1002 }, "stateExpect": { "limboDocs": [], "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "removed": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] } ] }, "Limbo documents are resolved with updates": { "describeName": "Limbo Documents:", "itName": "Limbo documents are resolved with updates", "tags": [], "config": { "useGarbageCollection": true }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "watchSnapshot": { "version": 1000 }, "expect": [ { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] }, { "watchReset": [ 2 ] }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 }, "stateExpect": { "limboDocs": [ "collection/a" ], "activeTargets": { "1": { "query": { "path": "collection/a", "filters": [], "orderBys": [] }, "resumeToken": "" }, "2": { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "errorCode": 0, "fromCache": true, "hasPendingWrites": false } ] }, { "watchAck": [ 1 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "b" } ] ], "targets": [ 1 ] } }, { "watchCurrent": [ [ 1 ], "resume-token-1002" ] }, { "watchSnapshot": { "version": 1002 }, "stateExpect": { "limboDocs": [], "activeTargets": { "2": { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "removed": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] } ] }, "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": { "useGarbageCollection": true }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "watchSnapshot": { "version": 1000 }, "expect": [ { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] }, { "userListen": [ 4, { "path": "collection", "filters": [ [ "key", "==", "b" ] ], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "resumeToken": "" }, "4": { "query": { "path": "collection", "filters": [ [ "key", "==", "b" ] ], "orderBys": [] }, "resumeToken": "" } } } }, { "watchReset": [ 2 ] }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 }, "stateExpect": { "limboDocs": [ "collection/a" ], "activeTargets": { "1": { "query": { "path": "collection/a", "filters": [], "orderBys": [] }, "resumeToken": "" }, "2": { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "resumeToken": "" }, "4": { "query": { "path": "collection", "filters": [ [ "key", "==", "b" ] ], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "errorCode": 0, "fromCache": true, "hasPendingWrites": false } ] }, { "watchAck": [ 4 ] }, { "watchAck": [ 1 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "b" } ] ], "targets": [ 1, 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-1002" ] }, { "watchSnapshot": { "version": 1002 }, "stateExpect": { "limboDocs": [], "activeTargets": { "2": { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "resumeToken": "" }, "4": { "query": { "path": "collection", "filters": [ [ "key", "==", "b" ] ], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [ [ "key", "==", "a" ] ], "orderBys": [] }, "removed": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false }, { "query": { "path": "collection", "filters": [ [ "key", "==", "b" ] ], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "key": "b" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] }, { "watchCurrent": [ [ 1 ], "resume-token-1003" ] }, { "watchSnapshot": { "version": 1003 } } ] }, "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": { "useGarbageCollection": true }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ], [ "collection/b", 1001, { "key": "b" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1002" ] }, { "watchSnapshot": { "version": 1002 }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "key": "a" } ], [ "collection/b", 1001, { "key": "b" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] }, { "watchEntity": { "key": "collection/b", "removedTargets": [ 2 ] } }, { "watchSnapshot": { "version": 1003 }, "stateExpect": { "limboDocs": [ "collection/b" ], "activeTargets": { "1": { "query": { "path": "collection/b", "filters": [], "orderBys": [] }, "resumeToken": "" }, "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "errorCode": 0, "fromCache": true, "hasPendingWrites": false } ] }, { "watchAck": [ 1 ] }, { "watchCurrent": [ [ 1 ], "resume-token-1004" ] }, { "watchSnapshot": { "version": 1004 }, "stateExpect": { "limboDocs": [], "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "removed": [ [ "collection/b", 1001, { "key": "b" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] } ] }, "Limbo documents handle receiving ack and then current": { "describeName": "Limbo Documents:", "itName": "Limbo documents handle receiving ack and then current", "tags": [], "config": { "useGarbageCollection": false }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "include": true, "key": "a" } ], [ "collection/b", 1000, { "include": true, "key": "b" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1000" ] }, { "watchSnapshot": { "version": 1000 }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "include": true, "key": "a" } ], [ "collection/b", 1000, { "include": true, "key": "b" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] }, { "userUnlisten": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": {} } }, { "userListen": [ 4, { "path": "collection", "limit": 1, "filters": [ [ "include", "==", true ] ], "orderBys": [] } ], "stateExpect": { "activeTargets": { "4": { "query": { "path": "collection", "limit": 1, "filters": [ [ "include", "==", true ] ], "orderBys": [] }, "resumeToken": "" } } }, "expect": [ { "query": { "path": "collection", "limit": 1, "filters": [ [ "include", "==", true ] ], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "include": true, "key": "a" } ] ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false } ] }, { "watchAck": [ 4 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "include": true, "key": "a" } ] ], "targets": [ 4 ] } }, { "watchCurrent": [ [ 4 ], "resume-token-2000" ] }, { "watchSnapshot": { "version": 2000 }, "expect": [ { "query": { "path": "collection", "limit": 1, "filters": [ [ "include", "==", true ] ], "orderBys": [] }, "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] }, { "userPatch": [ "collection/a", { "include": false } ], "expect": [ { "query": { "path": "collection", "limit": 1, "filters": [ [ "include", "==", true ] ], "orderBys": [] }, "added": [ [ "collection/b", 1000, { "include": true, "key": "b" } ] ], "removed": [ [ "collection/a", 1000, { "include": true, "key": "a" } ] ], "errorCode": 0, "fromCache": true, "hasPendingWrites": false } ], "stateExpect": { "limboDocs": [ "collection/b" ], "activeTargets": { "1": { "query": { "path": "collection/b", "filters": [], "orderBys": [] }, "resumeToken": "" }, "4": { "query": { "path": "collection", "limit": 1, "filters": [ [ "include", "==", true ] ], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 1 ] }, { "watchEntity": { "docs": [ [ "collection/b", 1000, { "include": true, "key": "b" } ] ], "targets": [ 1 ] } }, { "watchCurrent": [ [ 1 ], "resume-token-3000" ] }, { "watchSnapshot": { "version": 3000 } }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "include": true, "key": "a" } ] ], "removedTargets": [ 4 ] } }, { "watchEntity": { "docs": [ [ "collection/b", 1000, { "include": true, "key": "b" } ] ], "targets": [ 4 ] } }, { "watchSnapshot": { "version": 4000 }, "expect": [ { "query": { "path": "collection", "limit": 1, "filters": [ [ "include", "==", true ] ], "orderBys": [] }, "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ], "stateExpect": { "limboDocs": [], "activeTargets": { "4": { "query": { "path": "collection", "limit": 1, "filters": [ [ "include", "==", true ] ], "orderBys": [] }, "resumeToken": "" } } } } ] } }