query_spec_test.json 35 KB

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