Files
firebase-ios-sdk/Firestore/Example/Tests/SpecTests/json/write_spec_test.json
T
Gil 4e5c6d0234 Treat ABORTED writes as retryable (#2247)
* Treat ABORTED writes as retryable

This is a port of firebase/firebase-js-sdk#1456.

* Regenerate spec test json
2019-01-11 12:10:37 -08:00

10717 lines
231 KiB
JSON

{
"Two sequential writes to different documents smoke test.": {
"describeName": "Writes:",
"itName": "Two sequential writes to different documents smoke test.",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
},
{
"key": "collection/b",
"version": 500,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
},
{
"key": "collection/b",
"version": 500,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/a",
{
"v": 2
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a",
"version": 2000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
}
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a",
"version": 2000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/b",
{
"v": 2
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/b",
"version": 500,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/b",
"version": 2500,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 3000,
"targetIds": []
}
},
{
"writeAck": {
"version": 2500
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/b"
],
"rejectedDocs": []
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/b",
"version": 2500,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Event is raised for a local set before and after the write ack": {
"describeName": "Writes:",
"itName": "Event is raised for a local set before and after the write ack",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/key",
{
"v": 2
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 2000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
}
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 2000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Raises snapshot with 'hasPendingWrites' for unacknowledged write": {
"describeName": "Writes:",
"itName": "Raises snapshot with 'hasPendingWrites' for unacknowledged write",
"tags": [],
"config": {
"useGarbageCollection": false,
"numClients": 1
},
"steps": [
{
"userSet": [
"collection/doc",
{
"v": 1
}
]
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/doc",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
}
]
},
"Doesn't raise 'hasPendingWrites' for committed write and new listen": {
"describeName": "Writes:",
"itName": "Doesn't raise 'hasPendingWrites' for committed write and new listen",
"tags": [],
"config": {
"useGarbageCollection": false,
"numClients": 1
},
"steps": [
{
"userSet": [
"collection/doc",
{
"v": 1
}
]
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/doc"
],
"rejectedDocs": []
}
}
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/doc",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": true
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Doesn't raise event for document with pending patch": {
"describeName": "Writes:",
"itName": "Doesn't raise event for document with pending patch",
"tags": [],
"config": {
"useGarbageCollection": false,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-250"
]
},
{
"watchSnapshot": {
"version": 250,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userPatch": [
"collection/doc",
{
"v": 2
}
]
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/doc"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 500,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 1000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/doc",
"version": 1000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Cache will not keep data for an outdated write ack": {
"describeName": "Writes:",
"itName": "Cache will not keep data for an outdated write ack",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/key",
{
"v": 2
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 10000,
"value": {
"v": 3
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 10000,
"targetIds": []
}
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/key",
"version": 10000,
"value": {
"v": 3
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Cache raises correct event if write is acked before watch delivers it": {
"describeName": "Writes:",
"itName": "Cache raises correct event if write is acked before watch delivers it",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/key",
{
"v": 2
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 2000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 2000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Cache will hold local write until watch catches up": {
"describeName": "Writes:",
"itName": "Cache will hold local write until watch catches up",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/key",
{
"v": 3
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/key",
"version": 1000,
"value": {
"v": 3
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 3000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 2000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/b",
"version": 3000,
"value": {
"doc": "b"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
},
{
"key": "collection/key",
"version": 3000,
"value": {
"v": 3
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 3000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/b",
"version": 3000,
"value": {
"doc": "b"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"metadata": [
{
"key": "collection/key",
"version": 3000,
"value": {
"v": 3
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Local patch is applied to query until watch catches up": {
"describeName": "Writes:",
"itName": "Local patch is applied to query until watch catches up",
"tags": [],
"config": {
"useGarbageCollection": false,
"numClients": 1
},
"steps": [
{
"userSet": [
"collection/doc",
{
"local": 1
}
]
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/doc",
"version": 0,
"value": {
"local": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/doc"
],
"rejectedDocs": []
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 2000,
"value": {
"local": 1,
"remote": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-2000"
]
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/doc",
"version": 2000,
"value": {
"local": 1,
"remote": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userPatch": [
"collection/doc",
{
"local": 5
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/doc",
"version": 2000,
"value": {
"local": 5,
"remote": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 5000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/doc"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 3000,
"value": {
"local": 1,
"remote": 3
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": true
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 3000,
"targetIds": []
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 4000,
"value": {
"local": 1,
"remote": 4
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": true
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 4000,
"targetIds": []
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 5000,
"value": {
"local": 5,
"remote": 5
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 5000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/doc",
"version": 5000,
"value": {
"local": 5,
"remote": 5
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes are pipelined": {
"describeName": "Writes:",
"itName": "Writes are pipelined",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchCurrent": [
[
2
],
"resume-token"
]
},
{
"userSet": [
"collection/a0",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a0",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a1",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a1",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a2",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a2",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a3",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a3",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a4",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a4",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a5",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a5",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a6",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a6",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a7",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a7",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a8",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a8",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a9",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a9",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a10",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a10",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a11",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a11",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a12",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a12",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a13",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a13",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a14",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a14",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"stateExpect": {
"numOutstandingWrites": 10
}
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a0"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a0",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a0",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a1"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a1",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a1",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 3000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a2"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a2",
"version": 3000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 3000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a2",
"version": 3000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 4000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a3"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a3",
"version": 4000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 4000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a3",
"version": 4000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 5000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a4"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a4",
"version": 5000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 5000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a4",
"version": 5000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 6000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a5"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a5",
"version": 6000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 6000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a5",
"version": 6000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 7000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a6"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a6",
"version": 7000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 7000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a6",
"version": 7000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 8000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a7"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a7",
"version": 8000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 8000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a7",
"version": 8000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 9000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a8"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a8",
"version": 9000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 9000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a8",
"version": 9000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 10000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a9"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a9",
"version": 10000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 10000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a9",
"version": 10000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 11000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a10"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a10",
"version": 11000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 11000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a10",
"version": 11000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 12000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a11"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a11",
"version": 12000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 12000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a11",
"version": 12000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 13000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a12"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a12",
"version": 13000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 13000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a12",
"version": 13000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 14000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a13"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a13",
"version": 14000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 14000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a13",
"version": 14000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 15000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a14"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a14",
"version": 15000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 15000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a14",
"version": 15000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Pipelined writes can fail": {
"describeName": "Writes:",
"itName": "Pipelined writes can fail",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/a0",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a0",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a1",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a1",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a2",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a2",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a3",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a3",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a4",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a4",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a5",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a5",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a6",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a6",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a7",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a7",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a8",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a8",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a9",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a9",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a10",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a10",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a11",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a11",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a12",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a12",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a13",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a13",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"userSet": [
"collection/a14",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a14",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"stateExpect": {
"numOutstandingWrites": 10
}
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a0"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a0",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a1"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a1",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a2"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a2",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a3"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a3",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a4"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a4",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a5"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a5",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a6"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a6",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a7"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a7",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a8"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a8",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a9"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a9",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a10"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a10",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a11"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a11",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a12"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a12",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a13"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a13",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a14"
]
},
"numOutstandingWrites": 0
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a14",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Failed writes are released immediately.": {
"describeName": "Writes:",
"itName": "Failed writes are released immediately.",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/b",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/b"
],
"rejectedDocs": []
}
}
},
{
"userSet": [
"collection/a",
{
"v": 2
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/b",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/b",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes are not re-sent.": {
"describeName": "Writes:",
"itName": "Writes are not re-sent.",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-500"
]
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
}
},
{
"userSet": [
"collection/b",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/b"
],
"rejectedDocs": []
}
}
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
},
{
"key": "collection/b",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
},
{
"key": "collection/b",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes are not re-sent after disable/enable network.": {
"describeName": "Writes:",
"itName": "Writes are not re-sent after disable/enable network.",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-500"
]
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
},
"writeStreamRequestCount": 2
}
},
{
"enableNetwork": false,
"stateExpect": {
"activeTargets": {},
"limboDocs": [],
"writeStreamRequestCount": 3
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"enableNetwork": true,
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": "resume-token-500"
}
},
"writeStreamRequestCount": 3
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-2000"
]
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes are released when there are no queries left": {
"describeName": "Writes:",
"itName": "Writes are released when there are no queries left",
"tags": [
"eager-gc"
],
"comment": "This test verifies that committed mutations are eligible for garbage collection on target removal",
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-500"
]
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
}
},
{
"userUnlisten": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {}
}
},
{
"userListen": [
4,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"4": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
}
]
},
"Writes that fail with code invalid-argument are rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code invalid-argument are rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 3
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/key"
]
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code not-found are rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code not-found are rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 5
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/key"
]
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code already-exists are rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code already-exists are rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 6
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/key"
]
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code permission-denied are rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code permission-denied are rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 7
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/key"
]
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code failed-precondition are rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code failed-precondition are rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 9
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/key"
]
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code out-of-range are rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code out-of-range are rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 11
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/key"
]
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code unimplemented are rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code unimplemented are rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 12
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/key"
]
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code data-loss are rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code data-loss are rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 15
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/key"
]
}
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code resource_exhausted are not rejected": {
"describeName": "Writes:",
"itName": "Writes that fail with code resource_exhausted are not rejected",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 8
},
"keepInQueue": true
}
}
]
},
"Writes that fail with code aborted are retried": {
"describeName": "Writes:",
"itName": "Writes that fail with code aborted are retried",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 10
},
"keepInQueue": true
}
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code cancelled are retried": {
"describeName": "Writes:",
"itName": "Writes that fail with code cancelled are retried",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 1
},
"keepInQueue": true
}
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code unknown are retried": {
"describeName": "Writes:",
"itName": "Writes that fail with code unknown are retried",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 2
},
"keepInQueue": true
}
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code deadline-exceeded are retried": {
"describeName": "Writes:",
"itName": "Writes that fail with code deadline-exceeded are retried",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 4
},
"keepInQueue": true
}
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code internal are retried": {
"describeName": "Writes:",
"itName": "Writes that fail with code internal are retried",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 13
},
"keepInQueue": true
}
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code unavailable are retried": {
"describeName": "Writes:",
"itName": "Writes that fail with code unavailable are retried",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 14
},
"keepInQueue": true
}
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes that fail with code unauthenticated are retried": {
"describeName": "Writes:",
"itName": "Writes that fail with code unauthenticated are retried",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/key",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/key",
"version": 0,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
]
},
{
"failWrite": {
"error": {
"code": 16
},
"keepInQueue": true
}
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
]
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/key",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/key",
"version": 1000,
"value": {
"foo": "bar"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Ensure correct events after patching a doc (including a delete) and getting watcher events.": {
"describeName": "Writes:",
"itName": "Ensure correct events after patching a doc (including a delete) and getting watcher events.",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userListen": [
2,
{
"path": "collection/doc",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection/doc",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 1000,
"value": {
"a": {
"b": 2
},
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-500"
]
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/doc",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/doc",
"version": 1000,
"value": {
"a": {
"b": 2
},
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userPatch": [
"collection/doc",
{
"v": 2,
"a.c": "<DELETE>"
}
],
"expect": [
{
"query": {
"path": "collection/doc",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/doc",
"version": 1000,
"value": {
"a": {
"b": 2
},
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
]
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 2000,
"value": {
"a": {
"b": 2
},
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
}
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
}
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/doc"
],
"rejectedDocs": []
}
},
"expect": [
{
"query": {
"path": "collection/doc",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/doc",
"version": 2000,
"value": {
"a": {
"b": 2
},
"v": 2
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Writes are resent after network disconnect": {
"describeName": "Writes:",
"itName": "Writes are resent after network disconnect",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userSet": [
"collection/key",
{
"foo": "bar"
}
],
"stateExpect": {
"numOutstandingWrites": 1
}
},
{
"enableNetwork": false,
"stateExpect": {
"activeTargets": {},
"limboDocs": [],
"writeStreamRequestCount": 3
}
},
{
"enableNetwork": true,
"stateExpect": {
"writeStreamRequestCount": 5,
"numOutstandingWrites": 1
}
},
{
"writeAck": {
"version": 1
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/key"
],
"rejectedDocs": []
},
"numOutstandingWrites": 0
}
}
]
},
"New writes are sent after write failure": {
"describeName": "Writes:",
"itName": "New writes are sent after write failure",
"tags": [],
"config": {
"useGarbageCollection": true,
"numClients": 1
},
"steps": [
{
"userSet": [
"collection/a",
{
"v": 1
}
]
},
{
"failWrite": {
"error": {
"code": 9
}
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a"
]
}
}
},
{
"userSet": [
"collection/b",
{
"v": 1
}
]
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/b"
],
"rejectedDocs": []
}
}
}
]
},
"Primary client acknowledges write": {
"describeName": "Writes:",
"itName": "Primary client acknowledges write",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"applyClientState": {
"visibility": "visible"
},
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"writeAck": {
"version": 1000
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 1
}
]
},
"Primary client rejects write": {
"describeName": "Writes:",
"itName": "Primary client rejects write",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"applyClientState": {
"visibility": "visible"
},
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"failWrite": {
"error": {
"code": 9
}
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a"
]
}
},
"clientIndex": 1
}
]
},
"Pending writes are shared between clients": {
"describeName": "Writes:",
"itName": "Pending writes are shared between clients",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"clientIndex": 0
},
{
"watchAck": [
2
],
"clientIndex": 0
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
},
"clientIndex": 0
},
{
"watchCurrent": [
[
2
],
"resume-token-500"
],
"clientIndex": 0
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"v": 2
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 2
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"userSet": [
"collection/a",
{
"v": 3
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 3
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"modified": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 3
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 0
}
]
},
"Pending write is acknowledged by primary client": {
"describeName": "Writes:",
"itName": "Pending write is acknowledged by primary client",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"applyClientState": {
"visibility": "visible"
},
"clientIndex": 0
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"clientIndex": 0
},
{
"watchAck": [
2
],
"clientIndex": 0
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
},
"clientIndex": 0
},
{
"watchCurrent": [
[
2
],
"resume-token-500"
],
"clientIndex": 0
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 1
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"writeAck": {
"version": 1000
},
"clientIndex": 0
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
},
"clientIndex": 0
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 1
}
]
},
"Pending write is rejected by primary client": {
"describeName": "Writes:",
"itName": "Pending write is rejected by primary client",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"clientIndex": 0
},
{
"watchAck": [
2
],
"clientIndex": 0
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
},
"clientIndex": 0
},
{
"watchCurrent": [
[
2
],
"resume-token-500"
],
"clientIndex": 0
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 1
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"failWrite": {
"error": {
"code": 9
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/a"
]
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 1
}
]
},
"Writes are released by primary client": {
"describeName": "Writes:",
"itName": "Writes are released by primary client",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"clientIndex": 0
},
{
"watchAck": [
2
],
"clientIndex": 0
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
},
"clientIndex": 0
},
{
"watchCurrent": [
[
2
],
"resume-token-500"
],
"clientIndex": 0
},
{
"watchSnapshot": {
"version": 500,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"writeAck": {
"version": 1000
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
},
"clientIndex": 0
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a",
"version": 1000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 0
}
]
},
"Writes are held during primary failover": {
"describeName": "Writes:",
"itName": "Writes are held during primary failover",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"clientIndex": 0
},
{
"userSet": [
"collection/doc",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/doc",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"watchAck": [
2
],
"clientIndex": 0
},
{
"watchEntity": {
"docs": [],
"targets": [
2
]
},
"clientIndex": 0
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
],
"clientIndex": 0
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/doc"
],
"rejectedDocs": []
}
},
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"applyClientState": {
"primary": true
},
"stateExpect": {
"isPrimary": true,
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": "resume-token-1000"
}
}
},
"clientIndex": 1
},
{
"userListen": [
4,
{
"path": "collection/doc",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": "resume-token-1000"
},
"4": {
"query": {
"path": "collection/doc",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection/doc",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/doc",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": true
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
],
"clientIndex": 1
},
{
"watchAck": [
2
],
"clientIndex": 1
},
{
"watchAck": [
4
],
"clientIndex": 1
},
{
"watchEntity": {
"docs": [
{
"key": "collection/doc",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2,
4
]
},
"clientIndex": 1
},
{
"watchCurrent": [
[
2
],
"resume-token-2000"
],
"clientIndex": 1
},
{
"watchCurrent": [
[
4
],
"resume-token-2000"
],
"clientIndex": 1
},
{
"watchSnapshot": {
"version": 2000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection/doc",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
},
"4": {
"query": {
"path": "collection/doc",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"clientIndex": 0
},
{
"runTimer": "client_metadata_refresh",
"stateExpect": {
"isPrimary": false
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/doc",
"version": 2000,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 0
}
]
},
"Write are sequenced by multiple clients": {
"describeName": "Writes:",
"itName": "Write are sequenced by multiple clients",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 4
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userSet": [
"collection/b",
{
"v": 1
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 2
},
{
"userSet": [
"collection/c",
{
"v": 1
}
],
"clientIndex": 2
},
{
"drainQueue": true,
"clientIndex": 3
},
{
"userSet": [
"collection/d",
{
"v": 1
}
],
"clientIndex": 3
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 0
},
{
"writeAck": {
"version": 2000
},
"clientIndex": 0
},
{
"writeAck": {
"version": 3000
},
"clientIndex": 0
},
{
"failWrite": {
"error": {
"code": 9
}
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/b"
],
"rejectedDocs": []
}
},
"clientIndex": 1
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/c"
],
"rejectedDocs": []
}
},
"clientIndex": 2
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/d"
]
}
},
"clientIndex": 3
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"userSet": [
"collection/f",
{
"v": 1
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userSet": [
"collection/g",
{
"v": 1
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 2
},
{
"userSet": [
"collection/h",
{
"v": 1
}
],
"clientIndex": 2
},
{
"drainQueue": true,
"clientIndex": 3
},
{
"userSet": [
"collection/i",
{
"v": 1
}
],
"clientIndex": 3
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"writeAck": {
"version": 4000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/f"
],
"rejectedDocs": []
}
},
"clientIndex": 0
},
{
"writeAck": {
"version": 5000
},
"clientIndex": 0
},
{
"writeAck": {
"version": 6000
},
"clientIndex": 0
},
{
"failWrite": {
"error": {
"code": 9
}
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/g"
],
"rejectedDocs": []
}
},
"clientIndex": 1
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/h"
],
"rejectedDocs": []
}
},
"clientIndex": 2
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/i"
]
}
},
"clientIndex": 3
},
{
"drainQueue": true,
"clientIndex": 3
},
{
"userSet": [
"collection/j",
{
"v": 1
}
],
"clientIndex": 3
},
{
"userSet": [
"collection/k",
{
"v": 1
}
],
"clientIndex": 3
},
{
"userSet": [
"collection/l",
{
"v": 1
}
],
"clientIndex": 3
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"writeAck": {
"version": 7000
},
"clientIndex": 0
},
{
"failWrite": {
"error": {
"code": 9
}
},
"clientIndex": 0
},
{
"writeAck": {
"version": 8000
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/j",
"collection/l"
],
"rejectedDocs": [
"collection/k"
]
}
},
"clientIndex": 3
}
]
},
"Write is executed after primary tab failover": {
"describeName": "Writes:",
"itName": "Write is executed after primary tab failover",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"applyClientState": {
"visibility": "visible"
},
"stateExpect": {
"isPrimary": true
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"isPrimary": false
},
"clientIndex": 1
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"clientIndex": 1
},
{
"userSet": [
"collection/b",
{
"v": 1
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"writeAck": {
"version": 1000
},
"clientIndex": 0
},
{
"shutdown": true,
"stateExpect": {
"activeTargets": {},
"limboDocs": []
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 1
},
{
"runTimer": "client_metadata_refresh",
"stateExpect": {
"isPrimary": true
},
"clientIndex": 1
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/b"
],
"rejectedDocs": []
}
},
"clientIndex": 1
}
]
},
"Secondary tabs handle user change": {
"describeName": "Writes:",
"itName": "Secondary tabs handle user change",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"clientIndex": 0
},
{
"changeUser": "user1",
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"changeUser": "user1",
"clientIndex": 1
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"userSet": [
"collection/b",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"changeUser": "user2",
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
},
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
],
"clientIndex": 0
},
{
"userSet": [
"collection/c",
{
"v": 1
}
],
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/c",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"changeUser": "user2",
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/c",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"removed": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
},
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"changeUser": "user1",
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
},
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"removed": [
{
"key": "collection/c",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"changeUser": "user1",
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
},
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"removed": [
{
"key": "collection/c",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 0
}
]
},
"Mutations are scoped by user": {
"describeName": "Writes:",
"itName": "Mutations are scoped by user",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"clientIndex": 0
},
{
"changeUser": "user1",
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"changeUser": "user2",
"clientIndex": 1
},
{
"userSet": [
"collection/b",
{
"v": 1
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/b",
"version": 0,
"value": {
"v": 1
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 1
}
]
},
"Mutation recovers after primary takeover": {
"describeName": "Writes:",
"itName": "Mutation recovers after primary takeover",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"stateExpect": {
"isPrimary": true
},
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"k": "a"
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 0,
"value": {
"k": "a"
},
"options": {
"hasLocalMutations": true,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": true
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"applyClientState": {
"primary": true
},
"stateExpect": {
"isPrimary": true
},
"clientIndex": 1
},
{
"writeAck": {
"version": 1000
},
"clientIndex": 1
},
{
"watchAck": [
2
],
"clientIndex": 1
},
{
"watchEntity": {
"docs": [
{
"key": "collection/a",
"version": 1000,
"value": {
"k": "a"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"targets": [
2
]
},
"clientIndex": 1
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
],
"clientIndex": 1
},
{
"watchSnapshot": {
"version": 1000,
"targetIds": []
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"metadata": [
{
"key": "collection/a",
"version": 1000,
"value": {
"k": "a"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": false
}
}
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 0
}
]
},
"Write is sent by newly started primary": {
"describeName": "Writes:",
"itName": "Write is sent by newly started primary",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 3
},
"steps": [
{
"drainQueue": true,
"stateExpect": {
"isPrimary": true
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"isPrimary": false
},
"clientIndex": 1
},
{
"userSet": [
"collection/a",
{
"v": 1
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"shutdown": true,
"stateExpect": {
"activeTargets": {},
"limboDocs": []
},
"clientIndex": 0
},
{
"drainQueue": true,
"stateExpect": {
"isPrimary": true,
"numOutstandingWrites": 1
},
"clientIndex": 2
},
{
"writeAck": {
"version": 1000
},
"clientIndex": 2
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 1
}
]
},
"Unresponsive primary ignores acknowledged write": {
"describeName": "Writes:",
"itName": "Unresponsive primary ignores acknowledged write",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 3
},
"steps": [
{
"drainQueue": true,
"stateExpect": {
"isPrimary": true
},
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"k": "a"
}
],
"clientIndex": 0
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userSet": [
"collection/b",
{
"k": "b"
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 2
},
{
"applyClientState": {
"primary": true
},
"stateExpect": {
"isPrimary": true
},
"clientIndex": 2
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"writeAck": {
"version": 2000,
"keepInQueue": true
},
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 2
},
{
"writeAck": {
"version": 2000
},
"clientIndex": 2
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/b"
],
"rejectedDocs": []
}
},
"clientIndex": 1
}
]
},
"Unresponsive primary ignores rejected write": {
"describeName": "Writes:",
"itName": "Unresponsive primary ignores rejected write",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 3
},
"steps": [
{
"drainQueue": true,
"stateExpect": {
"isPrimary": true
},
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"k": "a"
}
],
"clientIndex": 0
},
{
"writeAck": {
"version": 1000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"userSet": [
"collection/b",
{
"k": "b"
}
],
"clientIndex": 1
},
{
"drainQueue": true,
"clientIndex": 2
},
{
"applyClientState": {
"primary": true
},
"stateExpect": {
"isPrimary": true
},
"clientIndex": 2
},
{
"drainQueue": true,
"clientIndex": 0
},
{
"failWrite": {
"error": {
"code": 9
},
"keepInQueue": true
},
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 2
},
{
"failWrite": {
"error": {
"code": 9
}
},
"clientIndex": 2
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [],
"rejectedDocs": [
"collection/b"
]
}
},
"clientIndex": 1
}
]
},
"Mutation are not sent twice after primary failover": {
"describeName": "Writes:",
"itName": "Mutation are not sent twice after primary failover",
"tags": [
"multi-client"
],
"config": {
"useGarbageCollection": false,
"numClients": 2
},
"steps": [
{
"drainQueue": true,
"stateExpect": {
"isPrimary": true
},
"clientIndex": 0
},
{
"userSet": [
"collection/a",
{
"k": "a"
}
],
"clientIndex": 0
},
{
"userSet": [
"collection/b",
{
"k": "b"
}
],
"clientIndex": 0
},
{
"drainQueue": true,
"clientIndex": 1
},
{
"applyClientState": {
"primary": true
},
"stateExpect": {
"isPrimary": true
},
"clientIndex": 1
},
{
"writeAck": {
"version": 1000
},
"clientIndex": 1
},
{
"drainQueue": true,
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/a"
],
"rejectedDocs": []
}
},
"clientIndex": 0
},
{
"applyClientState": {
"primary": true
},
"stateExpect": {
"isPrimary": true
},
"clientIndex": 0
},
{
"writeAck": {
"version": 2000
},
"stateExpect": {
"userCallbacks": {
"acknowledgedDocs": [
"collection/b"
],
"rejectedDocs": []
}
},
"clientIndex": 0
},
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
{
"key": "collection/a",
"version": 1000,
"value": {
"k": "a"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": true
}
},
{
"key": "collection/b",
"version": 2000,
"value": {
"k": "b"
},
"options": {
"hasLocalMutations": false,
"hasCommittedMutations": true
}
}
],
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
],
"clientIndex": 0
}
]
}
}