bundle_spec_test.json 48 KB

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