query_spec_test.json 32 KB

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