bundle_spec_test.json 49 KB

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