query_spec_test.json 30 KB

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