Files
firebase-ios-sdk/Firestore/Example/Tests/SpecTests/json/limbo_spec_test.json
T
Gil bde743ed25 Release 4.3.0 (#327)
Initial release of Firestore at 0.8.0
Bump FirebaseCommunity to 0.1.3
2017-10-03 08:55:22 -07:00

1151 lines
23 KiB
JSON

{
"Limbo documents are deleted without an existence filter": {
"describeName": "Limbo Documents:",
"itName": "Limbo documents are deleted without an existence filter",
"tags": [],
"config": {
"useGarbageCollection": true
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
],
"watchSnapshot": 1000,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"watchReset": [
2
]
},
{
"watchCurrent": [
[
2
],
"resume-token-1001"
],
"watchSnapshot": 1001,
"stateExpect": {
"limboDocs": [
"collection/a"
],
"activeTargets": {
"1": {
"query": {
"path": "collection/a",
"filters": [],
"orderBys": []
},
"resumeToken": ""
},
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
},
{
"watchAck": [
1
]
},
{
"watchCurrent": [
[
1
],
"resume-token-2"
],
"watchSnapshot": 1002,
"stateExpect": {
"limboDocs": [],
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Limbo documents are deleted with an existence filter": {
"describeName": "Limbo Documents:",
"itName": "Limbo documents are deleted with an existence filter",
"tags": [],
"config": {
"useGarbageCollection": true
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
],
"watchSnapshot": 1000,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"watchReset": [
2
]
},
{
"watchCurrent": [
[
2
],
"resume-token-1001"
],
"watchSnapshot": 1001,
"stateExpect": {
"limboDocs": [
"collection/a"
],
"activeTargets": {
"1": {
"query": {
"path": "collection/a",
"filters": [],
"orderBys": []
},
"resumeToken": ""
},
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
},
{
"watchAck": [
1
]
},
{
"watchFilter": [
[
1
]
]
},
{
"watchCurrent": [
[
1
],
"resume-token-1002"
],
"watchSnapshot": 1002,
"stateExpect": {
"limboDocs": [],
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Limbo documents are resolved with updates": {
"describeName": "Limbo Documents:",
"itName": "Limbo documents are resolved with updates",
"tags": [],
"config": {
"useGarbageCollection": true
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
],
"watchSnapshot": 1000,
"expect": [
{
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"added": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"watchReset": [
2
]
},
{
"watchCurrent": [
[
2
],
"resume-token-1001"
],
"watchSnapshot": 1001,
"stateExpect": {
"limboDocs": [
"collection/a"
],
"activeTargets": {
"1": {
"query": {
"path": "collection/a",
"filters": [],
"orderBys": []
},
"resumeToken": ""
},
"2": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
},
{
"watchAck": [
1
]
},
{
"watchEntity": {
"docs": [
[
"collection/a",
1000,
{
"key": "b"
}
]
],
"targets": [
1
]
}
},
{
"watchCurrent": [
[
1
],
"resume-token-1002"
],
"watchSnapshot": 1002,
"stateExpect": {
"limboDocs": [],
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"removed": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
},
"Limbo documents are resolved with updates in different snapshot than \"current\"": {
"describeName": "Limbo Documents:",
"itName": "Limbo documents are resolved with updates in different snapshot than \"current\"",
"tags": [],
"config": {
"useGarbageCollection": true
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1000"
],
"watchSnapshot": 1000,
"expect": [
{
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"added": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"userListen": [
4,
{
"path": "collection",
"filters": [
[
"key",
"==",
"b"
]
],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"resumeToken": ""
},
"4": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"b"
]
],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchReset": [
2
]
},
{
"watchCurrent": [
[
2
],
"resume-token-1001"
],
"watchSnapshot": 1001,
"stateExpect": {
"limboDocs": [
"collection/a"
],
"activeTargets": {
"1": {
"query": {
"path": "collection/a",
"filters": [],
"orderBys": []
},
"resumeToken": ""
},
"2": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"resumeToken": ""
},
"4": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"b"
]
],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
},
{
"watchAck": [
4
]
},
{
"watchAck": [
1
]
},
{
"watchEntity": {
"docs": [
[
"collection/a",
1000,
{
"key": "b"
}
]
],
"targets": [
1,
4
]
}
},
{
"watchCurrent": [
[
4
],
"resume-token-1002"
],
"watchSnapshot": 1002,
"stateExpect": {
"limboDocs": [],
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"resumeToken": ""
},
"4": {
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"b"
]
],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"a"
]
],
"orderBys": []
},
"removed": [
[
"collection/a",
1000,
{
"key": "a"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
},
{
"query": {
"path": "collection",
"filters": [
[
"key",
"==",
"b"
]
],
"orderBys": []
},
"added": [
[
"collection/a",
1000,
{
"key": "b"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"watchCurrent": [
[
1
],
"resume-token-1003"
],
"watchSnapshot": 1003
}
]
},
"Document remove message will cause docs to go in limbo": {
"describeName": "Limbo Documents:",
"itName": "Document remove message will cause docs to go in limbo",
"tags": [],
"config": {
"useGarbageCollection": true
},
"steps": [
{
"userListen": [
2,
{
"path": "collection",
"filters": [],
"orderBys": []
}
],
"stateExpect": {
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
}
},
{
"watchAck": [
2
]
},
{
"watchEntity": {
"docs": [
[
"collection/a",
1000,
{
"key": "a"
}
],
[
"collection/b",
1001,
{
"key": "b"
}
]
],
"targets": [
2
]
}
},
{
"watchCurrent": [
[
2
],
"resume-token-1002"
],
"watchSnapshot": 1002,
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"added": [
[
"collection/a",
1000,
{
"key": "a"
}
],
[
"collection/b",
1001,
{
"key": "b"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
},
{
"watchEntity": {
"key": "collection/b",
"removedTargets": [
2
]
},
"watchSnapshot": 1003,
"stateExpect": {
"limboDocs": [
"collection/b"
],
"activeTargets": {
"1": {
"query": {
"path": "collection/b",
"filters": [],
"orderBys": []
},
"resumeToken": ""
},
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"errorCode": 0,
"fromCache": true,
"hasPendingWrites": false
}
]
},
{
"watchAck": [
1
]
},
{
"watchCurrent": [
[
1
],
"resume-token-1004"
],
"watchSnapshot": 1004,
"stateExpect": {
"limboDocs": [],
"activeTargets": {
"2": {
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"resumeToken": ""
}
}
},
"expect": [
{
"query": {
"path": "collection",
"filters": [],
"orderBys": []
},
"removed": [
[
"collection/b",
1001,
{
"key": "b"
}
]
],
"errorCode": 0,
"fromCache": false,
"hasPendingWrites": false
}
]
}
]
}
}