bundle_spec_test.json 49 KB

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