bundle_spec_test.json 48 KB

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