query_spec_test.json 36 KB

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