bundle_spec_test.json 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846
  1. {
  2. "Bundles query can be loaded and resumed from different tabs": {
  3. "describeName": "Bundles:",
  4. "itName": "Bundles query can be loaded and resumed from different tabs",
  5. "tags": [
  6. "multi-client",
  7. "no-ios"
  8. ],
  9. "config": {
  10. "numClients": 2,
  11. "useGarbageCollection": false
  12. },
  13. "steps": [
  14. {
  15. "clientIndex": 0,
  16. "drainQueue": true
  17. },
  18. {
  19. "clientIndex": 0,
  20. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000500000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":675}}293{\"namedQuery\":{\"name\":\"bundled-query\",\"readTime\":\"1970-01-01T00:00:00.000400000Z\",\"bundledQuery\":{\"parent\":\"projects/test-project/databases/(default)/documents\",\"structuredQuery\":{\"from\":[{\"collectionId\":\"collection\"}],\"orderBy\":[{\"field\":{\"fieldPath\":\"__name__\"},\"direction\":\"ASCENDING\"}]}}}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000500000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.000500000Z\",\"fields\":{\"value\":{\"stringValue\":\"b\"}}}}"
  21. },
  22. {
  23. "clientIndex": 1,
  24. "drainQueue": true
  25. },
  26. {
  27. "clientIndex": 1,
  28. "userListen": {
  29. "query": {
  30. "filters": [
  31. ],
  32. "orderBys": [
  33. ],
  34. "path": "collection"
  35. },
  36. "targetId": 4
  37. },
  38. "expectedSnapshotEvents": [
  39. {
  40. "added": [
  41. {
  42. "key": "collection/a",
  43. "options": {
  44. "hasCommittedMutations": false,
  45. "hasLocalMutations": false
  46. },
  47. "value": {
  48. "value": "b"
  49. },
  50. "version": 500
  51. }
  52. ],
  53. "errorCode": 0,
  54. "fromCache": true,
  55. "hasPendingWrites": false,
  56. "query": {
  57. "filters": [
  58. ],
  59. "orderBys": [
  60. ],
  61. "path": "collection"
  62. }
  63. }
  64. ],
  65. "expectedState": {
  66. "activeTargets": {
  67. "4": {
  68. "queries": [
  69. {
  70. "filters": [
  71. ],
  72. "orderBys": [
  73. ],
  74. "path": "collection"
  75. }
  76. ],
  77. "readTime": 400,
  78. "resumeToken": ""
  79. }
  80. }
  81. }
  82. },
  83. {
  84. "clientIndex": 1,
  85. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000600000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":772}}390{\"namedQuery\":{\"name\":\"bundled-query\",\"readTime\":\"1970-01-01T00:00:00.000560000Z\",\"bundledQuery\":{\"parent\":\"projects/test-project/databases/(default)/documents\",\"structuredQuery\":{\"from\":[{\"collectionId\":\"collection\"}],\"where\":{\"fieldFilter\":{\"field\":{\"fieldPath\":\"value\"},\"op\":\"EQUAL\",\"value\":{\"stringValue\":\"c\"}}},\"orderBy\":[{\"field\":{\"fieldPath\":\"__name__\"},\"direction\":\"ASCENDING\"}]}}}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000600000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.000550000Z\",\"fields\":{\"value\":{\"stringValue\":\"c\"}}}}",
  86. "expectedSnapshotEvents": [
  87. {
  88. "errorCode": 0,
  89. "fromCache": true,
  90. "hasPendingWrites": false,
  91. "modified": [
  92. {
  93. "key": "collection/a",
  94. "options": {
  95. "hasCommittedMutations": false,
  96. "hasLocalMutations": false
  97. },
  98. "value": {
  99. "value": "c"
  100. },
  101. "version": 550
  102. }
  103. ],
  104. "query": {
  105. "filters": [
  106. ],
  107. "orderBys": [
  108. ],
  109. "path": "collection"
  110. }
  111. }
  112. ]
  113. },
  114. {
  115. "clientIndex": 0,
  116. "drainQueue": true,
  117. "expectedState": {
  118. "activeTargets": {
  119. "4": {
  120. "queries": [
  121. {
  122. "filters": [
  123. ],
  124. "orderBys": [
  125. ],
  126. "path": "collection"
  127. }
  128. ],
  129. "readTime": 400,
  130. "resumeToken": ""
  131. }
  132. }
  133. }
  134. },
  135. {
  136. "clientIndex": 0,
  137. "userListen": {
  138. "query": {
  139. "filters": [
  140. [
  141. "value",
  142. "==",
  143. "c"
  144. ]
  145. ],
  146. "orderBys": [
  147. ],
  148. "path": "collection"
  149. },
  150. "targetId": 6
  151. },
  152. "expectedSnapshotEvents": [
  153. {
  154. "added": [
  155. {
  156. "key": "collection/a",
  157. "options": {
  158. "hasCommittedMutations": false,
  159. "hasLocalMutations": false
  160. },
  161. "value": {
  162. "value": "c"
  163. },
  164. "version": 550
  165. }
  166. ],
  167. "errorCode": 0,
  168. "fromCache": true,
  169. "hasPendingWrites": false,
  170. "query": {
  171. "filters": [
  172. [
  173. "value",
  174. "==",
  175. "c"
  176. ]
  177. ],
  178. "orderBys": [
  179. ],
  180. "path": "collection"
  181. }
  182. }
  183. ],
  184. "expectedState": {
  185. "activeTargets": {
  186. "4": {
  187. "queries": [
  188. {
  189. "filters": [
  190. ],
  191. "orderBys": [
  192. ],
  193. "path": "collection"
  194. }
  195. ],
  196. "readTime": 400,
  197. "resumeToken": ""
  198. },
  199. "6": {
  200. "queries": [
  201. {
  202. "filters": [
  203. [
  204. "value",
  205. "==",
  206. "c"
  207. ]
  208. ],
  209. "orderBys": [
  210. ],
  211. "path": "collection"
  212. }
  213. ],
  214. "readTime": 560,
  215. "resumeToken": ""
  216. }
  217. }
  218. }
  219. }
  220. ]
  221. },
  222. "Bundles query can be resumed from same query.": {
  223. "describeName": "Bundles:",
  224. "itName": "Bundles query can be resumed from same query.",
  225. "tags": [
  226. "no-ios"
  227. ],
  228. "config": {
  229. "numClients": 1,
  230. "useGarbageCollection": true
  231. },
  232. "steps": [
  233. {
  234. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000500000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":675}}293{\"namedQuery\":{\"name\":\"bundled-query\",\"readTime\":\"1970-01-01T00:00:00.000400000Z\",\"bundledQuery\":{\"parent\":\"projects/test-project/databases/(default)/documents\",\"structuredQuery\":{\"from\":[{\"collectionId\":\"collection\"}],\"orderBy\":[{\"field\":{\"fieldPath\":\"__name__\"},\"direction\":\"ASCENDING\"}]}}}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000500000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.000500000Z\",\"fields\":{\"value\":{\"stringValue\":\"b\"}}}}"
  235. },
  236. {
  237. "userListen": {
  238. "query": {
  239. "filters": [
  240. ],
  241. "orderBys": [
  242. ],
  243. "path": "collection"
  244. },
  245. "targetId": 4
  246. },
  247. "expectedSnapshotEvents": [
  248. {
  249. "added": [
  250. {
  251. "key": "collection/a",
  252. "options": {
  253. "hasCommittedMutations": false,
  254. "hasLocalMutations": false
  255. },
  256. "value": {
  257. "value": "b"
  258. },
  259. "version": 500
  260. }
  261. ],
  262. "errorCode": 0,
  263. "fromCache": true,
  264. "hasPendingWrites": false,
  265. "query": {
  266. "filters": [
  267. ],
  268. "orderBys": [
  269. ],
  270. "path": "collection"
  271. }
  272. }
  273. ],
  274. "expectedState": {
  275. "activeTargets": {
  276. "4": {
  277. "queries": [
  278. {
  279. "filters": [
  280. ],
  281. "orderBys": [
  282. ],
  283. "path": "collection"
  284. }
  285. ],
  286. "readTime": 400,
  287. "resumeToken": ""
  288. }
  289. }
  290. }
  291. }
  292. ]
  293. },
  294. "Load and observe from same secondary client": {
  295. "describeName": "Bundles:",
  296. "itName": "Load and observe from same secondary client",
  297. "tags": [
  298. "multi-client",
  299. "no-ios"
  300. ],
  301. "config": {
  302. "numClients": 2,
  303. "useGarbageCollection": false
  304. },
  305. "steps": [
  306. {
  307. "clientIndex": 0,
  308. "drainQueue": true
  309. },
  310. {
  311. "clientIndex": 0,
  312. "userListen": {
  313. "query": {
  314. "filters": [
  315. ],
  316. "orderBys": [
  317. ],
  318. "path": "collection"
  319. },
  320. "targetId": 2
  321. },
  322. "expectedState": {
  323. "activeTargets": {
  324. "2": {
  325. "queries": [
  326. {
  327. "filters": [
  328. ],
  329. "orderBys": [
  330. ],
  331. "path": "collection"
  332. }
  333. ],
  334. "resumeToken": ""
  335. }
  336. }
  337. }
  338. },
  339. {
  340. "clientIndex": 0,
  341. "watchAck": [
  342. 2
  343. ]
  344. },
  345. {
  346. "clientIndex": 0,
  347. "watchEntity": {
  348. "docs": [
  349. {
  350. "key": "collection/a",
  351. "options": {
  352. "hasCommittedMutations": false,
  353. "hasLocalMutations": false
  354. },
  355. "value": {
  356. "value": "a"
  357. },
  358. "version": 250
  359. }
  360. ],
  361. "targets": [
  362. 2
  363. ]
  364. }
  365. },
  366. {
  367. "clientIndex": 0,
  368. "watchCurrent": [
  369. [
  370. 2
  371. ],
  372. "resume-token-250"
  373. ]
  374. },
  375. {
  376. "clientIndex": 0,
  377. "watchSnapshot": {
  378. "targetIds": [
  379. ],
  380. "version": 250
  381. },
  382. "expectedSnapshotEvents": [
  383. {
  384. "added": [
  385. {
  386. "key": "collection/a",
  387. "options": {
  388. "hasCommittedMutations": false,
  389. "hasLocalMutations": false
  390. },
  391. "value": {
  392. "value": "a"
  393. },
  394. "version": 250
  395. }
  396. ],
  397. "errorCode": 0,
  398. "fromCache": false,
  399. "hasPendingWrites": false,
  400. "query": {
  401. "filters": [
  402. ],
  403. "orderBys": [
  404. ],
  405. "path": "collection"
  406. }
  407. }
  408. ]
  409. },
  410. {
  411. "clientIndex": 1,
  412. "drainQueue": true
  413. },
  414. {
  415. "clientIndex": 1,
  416. "userListen": {
  417. "query": {
  418. "filters": [
  419. ],
  420. "orderBys": [
  421. ],
  422. "path": "collection"
  423. },
  424. "targetId": 2
  425. },
  426. "expectedSnapshotEvents": [
  427. {
  428. "added": [
  429. {
  430. "key": "collection/a",
  431. "options": {
  432. "hasCommittedMutations": false,
  433. "hasLocalMutations": false
  434. },
  435. "value": {
  436. "value": "a"
  437. },
  438. "version": 250
  439. }
  440. ],
  441. "errorCode": 0,
  442. "fromCache": false,
  443. "hasPendingWrites": false,
  444. "query": {
  445. "filters": [
  446. ],
  447. "orderBys": [
  448. ],
  449. "path": "collection"
  450. }
  451. }
  452. ],
  453. "expectedState": {
  454. "activeTargets": {
  455. "2": {
  456. "queries": [
  457. {
  458. "filters": [
  459. ],
  460. "orderBys": [
  461. ],
  462. "path": "collection"
  463. }
  464. ],
  465. "resumeToken": ""
  466. }
  467. }
  468. }
  469. },
  470. {
  471. "clientIndex": 1,
  472. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000500000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":379}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000500000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.000500000Z\",\"fields\":{\"value\":{\"stringValue\":\"b\"}}}}",
  473. "expectedSnapshotEvents": [
  474. {
  475. "errorCode": 0,
  476. "fromCache": false,
  477. "hasPendingWrites": false,
  478. "modified": [
  479. {
  480. "key": "collection/a",
  481. "options": {
  482. "hasCommittedMutations": false,
  483. "hasLocalMutations": false
  484. },
  485. "value": {
  486. "value": "b"
  487. },
  488. "version": 500
  489. }
  490. ],
  491. "query": {
  492. "filters": [
  493. ],
  494. "orderBys": [
  495. ],
  496. "path": "collection"
  497. }
  498. }
  499. ]
  500. }
  501. ]
  502. },
  503. "Load from primary client and observe from secondary": {
  504. "describeName": "Bundles:",
  505. "itName": "Load from primary client and observe from secondary",
  506. "tags": [
  507. "multi-client",
  508. "no-ios"
  509. ],
  510. "config": {
  511. "numClients": 2,
  512. "useGarbageCollection": false
  513. },
  514. "steps": [
  515. {
  516. "clientIndex": 0,
  517. "drainQueue": true
  518. },
  519. {
  520. "clientIndex": 0,
  521. "userListen": {
  522. "query": {
  523. "filters": [
  524. ],
  525. "orderBys": [
  526. ],
  527. "path": "collection"
  528. },
  529. "targetId": 2
  530. },
  531. "expectedState": {
  532. "activeTargets": {
  533. "2": {
  534. "queries": [
  535. {
  536. "filters": [
  537. ],
  538. "orderBys": [
  539. ],
  540. "path": "collection"
  541. }
  542. ],
  543. "resumeToken": ""
  544. }
  545. }
  546. }
  547. },
  548. {
  549. "clientIndex": 0,
  550. "watchAck": [
  551. 2
  552. ]
  553. },
  554. {
  555. "clientIndex": 0,
  556. "watchEntity": {
  557. "docs": [
  558. {
  559. "key": "collection/a",
  560. "options": {
  561. "hasCommittedMutations": false,
  562. "hasLocalMutations": false
  563. },
  564. "value": {
  565. "value": "a"
  566. },
  567. "version": 250
  568. }
  569. ],
  570. "targets": [
  571. 2
  572. ]
  573. }
  574. },
  575. {
  576. "clientIndex": 0,
  577. "watchCurrent": [
  578. [
  579. 2
  580. ],
  581. "resume-token-250"
  582. ]
  583. },
  584. {
  585. "clientIndex": 0,
  586. "watchSnapshot": {
  587. "targetIds": [
  588. ],
  589. "version": 250
  590. },
  591. "expectedSnapshotEvents": [
  592. {
  593. "added": [
  594. {
  595. "key": "collection/a",
  596. "options": {
  597. "hasCommittedMutations": false,
  598. "hasLocalMutations": false
  599. },
  600. "value": {
  601. "value": "a"
  602. },
  603. "version": 250
  604. }
  605. ],
  606. "errorCode": 0,
  607. "fromCache": false,
  608. "hasPendingWrites": false,
  609. "query": {
  610. "filters": [
  611. ],
  612. "orderBys": [
  613. ],
  614. "path": "collection"
  615. }
  616. }
  617. ]
  618. },
  619. {
  620. "clientIndex": 1,
  621. "drainQueue": true
  622. },
  623. {
  624. "clientIndex": 1,
  625. "userListen": {
  626. "query": {
  627. "filters": [
  628. ],
  629. "orderBys": [
  630. ],
  631. "path": "collection"
  632. },
  633. "targetId": 2
  634. },
  635. "expectedSnapshotEvents": [
  636. {
  637. "added": [
  638. {
  639. "key": "collection/a",
  640. "options": {
  641. "hasCommittedMutations": false,
  642. "hasLocalMutations": false
  643. },
  644. "value": {
  645. "value": "a"
  646. },
  647. "version": 250
  648. }
  649. ],
  650. "errorCode": 0,
  651. "fromCache": false,
  652. "hasPendingWrites": false,
  653. "query": {
  654. "filters": [
  655. ],
  656. "orderBys": [
  657. ],
  658. "path": "collection"
  659. }
  660. }
  661. ],
  662. "expectedState": {
  663. "activeTargets": {
  664. "2": {
  665. "queries": [
  666. {
  667. "filters": [
  668. ],
  669. "orderBys": [
  670. ],
  671. "path": "collection"
  672. }
  673. ],
  674. "resumeToken": ""
  675. }
  676. }
  677. }
  678. },
  679. {
  680. "clientIndex": 0,
  681. "drainQueue": true
  682. },
  683. {
  684. "clientIndex": 0,
  685. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000500000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":379}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000500000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.000500000Z\",\"fields\":{\"value\":{\"stringValue\":\"b\"}}}}",
  686. "expectedSnapshotEvents": [
  687. {
  688. "errorCode": 0,
  689. "fromCache": false,
  690. "hasPendingWrites": false,
  691. "modified": [
  692. {
  693. "key": "collection/a",
  694. "options": {
  695. "hasCommittedMutations": false,
  696. "hasLocalMutations": false
  697. },
  698. "value": {
  699. "value": "b"
  700. },
  701. "version": 500
  702. }
  703. ],
  704. "query": {
  705. "filters": [
  706. ],
  707. "orderBys": [
  708. ],
  709. "path": "collection"
  710. }
  711. }
  712. ]
  713. },
  714. {
  715. "clientIndex": 1,
  716. "drainQueue": true,
  717. "expectedSnapshotEvents": [
  718. {
  719. "errorCode": 0,
  720. "fromCache": false,
  721. "hasPendingWrites": false,
  722. "modified": [
  723. {
  724. "key": "collection/a",
  725. "options": {
  726. "hasCommittedMutations": false,
  727. "hasLocalMutations": false
  728. },
  729. "value": {
  730. "value": "b"
  731. },
  732. "version": 500
  733. }
  734. ],
  735. "query": {
  736. "filters": [
  737. ],
  738. "orderBys": [
  739. ],
  740. "path": "collection"
  741. }
  742. }
  743. ]
  744. }
  745. ]
  746. },
  747. "Load from secondary clients and observe from primary": {
  748. "describeName": "Bundles:",
  749. "itName": "Load from secondary clients and observe from primary",
  750. "tags": [
  751. "multi-client",
  752. "no-ios"
  753. ],
  754. "config": {
  755. "numClients": 2,
  756. "useGarbageCollection": false
  757. },
  758. "steps": [
  759. {
  760. "clientIndex": 0,
  761. "drainQueue": true
  762. },
  763. {
  764. "clientIndex": 0,
  765. "userListen": {
  766. "query": {
  767. "filters": [
  768. ],
  769. "orderBys": [
  770. ],
  771. "path": "collection"
  772. },
  773. "targetId": 2
  774. },
  775. "expectedState": {
  776. "activeTargets": {
  777. "2": {
  778. "queries": [
  779. {
  780. "filters": [
  781. ],
  782. "orderBys": [
  783. ],
  784. "path": "collection"
  785. }
  786. ],
  787. "resumeToken": ""
  788. }
  789. }
  790. }
  791. },
  792. {
  793. "clientIndex": 0,
  794. "watchAck": [
  795. 2
  796. ]
  797. },
  798. {
  799. "clientIndex": 0,
  800. "watchEntity": {
  801. "docs": [
  802. {
  803. "key": "collection/a",
  804. "options": {
  805. "hasCommittedMutations": false,
  806. "hasLocalMutations": false
  807. },
  808. "value": {
  809. "value": "a"
  810. },
  811. "version": 250
  812. }
  813. ],
  814. "targets": [
  815. 2
  816. ]
  817. }
  818. },
  819. {
  820. "clientIndex": 0,
  821. "watchCurrent": [
  822. [
  823. 2
  824. ],
  825. "resume-token-250"
  826. ]
  827. },
  828. {
  829. "clientIndex": 0,
  830. "watchSnapshot": {
  831. "targetIds": [
  832. ],
  833. "version": 250
  834. },
  835. "expectedSnapshotEvents": [
  836. {
  837. "added": [
  838. {
  839. "key": "collection/a",
  840. "options": {
  841. "hasCommittedMutations": false,
  842. "hasLocalMutations": false
  843. },
  844. "value": {
  845. "value": "a"
  846. },
  847. "version": 250
  848. }
  849. ],
  850. "errorCode": 0,
  851. "fromCache": false,
  852. "hasPendingWrites": false,
  853. "query": {
  854. "filters": [
  855. ],
  856. "orderBys": [
  857. ],
  858. "path": "collection"
  859. }
  860. }
  861. ]
  862. },
  863. {
  864. "clientIndex": 1,
  865. "drainQueue": true
  866. },
  867. {
  868. "clientIndex": 1,
  869. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000500000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":379}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000500000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.000500000Z\",\"fields\":{\"value\":{\"stringValue\":\"b\"}}}}"
  870. },
  871. {
  872. "clientIndex": 0,
  873. "drainQueue": true,
  874. "expectedSnapshotEvents": [
  875. {
  876. "errorCode": 0,
  877. "fromCache": false,
  878. "hasPendingWrites": false,
  879. "modified": [
  880. {
  881. "key": "collection/a",
  882. "options": {
  883. "hasCommittedMutations": false,
  884. "hasLocalMutations": false
  885. },
  886. "value": {
  887. "value": "b"
  888. },
  889. "version": 500
  890. }
  891. ],
  892. "query": {
  893. "filters": [
  894. ],
  895. "orderBys": [
  896. ],
  897. "path": "collection"
  898. }
  899. }
  900. ]
  901. }
  902. ]
  903. },
  904. "Newer deleted docs from bundles should delete cached docs": {
  905. "describeName": "Bundles:",
  906. "itName": "Newer deleted docs from bundles should delete cached docs",
  907. "tags": [
  908. "no-ios"
  909. ],
  910. "config": {
  911. "numClients": 1,
  912. "useGarbageCollection": true
  913. },
  914. "steps": [
  915. {
  916. "userListen": {
  917. "query": {
  918. "filters": [
  919. ],
  920. "orderBys": [
  921. ],
  922. "path": "collection"
  923. },
  924. "targetId": 2
  925. },
  926. "expectedState": {
  927. "activeTargets": {
  928. "2": {
  929. "queries": [
  930. {
  931. "filters": [
  932. ],
  933. "orderBys": [
  934. ],
  935. "path": "collection"
  936. }
  937. ],
  938. "resumeToken": ""
  939. }
  940. }
  941. }
  942. },
  943. {
  944. "watchAck": [
  945. 2
  946. ]
  947. },
  948. {
  949. "watchEntity": {
  950. "docs": [
  951. {
  952. "key": "collection/a",
  953. "options": {
  954. "hasCommittedMutations": false,
  955. "hasLocalMutations": false
  956. },
  957. "value": {
  958. "value": "a"
  959. },
  960. "version": 1000
  961. }
  962. ],
  963. "targets": [
  964. 2
  965. ]
  966. }
  967. },
  968. {
  969. "watchCurrent": [
  970. [
  971. 2
  972. ],
  973. "resume-token-1000"
  974. ]
  975. },
  976. {
  977. "watchSnapshot": {
  978. "targetIds": [
  979. ],
  980. "version": 1000
  981. },
  982. "expectedSnapshotEvents": [
  983. {
  984. "added": [
  985. {
  986. "key": "collection/a",
  987. "options": {
  988. "hasCommittedMutations": false,
  989. "hasLocalMutations": false
  990. },
  991. "value": {
  992. "value": "a"
  993. },
  994. "version": 1000
  995. }
  996. ],
  997. "errorCode": 0,
  998. "fromCache": false,
  999. "hasPendingWrites": false,
  1000. "query": {
  1001. "filters": [
  1002. ],
  1003. "orderBys": [
  1004. ],
  1005. "path": "collection"
  1006. }
  1007. }
  1008. ]
  1009. },
  1010. {
  1011. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.003000000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":158}}155{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.003000000Z\",\"exists\":false}}",
  1012. "expectedSnapshotEvents": [
  1013. {
  1014. "errorCode": 0,
  1015. "fromCache": false,
  1016. "hasPendingWrites": false,
  1017. "query": {
  1018. "filters": [
  1019. ],
  1020. "orderBys": [
  1021. ],
  1022. "path": "collection"
  1023. },
  1024. "removed": [
  1025. {
  1026. "key": "collection/a",
  1027. "options": {
  1028. "hasCommittedMutations": false,
  1029. "hasLocalMutations": false
  1030. },
  1031. "value": {
  1032. "value": "a"
  1033. },
  1034. "version": 1000
  1035. }
  1036. ]
  1037. }
  1038. ]
  1039. }
  1040. ]
  1041. },
  1042. "Newer docs from bundles might lead to limbo doc": {
  1043. "describeName": "Bundles:",
  1044. "itName": "Newer docs from bundles might lead to limbo doc",
  1045. "tags": [
  1046. "no-ios"
  1047. ],
  1048. "config": {
  1049. "numClients": 1,
  1050. "useGarbageCollection": false
  1051. },
  1052. "steps": [
  1053. {
  1054. "userListen": {
  1055. "query": {
  1056. "filters": [
  1057. ],
  1058. "orderBys": [
  1059. ],
  1060. "path": "collection"
  1061. },
  1062. "targetId": 2
  1063. },
  1064. "expectedState": {
  1065. "activeTargets": {
  1066. "2": {
  1067. "queries": [
  1068. {
  1069. "filters": [
  1070. ],
  1071. "orderBys": [
  1072. ],
  1073. "path": "collection"
  1074. }
  1075. ],
  1076. "resumeToken": ""
  1077. }
  1078. }
  1079. }
  1080. },
  1081. {
  1082. "watchAck": [
  1083. 2
  1084. ]
  1085. },
  1086. {
  1087. "watchEntity": {
  1088. "docs": [
  1089. ],
  1090. "targets": [
  1091. 2
  1092. ]
  1093. }
  1094. },
  1095. {
  1096. "watchCurrent": [
  1097. [
  1098. 2
  1099. ],
  1100. "resume-token-250"
  1101. ]
  1102. },
  1103. {
  1104. "watchSnapshot": {
  1105. "targetIds": [
  1106. ],
  1107. "version": 250
  1108. },
  1109. "expectedSnapshotEvents": [
  1110. {
  1111. "errorCode": 0,
  1112. "fromCache": false,
  1113. "hasPendingWrites": false,
  1114. "query": {
  1115. "filters": [
  1116. ],
  1117. "orderBys": [
  1118. ],
  1119. "path": "collection"
  1120. }
  1121. }
  1122. ]
  1123. },
  1124. {
  1125. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000500000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":379}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000500000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.000500000Z\",\"fields\":{\"value\":{\"stringValue\":\"b\"}}}}",
  1126. "expectedSnapshotEvents": [
  1127. {
  1128. "added": [
  1129. {
  1130. "key": "collection/a",
  1131. "options": {
  1132. "hasCommittedMutations": false,
  1133. "hasLocalMutations": false
  1134. },
  1135. "value": {
  1136. "value": "b"
  1137. },
  1138. "version": 500
  1139. }
  1140. ],
  1141. "errorCode": 0,
  1142. "fromCache": true,
  1143. "hasPendingWrites": false,
  1144. "query": {
  1145. "filters": [
  1146. ],
  1147. "orderBys": [
  1148. ],
  1149. "path": "collection"
  1150. }
  1151. }
  1152. ],
  1153. "expectedState": {
  1154. "activeLimboDocs": [
  1155. "collection/a"
  1156. ],
  1157. "activeTargets": {
  1158. "1": {
  1159. "queries": [
  1160. {
  1161. "filters": [
  1162. ],
  1163. "orderBys": [
  1164. ],
  1165. "path": "collection/a"
  1166. }
  1167. ],
  1168. "resumeToken": ""
  1169. },
  1170. "2": {
  1171. "queries": [
  1172. {
  1173. "filters": [
  1174. ],
  1175. "orderBys": [
  1176. ],
  1177. "path": "collection"
  1178. }
  1179. ],
  1180. "resumeToken": ""
  1181. }
  1182. }
  1183. }
  1184. },
  1185. {
  1186. "watchAck": [
  1187. 1
  1188. ]
  1189. },
  1190. {
  1191. "watchEntity": {
  1192. "docs": [
  1193. ],
  1194. "targets": [
  1195. 1
  1196. ]
  1197. }
  1198. },
  1199. {
  1200. "watchCurrent": [
  1201. [
  1202. 1
  1203. ],
  1204. "resume-token-1002"
  1205. ]
  1206. },
  1207. {
  1208. "watchSnapshot": {
  1209. "targetIds": [
  1210. ],
  1211. "version": 1002
  1212. },
  1213. "expectedSnapshotEvents": [
  1214. {
  1215. "errorCode": 0,
  1216. "fromCache": false,
  1217. "hasPendingWrites": false,
  1218. "query": {
  1219. "filters": [
  1220. ],
  1221. "orderBys": [
  1222. ],
  1223. "path": "collection"
  1224. },
  1225. "removed": [
  1226. {
  1227. "key": "collection/a",
  1228. "options": {
  1229. "hasCommittedMutations": false,
  1230. "hasLocalMutations": false
  1231. },
  1232. "value": {
  1233. "value": "b"
  1234. },
  1235. "version": 500
  1236. }
  1237. ]
  1238. }
  1239. ],
  1240. "expectedState": {
  1241. "activeLimboDocs": [
  1242. ],
  1243. "activeTargets": {
  1244. "2": {
  1245. "queries": [
  1246. {
  1247. "filters": [
  1248. ],
  1249. "orderBys": [
  1250. ],
  1251. "path": "collection"
  1252. }
  1253. ],
  1254. "resumeToken": ""
  1255. }
  1256. }
  1257. }
  1258. }
  1259. ]
  1260. },
  1261. "Newer docs from bundles should keep not raise snapshot if there are unacknowledged writes": {
  1262. "describeName": "Bundles:",
  1263. "itName": "Newer docs from bundles should keep not raise snapshot if there are unacknowledged writes",
  1264. "tags": [
  1265. "no-ios"
  1266. ],
  1267. "config": {
  1268. "numClients": 1,
  1269. "useGarbageCollection": false
  1270. },
  1271. "steps": [
  1272. {
  1273. "userListen": {
  1274. "query": {
  1275. "filters": [
  1276. ],
  1277. "orderBys": [
  1278. ],
  1279. "path": "collection"
  1280. },
  1281. "targetId": 2
  1282. },
  1283. "expectedState": {
  1284. "activeTargets": {
  1285. "2": {
  1286. "queries": [
  1287. {
  1288. "filters": [
  1289. ],
  1290. "orderBys": [
  1291. ],
  1292. "path": "collection"
  1293. }
  1294. ],
  1295. "resumeToken": ""
  1296. }
  1297. }
  1298. }
  1299. },
  1300. {
  1301. "watchAck": [
  1302. 2
  1303. ]
  1304. },
  1305. {
  1306. "watchEntity": {
  1307. "docs": [
  1308. {
  1309. "key": "collection/a",
  1310. "options": {
  1311. "hasCommittedMutations": false,
  1312. "hasLocalMutations": false
  1313. },
  1314. "value": {
  1315. "value": "a"
  1316. },
  1317. "version": 250
  1318. }
  1319. ],
  1320. "targets": [
  1321. 2
  1322. ]
  1323. }
  1324. },
  1325. {
  1326. "watchCurrent": [
  1327. [
  1328. 2
  1329. ],
  1330. "resume-token-250"
  1331. ]
  1332. },
  1333. {
  1334. "watchSnapshot": {
  1335. "targetIds": [
  1336. ],
  1337. "version": 250
  1338. },
  1339. "expectedSnapshotEvents": [
  1340. {
  1341. "added": [
  1342. {
  1343. "key": "collection/a",
  1344. "options": {
  1345. "hasCommittedMutations": false,
  1346. "hasLocalMutations": false
  1347. },
  1348. "value": {
  1349. "value": "a"
  1350. },
  1351. "version": 250
  1352. }
  1353. ],
  1354. "errorCode": 0,
  1355. "fromCache": false,
  1356. "hasPendingWrites": false,
  1357. "query": {
  1358. "filters": [
  1359. ],
  1360. "orderBys": [
  1361. ],
  1362. "path": "collection"
  1363. }
  1364. }
  1365. ]
  1366. },
  1367. {
  1368. "userPatch": [
  1369. "collection/a",
  1370. {
  1371. "value": "patched"
  1372. }
  1373. ],
  1374. "expectedSnapshotEvents": [
  1375. {
  1376. "errorCode": 0,
  1377. "fromCache": false,
  1378. "hasPendingWrites": true,
  1379. "modified": [
  1380. {
  1381. "key": "collection/a",
  1382. "options": {
  1383. "hasCommittedMutations": false,
  1384. "hasLocalMutations": true
  1385. },
  1386. "value": {
  1387. "value": "patched"
  1388. },
  1389. "version": 0
  1390. }
  1391. ],
  1392. "query": {
  1393. "filters": [
  1394. ],
  1395. "orderBys": [
  1396. ],
  1397. "path": "collection"
  1398. }
  1399. }
  1400. ]
  1401. },
  1402. {
  1403. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.001001000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":388}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.001001000Z\",\"exists\":true}}228{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.001001000Z\",\"fields\":{\"value\":{\"stringValue\":\"fromBundle\"}}}}"
  1404. }
  1405. ]
  1406. },
  1407. "Newer docs from bundles should overwrite cache": {
  1408. "describeName": "Bundles:",
  1409. "itName": "Newer docs from bundles should overwrite cache",
  1410. "tags": [
  1411. "no-ios"
  1412. ],
  1413. "config": {
  1414. "numClients": 1,
  1415. "useGarbageCollection": true
  1416. },
  1417. "steps": [
  1418. {
  1419. "userListen": {
  1420. "query": {
  1421. "filters": [
  1422. ],
  1423. "orderBys": [
  1424. ],
  1425. "path": "collection"
  1426. },
  1427. "targetId": 2
  1428. },
  1429. "expectedState": {
  1430. "activeTargets": {
  1431. "2": {
  1432. "queries": [
  1433. {
  1434. "filters": [
  1435. ],
  1436. "orderBys": [
  1437. ],
  1438. "path": "collection"
  1439. }
  1440. ],
  1441. "resumeToken": ""
  1442. }
  1443. }
  1444. }
  1445. },
  1446. {
  1447. "watchAck": [
  1448. 2
  1449. ]
  1450. },
  1451. {
  1452. "watchEntity": {
  1453. "docs": [
  1454. {
  1455. "key": "collection/a",
  1456. "options": {
  1457. "hasCommittedMutations": false,
  1458. "hasLocalMutations": false
  1459. },
  1460. "value": {
  1461. "value": "a"
  1462. },
  1463. "version": 1000
  1464. }
  1465. ],
  1466. "targets": [
  1467. 2
  1468. ]
  1469. }
  1470. },
  1471. {
  1472. "watchCurrent": [
  1473. [
  1474. 2
  1475. ],
  1476. "resume-token-1000"
  1477. ]
  1478. },
  1479. {
  1480. "watchSnapshot": {
  1481. "targetIds": [
  1482. ],
  1483. "version": 1000
  1484. },
  1485. "expectedSnapshotEvents": [
  1486. {
  1487. "added": [
  1488. {
  1489. "key": "collection/a",
  1490. "options": {
  1491. "hasCommittedMutations": false,
  1492. "hasLocalMutations": false
  1493. },
  1494. "value": {
  1495. "value": "a"
  1496. },
  1497. "version": 1000
  1498. }
  1499. ],
  1500. "errorCode": 0,
  1501. "fromCache": false,
  1502. "hasPendingWrites": false,
  1503. "query": {
  1504. "filters": [
  1505. ],
  1506. "orderBys": [
  1507. ],
  1508. "path": "collection"
  1509. }
  1510. }
  1511. ]
  1512. },
  1513. {
  1514. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.003000000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":379}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.003000000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.001999000Z\",\"updateTime\":\"1970-01-01T00:00:00.002999000Z\",\"fields\":{\"value\":{\"stringValue\":\"b\"}}}}",
  1515. "expectedSnapshotEvents": [
  1516. {
  1517. "errorCode": 0,
  1518. "fromCache": false,
  1519. "hasPendingWrites": false,
  1520. "modified": [
  1521. {
  1522. "key": "collection/a",
  1523. "options": {
  1524. "hasCommittedMutations": false,
  1525. "hasLocalMutations": false
  1526. },
  1527. "value": {
  1528. "value": "b"
  1529. },
  1530. "version": 2999
  1531. }
  1532. ],
  1533. "query": {
  1534. "filters": [
  1535. ],
  1536. "orderBys": [
  1537. ],
  1538. "path": "collection"
  1539. }
  1540. }
  1541. ]
  1542. }
  1543. ]
  1544. },
  1545. "Newer docs from bundles should raise snapshot only when Watch catches up with acknowledged writes": {
  1546. "describeName": "Bundles:",
  1547. "itName": "Newer docs from bundles should raise snapshot only when Watch catches up with acknowledged writes",
  1548. "tags": [
  1549. "no-ios"
  1550. ],
  1551. "config": {
  1552. "numClients": 1,
  1553. "useGarbageCollection": false
  1554. },
  1555. "steps": [
  1556. {
  1557. "userListen": {
  1558. "query": {
  1559. "filters": [
  1560. ],
  1561. "orderBys": [
  1562. ],
  1563. "path": "collection"
  1564. },
  1565. "targetId": 2
  1566. },
  1567. "expectedState": {
  1568. "activeTargets": {
  1569. "2": {
  1570. "queries": [
  1571. {
  1572. "filters": [
  1573. ],
  1574. "orderBys": [
  1575. ],
  1576. "path": "collection"
  1577. }
  1578. ],
  1579. "resumeToken": ""
  1580. }
  1581. }
  1582. }
  1583. },
  1584. {
  1585. "watchAck": [
  1586. 2
  1587. ]
  1588. },
  1589. {
  1590. "watchEntity": {
  1591. "docs": [
  1592. {
  1593. "key": "collection/a",
  1594. "options": {
  1595. "hasCommittedMutations": false,
  1596. "hasLocalMutations": false
  1597. },
  1598. "value": {
  1599. "value": "a"
  1600. },
  1601. "version": 250
  1602. }
  1603. ],
  1604. "targets": [
  1605. 2
  1606. ]
  1607. }
  1608. },
  1609. {
  1610. "watchCurrent": [
  1611. [
  1612. 2
  1613. ],
  1614. "resume-token-250"
  1615. ]
  1616. },
  1617. {
  1618. "watchSnapshot": {
  1619. "targetIds": [
  1620. ],
  1621. "version": 250
  1622. },
  1623. "expectedSnapshotEvents": [
  1624. {
  1625. "added": [
  1626. {
  1627. "key": "collection/a",
  1628. "options": {
  1629. "hasCommittedMutations": false,
  1630. "hasLocalMutations": false
  1631. },
  1632. "value": {
  1633. "value": "a"
  1634. },
  1635. "version": 250
  1636. }
  1637. ],
  1638. "errorCode": 0,
  1639. "fromCache": false,
  1640. "hasPendingWrites": false,
  1641. "query": {
  1642. "filters": [
  1643. ],
  1644. "orderBys": [
  1645. ],
  1646. "path": "collection"
  1647. }
  1648. }
  1649. ]
  1650. },
  1651. {
  1652. "userPatch": [
  1653. "collection/a",
  1654. {
  1655. "value": "patched"
  1656. }
  1657. ],
  1658. "expectedSnapshotEvents": [
  1659. {
  1660. "errorCode": 0,
  1661. "fromCache": false,
  1662. "hasPendingWrites": true,
  1663. "modified": [
  1664. {
  1665. "key": "collection/a",
  1666. "options": {
  1667. "hasCommittedMutations": false,
  1668. "hasLocalMutations": true
  1669. },
  1670. "value": {
  1671. "value": "patched"
  1672. },
  1673. "version": 0
  1674. }
  1675. ],
  1676. "query": {
  1677. "filters": [
  1678. ],
  1679. "orderBys": [
  1680. ],
  1681. "path": "collection"
  1682. }
  1683. }
  1684. ]
  1685. },
  1686. {
  1687. "writeAck": {
  1688. "version": 1000
  1689. },
  1690. "expectedState": {
  1691. "userCallbacks": {
  1692. "acknowledgedDocs": [
  1693. "collection/a"
  1694. ],
  1695. "rejectedDocs": [
  1696. ]
  1697. }
  1698. }
  1699. },
  1700. {
  1701. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000500000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":379}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000500000Z\",\"exists\":true}}219{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.000500000Z\",\"fields\":{\"value\":{\"stringValue\":\"b\"}}}}"
  1702. },
  1703. {
  1704. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.001001000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":388}}154{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.001001000Z\",\"exists\":true}}228{\"document\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"createTime\":\"1970-01-01T00:00:00.000250000Z\",\"updateTime\":\"1970-01-01T00:00:00.001001000Z\",\"fields\":{\"value\":{\"stringValue\":\"fromBundle\"}}}}",
  1705. "expectedSnapshotEvents": [
  1706. {
  1707. "errorCode": 0,
  1708. "fromCache": false,
  1709. "hasPendingWrites": false,
  1710. "modified": [
  1711. {
  1712. "key": "collection/a",
  1713. "options": {
  1714. "hasCommittedMutations": false,
  1715. "hasLocalMutations": false
  1716. },
  1717. "value": {
  1718. "value": "fromBundle"
  1719. },
  1720. "version": 1001
  1721. }
  1722. ],
  1723. "query": {
  1724. "filters": [
  1725. ],
  1726. "orderBys": [
  1727. ],
  1728. "path": "collection"
  1729. }
  1730. }
  1731. ]
  1732. }
  1733. ]
  1734. },
  1735. "Older deleted docs from bundles should do nothing": {
  1736. "describeName": "Bundles:",
  1737. "itName": "Older deleted docs from bundles should do nothing",
  1738. "tags": [
  1739. "no-ios"
  1740. ],
  1741. "config": {
  1742. "numClients": 1,
  1743. "useGarbageCollection": true
  1744. },
  1745. "steps": [
  1746. {
  1747. "userListen": {
  1748. "query": {
  1749. "filters": [
  1750. ],
  1751. "orderBys": [
  1752. ],
  1753. "path": "collection"
  1754. },
  1755. "targetId": 2
  1756. },
  1757. "expectedState": {
  1758. "activeTargets": {
  1759. "2": {
  1760. "queries": [
  1761. {
  1762. "filters": [
  1763. ],
  1764. "orderBys": [
  1765. ],
  1766. "path": "collection"
  1767. }
  1768. ],
  1769. "resumeToken": ""
  1770. }
  1771. }
  1772. }
  1773. },
  1774. {
  1775. "watchAck": [
  1776. 2
  1777. ]
  1778. },
  1779. {
  1780. "watchEntity": {
  1781. "docs": [
  1782. {
  1783. "key": "collection/a",
  1784. "options": {
  1785. "hasCommittedMutations": false,
  1786. "hasLocalMutations": false
  1787. },
  1788. "value": {
  1789. "value": "a"
  1790. },
  1791. "version": 1000
  1792. }
  1793. ],
  1794. "targets": [
  1795. 2
  1796. ]
  1797. }
  1798. },
  1799. {
  1800. "watchCurrent": [
  1801. [
  1802. 2
  1803. ],
  1804. "resume-token-1000"
  1805. ]
  1806. },
  1807. {
  1808. "watchSnapshot": {
  1809. "targetIds": [
  1810. ],
  1811. "version": 1000
  1812. },
  1813. "expectedSnapshotEvents": [
  1814. {
  1815. "added": [
  1816. {
  1817. "key": "collection/a",
  1818. "options": {
  1819. "hasCommittedMutations": false,
  1820. "hasLocalMutations": false
  1821. },
  1822. "value": {
  1823. "value": "a"
  1824. },
  1825. "version": 1000
  1826. }
  1827. ],
  1828. "errorCode": 0,
  1829. "fromCache": false,
  1830. "hasPendingWrites": false,
  1831. "query": {
  1832. "filters": [
  1833. ],
  1834. "orderBys": [
  1835. ],
  1836. "path": "collection"
  1837. }
  1838. }
  1839. ]
  1840. },
  1841. {
  1842. "loadBundle": "127{\"metadata\":{\"id\":\"test-bundle\",\"createTime\":\"1970-01-01T00:00:00.000999000Z\",\"version\":1,\"totalDocuments\":1,\"totalBytes\":158}}155{\"documentMetadata\":{\"name\":\"projects/test-project/databases/(default)/documents/collection/a\",\"readTime\":\"1970-01-01T00:00:00.000999000Z\",\"exists\":false}}"
  1843. }
  1844. ]
  1845. }
  1846. }