{ "Waits for watch to remove targets": { "describeName": "Remote store:", "itName": "Waits for watch to remove targets", "tags": [], "config": { "useGarbageCollection": false }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "userUnlisten": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": {} } }, { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token" ] }, { "watchSnapshot": { "version": 1000 } }, { "watchRemove": { "targetIds": [ 2 ] } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] } ] }, "Waits for watch to ack last target add": { "describeName": "Remote store:", "itName": "Waits for watch to ack last target add", "tags": [], "config": { "useGarbageCollection": false }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchAck": [ 2 ] }, { "userUnlisten": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": {} } }, { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "userUnlisten": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": {} } }, { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "userUnlisten": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": {} } }, { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token" ] }, { "watchSnapshot": { "version": 1000 } }, { "watchRemove": { "targetIds": [ 2 ] } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/b", 1000, { "key": "b" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 } }, { "watchRemove": { "targetIds": [ 2 ] } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/c", 1000, { "key": "c" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 } }, { "watchRemove": { "targetIds": [ 2 ] } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/d", 1000, { "key": "d" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "added": [ [ "collection/d", 1000, { "key": "d" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] } ] }, "Cleans up watch state correctly": { "describeName": "Remote store:", "itName": "Cleans up watch state correctly", "tags": [], "config": { "useGarbageCollection": false }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchStreamClose": { "error": { "code": 14, "message": "Simulated Backend Error" }, "runBackoffTimer": true } }, { "watchAck": [ 2 ] }, { "watchEntity": { "docs": [ [ "collection/a", 1000, { "key": "a" } ] ], "targets": [ 2 ] } }, { "watchCurrent": [ [ 2 ], "resume-token-1001" ] }, { "watchSnapshot": { "version": 1001 }, "expect": [ { "query": { "path": "collection", "filters": [], "orderBys": [] }, "added": [ [ "collection/a", 1000, { "key": "a" } ] ], "errorCode": 0, "fromCache": false, "hasPendingWrites": false } ] } ] }, "Handles user changes while offline (b/74749605).": { "describeName": "Remote store:", "itName": "Handles user changes while offline (b/74749605).", "tags": [ "no-android", "no-ios" ], "config": { "useGarbageCollection": true }, "steps": [ { "userListen": [ 2, { "path": "collection", "filters": [], "orderBys": [] } ], "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchStreamClose": { "error": { "code": 14, "message": "Simulated Backend Error" }, "runBackoffTimer": false }, "stateExpect": { "activeTargets": {} } }, { "changeUser": "abc", "stateExpect": { "activeTargets": { "2": { "query": { "path": "collection", "filters": [], "orderBys": [] }, "resumeToken": "" } } } }, { "watchStreamClose": { "error": { "code": 14, "message": "Simulated Backend Error" }, "runBackoffTimer": true } } ] } }