offline_spec_test.json 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173
  1. {
  2. "Empty queries are resolved if client goes offline": {
  3. "describeName": "Offline:",
  4. "itName": "Empty queries are resolved if client goes offline",
  5. "tags": [],
  6. "config": {
  7. "useGarbageCollection": true,
  8. "numClients": 1
  9. },
  10. "steps": [
  11. {
  12. "userListen": [
  13. 2,
  14. {
  15. "path": "collection",
  16. "filters": [],
  17. "orderBys": []
  18. }
  19. ],
  20. "stateExpect": {
  21. "activeTargets": {
  22. "2": {
  23. "query": {
  24. "path": "collection",
  25. "filters": [],
  26. "orderBys": []
  27. },
  28. "resumeToken": ""
  29. }
  30. }
  31. }
  32. },
  33. {
  34. "watchStreamClose": {
  35. "error": {
  36. "code": 14,
  37. "message": "Simulated Backend Error"
  38. },
  39. "runBackoffTimer": true
  40. },
  41. "expect": [
  42. {
  43. "query": {
  44. "path": "collection",
  45. "filters": [],
  46. "orderBys": []
  47. },
  48. "errorCode": 0,
  49. "fromCache": true,
  50. "hasPendingWrites": false
  51. }
  52. ]
  53. },
  54. {
  55. "watchStreamClose": {
  56. "error": {
  57. "code": 14,
  58. "message": "Simulated Backend Error"
  59. },
  60. "runBackoffTimer": true
  61. }
  62. },
  63. {
  64. "watchStreamClose": {
  65. "error": {
  66. "code": 14,
  67. "message": "Simulated Backend Error"
  68. },
  69. "runBackoffTimer": true
  70. }
  71. }
  72. ]
  73. },
  74. "A successful message delays offline status": {
  75. "describeName": "Offline:",
  76. "itName": "A successful message delays offline status",
  77. "tags": [],
  78. "config": {
  79. "useGarbageCollection": true,
  80. "numClients": 1
  81. },
  82. "steps": [
  83. {
  84. "userListen": [
  85. 2,
  86. {
  87. "path": "collection",
  88. "filters": [],
  89. "orderBys": []
  90. }
  91. ],
  92. "stateExpect": {
  93. "activeTargets": {
  94. "2": {
  95. "query": {
  96. "path": "collection",
  97. "filters": [],
  98. "orderBys": []
  99. },
  100. "resumeToken": ""
  101. }
  102. }
  103. }
  104. },
  105. {
  106. "watchAck": [
  107. 2
  108. ]
  109. },
  110. {
  111. "watchStreamClose": {
  112. "error": {
  113. "code": 14,
  114. "message": "Simulated Backend Error"
  115. },
  116. "runBackoffTimer": true
  117. }
  118. },
  119. {
  120. "watchStreamClose": {
  121. "error": {
  122. "code": 14,
  123. "message": "Simulated Backend Error"
  124. },
  125. "runBackoffTimer": true
  126. },
  127. "expect": [
  128. {
  129. "query": {
  130. "path": "collection",
  131. "filters": [],
  132. "orderBys": []
  133. },
  134. "errorCode": 0,
  135. "fromCache": true,
  136. "hasPendingWrites": false
  137. }
  138. ]
  139. },
  140. {
  141. "watchStreamClose": {
  142. "error": {
  143. "code": 14,
  144. "message": "Simulated Backend Error"
  145. },
  146. "runBackoffTimer": true
  147. }
  148. },
  149. {
  150. "watchStreamClose": {
  151. "error": {
  152. "code": 14,
  153. "message": "Simulated Backend Error"
  154. },
  155. "runBackoffTimer": true
  156. }
  157. }
  158. ]
  159. },
  160. "Removing all listeners delays \"Offline\" status on next listen": {
  161. "describeName": "Offline:",
  162. "itName": "Removing all listeners delays \"Offline\" status on next listen",
  163. "tags": [
  164. "eager-gc"
  165. ],
  166. "comment": "Marked as no-lru because when a listen is re-added, it gets a new target id rather than reusing one",
  167. "config": {
  168. "useGarbageCollection": true,
  169. "numClients": 1
  170. },
  171. "steps": [
  172. {
  173. "userListen": [
  174. 2,
  175. {
  176. "path": "collection",
  177. "filters": [],
  178. "orderBys": []
  179. }
  180. ],
  181. "stateExpect": {
  182. "activeTargets": {
  183. "2": {
  184. "query": {
  185. "path": "collection",
  186. "filters": [],
  187. "orderBys": []
  188. },
  189. "resumeToken": ""
  190. }
  191. }
  192. }
  193. },
  194. {
  195. "watchStreamClose": {
  196. "error": {
  197. "code": 14,
  198. "message": "Simulated Backend Error"
  199. },
  200. "runBackoffTimer": true
  201. },
  202. "expect": [
  203. {
  204. "query": {
  205. "path": "collection",
  206. "filters": [],
  207. "orderBys": []
  208. },
  209. "errorCode": 0,
  210. "fromCache": true,
  211. "hasPendingWrites": false
  212. }
  213. ]
  214. },
  215. {
  216. "userUnlisten": [
  217. 2,
  218. {
  219. "path": "collection",
  220. "filters": [],
  221. "orderBys": []
  222. }
  223. ],
  224. "stateExpect": {
  225. "activeTargets": {}
  226. }
  227. },
  228. {
  229. "watchStreamClose": {
  230. "error": {
  231. "code": 14,
  232. "message": "Simulated Backend Error"
  233. },
  234. "runBackoffTimer": true
  235. }
  236. },
  237. {
  238. "userListen": [
  239. 4,
  240. {
  241. "path": "collection",
  242. "filters": [],
  243. "orderBys": []
  244. }
  245. ],
  246. "stateExpect": {
  247. "activeTargets": {
  248. "4": {
  249. "query": {
  250. "path": "collection",
  251. "filters": [],
  252. "orderBys": []
  253. },
  254. "resumeToken": ""
  255. }
  256. }
  257. }
  258. },
  259. {
  260. "watchStreamClose": {
  261. "error": {
  262. "code": 14,
  263. "message": "Simulated Backend Error"
  264. },
  265. "runBackoffTimer": true
  266. },
  267. "expect": [
  268. {
  269. "query": {
  270. "path": "collection",
  271. "filters": [],
  272. "orderBys": []
  273. },
  274. "errorCode": 0,
  275. "fromCache": true,
  276. "hasPendingWrites": false
  277. }
  278. ]
  279. }
  280. ]
  281. },
  282. "Queries revert to fromCache=true when offline.": {
  283. "describeName": "Offline:",
  284. "itName": "Queries revert to fromCache=true when offline.",
  285. "tags": [],
  286. "config": {
  287. "useGarbageCollection": true,
  288. "numClients": 1
  289. },
  290. "steps": [
  291. {
  292. "userListen": [
  293. 2,
  294. {
  295. "path": "collection",
  296. "filters": [],
  297. "orderBys": []
  298. }
  299. ],
  300. "stateExpect": {
  301. "activeTargets": {
  302. "2": {
  303. "query": {
  304. "path": "collection",
  305. "filters": [],
  306. "orderBys": []
  307. },
  308. "resumeToken": ""
  309. }
  310. }
  311. }
  312. },
  313. {
  314. "watchAck": [
  315. 2
  316. ]
  317. },
  318. {
  319. "watchEntity": {
  320. "docs": [
  321. [
  322. "collection/a",
  323. 1000,
  324. {
  325. "key": "a"
  326. }
  327. ]
  328. ],
  329. "targets": [
  330. 2
  331. ]
  332. }
  333. },
  334. {
  335. "watchCurrent": [
  336. [
  337. 2
  338. ],
  339. "resume-token-1000"
  340. ]
  341. },
  342. {
  343. "watchSnapshot": {
  344. "version": 1000
  345. },
  346. "expect": [
  347. {
  348. "query": {
  349. "path": "collection",
  350. "filters": [],
  351. "orderBys": []
  352. },
  353. "added": [
  354. [
  355. "collection/a",
  356. 1000,
  357. {
  358. "key": "a"
  359. }
  360. ]
  361. ],
  362. "errorCode": 0,
  363. "fromCache": false,
  364. "hasPendingWrites": false
  365. }
  366. ]
  367. },
  368. {
  369. "watchStreamClose": {
  370. "error": {
  371. "code": 14,
  372. "message": "Simulated Backend Error"
  373. },
  374. "runBackoffTimer": true
  375. },
  376. "stateExpect": {
  377. "activeTargets": {
  378. "2": {
  379. "query": {
  380. "path": "collection",
  381. "filters": [],
  382. "orderBys": []
  383. },
  384. "resumeToken": "resume-token-1000"
  385. }
  386. }
  387. }
  388. },
  389. {
  390. "watchStreamClose": {
  391. "error": {
  392. "code": 14,
  393. "message": "Simulated Backend Error"
  394. },
  395. "runBackoffTimer": true
  396. },
  397. "expect": [
  398. {
  399. "query": {
  400. "path": "collection",
  401. "filters": [],
  402. "orderBys": []
  403. },
  404. "errorCode": 0,
  405. "fromCache": true,
  406. "hasPendingWrites": false
  407. }
  408. ]
  409. },
  410. {
  411. "watchAck": [
  412. 2
  413. ]
  414. },
  415. {
  416. "watchEntity": {
  417. "docs": [],
  418. "targets": [
  419. 2
  420. ]
  421. }
  422. },
  423. {
  424. "watchCurrent": [
  425. [
  426. 2
  427. ],
  428. "resume-token-1000"
  429. ]
  430. },
  431. {
  432. "watchSnapshot": {
  433. "version": 1000
  434. },
  435. "expect": [
  436. {
  437. "query": {
  438. "path": "collection",
  439. "filters": [],
  440. "orderBys": []
  441. },
  442. "errorCode": 0,
  443. "fromCache": false,
  444. "hasPendingWrites": false
  445. }
  446. ]
  447. }
  448. ]
  449. },
  450. "Queries with limbo documents handle going offline.": {
  451. "describeName": "Offline:",
  452. "itName": "Queries with limbo documents handle going offline.",
  453. "tags": [],
  454. "config": {
  455. "useGarbageCollection": true,
  456. "numClients": 1
  457. },
  458. "steps": [
  459. {
  460. "userListen": [
  461. 2,
  462. {
  463. "path": "collection",
  464. "filters": [],
  465. "orderBys": []
  466. }
  467. ],
  468. "stateExpect": {
  469. "activeTargets": {
  470. "2": {
  471. "query": {
  472. "path": "collection",
  473. "filters": [],
  474. "orderBys": []
  475. },
  476. "resumeToken": ""
  477. }
  478. }
  479. }
  480. },
  481. {
  482. "watchAck": [
  483. 2
  484. ]
  485. },
  486. {
  487. "watchEntity": {
  488. "docs": [
  489. [
  490. "collection/a",
  491. 1000,
  492. {
  493. "key": "a"
  494. }
  495. ]
  496. ],
  497. "targets": [
  498. 2
  499. ]
  500. }
  501. },
  502. {
  503. "watchCurrent": [
  504. [
  505. 2
  506. ],
  507. "resume-token-1000"
  508. ]
  509. },
  510. {
  511. "watchSnapshot": {
  512. "version": 1000
  513. },
  514. "expect": [
  515. {
  516. "query": {
  517. "path": "collection",
  518. "filters": [],
  519. "orderBys": []
  520. },
  521. "added": [
  522. [
  523. "collection/a",
  524. 1000,
  525. {
  526. "key": "a"
  527. }
  528. ]
  529. ],
  530. "errorCode": 0,
  531. "fromCache": false,
  532. "hasPendingWrites": false
  533. }
  534. ]
  535. },
  536. {
  537. "watchReset": [
  538. 2
  539. ]
  540. },
  541. {
  542. "watchCurrent": [
  543. [
  544. 2
  545. ],
  546. "resume-token-1001"
  547. ]
  548. },
  549. {
  550. "watchSnapshot": {
  551. "version": 1001
  552. },
  553. "stateExpect": {
  554. "limboDocs": [
  555. "collection/a"
  556. ],
  557. "activeTargets": {
  558. "1": {
  559. "query": {
  560. "path": "collection/a",
  561. "filters": [],
  562. "orderBys": []
  563. },
  564. "resumeToken": ""
  565. },
  566. "2": {
  567. "query": {
  568. "path": "collection",
  569. "filters": [],
  570. "orderBys": []
  571. },
  572. "resumeToken": ""
  573. }
  574. }
  575. },
  576. "expect": [
  577. {
  578. "query": {
  579. "path": "collection",
  580. "filters": [],
  581. "orderBys": []
  582. },
  583. "errorCode": 0,
  584. "fromCache": true,
  585. "hasPendingWrites": false
  586. }
  587. ]
  588. },
  589. {
  590. "watchStreamClose": {
  591. "error": {
  592. "code": 14,
  593. "message": "Simulated Backend Error"
  594. },
  595. "runBackoffTimer": true
  596. },
  597. "stateExpect": {
  598. "activeTargets": {
  599. "1": {
  600. "query": {
  601. "path": "collection/a",
  602. "filters": [],
  603. "orderBys": []
  604. },
  605. "resumeToken": ""
  606. },
  607. "2": {
  608. "query": {
  609. "path": "collection",
  610. "filters": [],
  611. "orderBys": []
  612. },
  613. "resumeToken": "resume-token-1001"
  614. }
  615. }
  616. }
  617. },
  618. {
  619. "watchStreamClose": {
  620. "error": {
  621. "code": 14,
  622. "message": "Simulated Backend Error"
  623. },
  624. "runBackoffTimer": true
  625. }
  626. },
  627. {
  628. "watchAck": [
  629. 2
  630. ]
  631. },
  632. {
  633. "watchEntity": {
  634. "docs": [],
  635. "targets": [
  636. 2
  637. ]
  638. }
  639. },
  640. {
  641. "watchCurrent": [
  642. [
  643. 2
  644. ],
  645. "resume-token-1001"
  646. ]
  647. },
  648. {
  649. "watchSnapshot": {
  650. "version": 1001
  651. }
  652. },
  653. {
  654. "watchAck": [
  655. 1
  656. ]
  657. },
  658. {
  659. "watchEntity": {
  660. "docs": [],
  661. "targets": [
  662. 1
  663. ]
  664. }
  665. },
  666. {
  667. "watchCurrent": [
  668. [
  669. 1
  670. ],
  671. "resume-token-1001"
  672. ]
  673. },
  674. {
  675. "watchSnapshot": {
  676. "version": 1001
  677. },
  678. "expect": [
  679. {
  680. "query": {
  681. "path": "collection",
  682. "filters": [],
  683. "orderBys": []
  684. },
  685. "removed": [
  686. [
  687. "collection/a",
  688. 1000,
  689. {
  690. "key": "a"
  691. }
  692. ]
  693. ],
  694. "errorCode": 0,
  695. "fromCache": false,
  696. "hasPendingWrites": false
  697. }
  698. ],
  699. "stateExpect": {
  700. "limboDocs": [],
  701. "activeTargets": {
  702. "2": {
  703. "query": {
  704. "path": "collection",
  705. "filters": [],
  706. "orderBys": []
  707. },
  708. "resumeToken": "resume-token-1001"
  709. }
  710. }
  711. }
  712. }
  713. ]
  714. },
  715. "OnlineState timeout triggers offline behavior": {
  716. "describeName": "Offline:",
  717. "itName": "OnlineState timeout triggers offline behavior",
  718. "tags": [],
  719. "config": {
  720. "useGarbageCollection": true,
  721. "numClients": 1
  722. },
  723. "steps": [
  724. {
  725. "userListen": [
  726. 2,
  727. {
  728. "path": "collection",
  729. "filters": [],
  730. "orderBys": []
  731. }
  732. ],
  733. "stateExpect": {
  734. "activeTargets": {
  735. "2": {
  736. "query": {
  737. "path": "collection",
  738. "filters": [],
  739. "orderBys": []
  740. },
  741. "resumeToken": ""
  742. }
  743. }
  744. }
  745. },
  746. {
  747. "runTimer": "online_state_timeout",
  748. "expect": [
  749. {
  750. "query": {
  751. "path": "collection",
  752. "filters": [],
  753. "orderBys": []
  754. },
  755. "errorCode": 0,
  756. "fromCache": true,
  757. "hasPendingWrites": false
  758. }
  759. ]
  760. },
  761. {
  762. "watchStreamClose": {
  763. "error": {
  764. "code": 14,
  765. "message": "Simulated Backend Error"
  766. },
  767. "runBackoffTimer": true
  768. }
  769. },
  770. {
  771. "watchStreamClose": {
  772. "error": {
  773. "code": 14,
  774. "message": "Simulated Backend Error"
  775. },
  776. "runBackoffTimer": true
  777. }
  778. },
  779. {
  780. "watchAck": [
  781. 2
  782. ]
  783. },
  784. {
  785. "watchEntity": {
  786. "docs": [
  787. [
  788. "collection/a",
  789. 1000,
  790. {
  791. "key": "a"
  792. }
  793. ]
  794. ],
  795. "targets": [
  796. 2
  797. ]
  798. }
  799. },
  800. {
  801. "watchCurrent": [
  802. [
  803. 2
  804. ],
  805. "resume-token-1000"
  806. ]
  807. },
  808. {
  809. "watchSnapshot": {
  810. "version": 1000
  811. },
  812. "expect": [
  813. {
  814. "query": {
  815. "path": "collection",
  816. "filters": [],
  817. "orderBys": []
  818. },
  819. "added": [
  820. [
  821. "collection/a",
  822. 1000,
  823. {
  824. "key": "a"
  825. }
  826. ]
  827. ],
  828. "errorCode": 0,
  829. "fromCache": false,
  830. "hasPendingWrites": false
  831. }
  832. ]
  833. },
  834. {
  835. "runTimer": "all"
  836. },
  837. {
  838. "watchStreamClose": {
  839. "error": {
  840. "code": 14,
  841. "message": "Simulated Backend Error"
  842. },
  843. "runBackoffTimer": true
  844. },
  845. "stateExpect": {
  846. "activeTargets": {
  847. "2": {
  848. "query": {
  849. "path": "collection",
  850. "filters": [],
  851. "orderBys": []
  852. },
  853. "resumeToken": "resume-token-1000"
  854. }
  855. }
  856. }
  857. },
  858. {
  859. "runTimer": "online_state_timeout",
  860. "expect": [
  861. {
  862. "query": {
  863. "path": "collection",
  864. "filters": [],
  865. "orderBys": []
  866. },
  867. "errorCode": 0,
  868. "fromCache": true,
  869. "hasPendingWrites": false
  870. }
  871. ]
  872. }
  873. ]
  874. },
  875. "New queries return immediately with fromCache=true when offline due to stream failures.": {
  876. "describeName": "Offline:",
  877. "itName": "New queries return immediately with fromCache=true when offline due to stream failures.",
  878. "tags": [],
  879. "config": {
  880. "useGarbageCollection": true,
  881. "numClients": 1
  882. },
  883. "steps": [
  884. {
  885. "userListen": [
  886. 2,
  887. {
  888. "path": "collection",
  889. "filters": [],
  890. "orderBys": []
  891. }
  892. ],
  893. "stateExpect": {
  894. "activeTargets": {
  895. "2": {
  896. "query": {
  897. "path": "collection",
  898. "filters": [],
  899. "orderBys": []
  900. },
  901. "resumeToken": ""
  902. }
  903. }
  904. }
  905. },
  906. {
  907. "watchStreamClose": {
  908. "error": {
  909. "code": 14,
  910. "message": "Simulated Backend Error"
  911. },
  912. "runBackoffTimer": true
  913. },
  914. "expect": [
  915. {
  916. "query": {
  917. "path": "collection",
  918. "filters": [],
  919. "orderBys": []
  920. },
  921. "errorCode": 0,
  922. "fromCache": true,
  923. "hasPendingWrites": false
  924. }
  925. ]
  926. },
  927. {
  928. "userListen": [
  929. 4,
  930. {
  931. "path": "collection2",
  932. "filters": [],
  933. "orderBys": []
  934. }
  935. ],
  936. "stateExpect": {
  937. "activeTargets": {
  938. "2": {
  939. "query": {
  940. "path": "collection",
  941. "filters": [],
  942. "orderBys": []
  943. },
  944. "resumeToken": ""
  945. },
  946. "4": {
  947. "query": {
  948. "path": "collection2",
  949. "filters": [],
  950. "orderBys": []
  951. },
  952. "resumeToken": ""
  953. }
  954. }
  955. },
  956. "expect": [
  957. {
  958. "query": {
  959. "path": "collection2",
  960. "filters": [],
  961. "orderBys": []
  962. },
  963. "errorCode": 0,
  964. "fromCache": true,
  965. "hasPendingWrites": false
  966. }
  967. ]
  968. }
  969. ]
  970. },
  971. "New queries return immediately with fromCache=true when offline due to OnlineState timeout.": {
  972. "describeName": "Offline:",
  973. "itName": "New queries return immediately with fromCache=true when offline due to OnlineState timeout.",
  974. "tags": [],
  975. "config": {
  976. "useGarbageCollection": true,
  977. "numClients": 1
  978. },
  979. "steps": [
  980. {
  981. "userListen": [
  982. 2,
  983. {
  984. "path": "collection",
  985. "filters": [],
  986. "orderBys": []
  987. }
  988. ],
  989. "stateExpect": {
  990. "activeTargets": {
  991. "2": {
  992. "query": {
  993. "path": "collection",
  994. "filters": [],
  995. "orderBys": []
  996. },
  997. "resumeToken": ""
  998. }
  999. }
  1000. }
  1001. },
  1002. {
  1003. "runTimer": "online_state_timeout",
  1004. "expect": [
  1005. {
  1006. "query": {
  1007. "path": "collection",
  1008. "filters": [],
  1009. "orderBys": []
  1010. },
  1011. "errorCode": 0,
  1012. "fromCache": true,
  1013. "hasPendingWrites": false
  1014. }
  1015. ]
  1016. },
  1017. {
  1018. "userListen": [
  1019. 4,
  1020. {
  1021. "path": "collection2",
  1022. "filters": [],
  1023. "orderBys": []
  1024. }
  1025. ],
  1026. "stateExpect": {
  1027. "activeTargets": {
  1028. "2": {
  1029. "query": {
  1030. "path": "collection",
  1031. "filters": [],
  1032. "orderBys": []
  1033. },
  1034. "resumeToken": ""
  1035. },
  1036. "4": {
  1037. "query": {
  1038. "path": "collection2",
  1039. "filters": [],
  1040. "orderBys": []
  1041. },
  1042. "resumeToken": ""
  1043. }
  1044. }
  1045. },
  1046. "expect": [
  1047. {
  1048. "query": {
  1049. "path": "collection2",
  1050. "filters": [],
  1051. "orderBys": []
  1052. },
  1053. "errorCode": 0,
  1054. "fromCache": true,
  1055. "hasPendingWrites": false
  1056. }
  1057. ]
  1058. }
  1059. ]
  1060. },
  1061. "Queries return from cache when network disabled": {
  1062. "describeName": "Offline:",
  1063. "itName": "Queries return from cache when network disabled",
  1064. "tags": ["eager-gc"],
  1065. "config": {
  1066. "useGarbageCollection": true,
  1067. "numClients": 1
  1068. },
  1069. "steps": [
  1070. {
  1071. "enableNetwork": false,
  1072. "stateExpect": {
  1073. "activeTargets": {},
  1074. "limboDocs": []
  1075. }
  1076. },
  1077. {
  1078. "userListen": [
  1079. 2,
  1080. {
  1081. "path": "collection",
  1082. "filters": [],
  1083. "orderBys": []
  1084. }
  1085. ],
  1086. "stateExpect": {
  1087. "activeTargets": {
  1088. "2": {
  1089. "query": {
  1090. "path": "collection",
  1091. "filters": [],
  1092. "orderBys": []
  1093. },
  1094. "resumeToken": ""
  1095. }
  1096. }
  1097. },
  1098. "expect": [
  1099. {
  1100. "query": {
  1101. "path": "collection",
  1102. "filters": [],
  1103. "orderBys": []
  1104. },
  1105. "errorCode": 0,
  1106. "fromCache": true,
  1107. "hasPendingWrites": false
  1108. }
  1109. ]
  1110. },
  1111. {
  1112. "userUnlisten": [
  1113. 2,
  1114. {
  1115. "path": "collection",
  1116. "filters": [],
  1117. "orderBys": []
  1118. }
  1119. ],
  1120. "stateExpect": {
  1121. "activeTargets": {}
  1122. }
  1123. },
  1124. {
  1125. "userListen": [
  1126. 4,
  1127. {
  1128. "path": "collection",
  1129. "filters": [],
  1130. "orderBys": []
  1131. }
  1132. ],
  1133. "stateExpect": {
  1134. "activeTargets": {
  1135. "4": {
  1136. "query": {
  1137. "path": "collection",
  1138. "filters": [],
  1139. "orderBys": []
  1140. },
  1141. "resumeToken": ""
  1142. }
  1143. }
  1144. },
  1145. "expect": [
  1146. {
  1147. "query": {
  1148. "path": "collection",
  1149. "filters": [],
  1150. "orderBys": []
  1151. },
  1152. "errorCode": 0,
  1153. "fromCache": true,
  1154. "hasPendingWrites": false
  1155. }
  1156. ]
  1157. },
  1158. {
  1159. "userUnlisten": [
  1160. 4,
  1161. {
  1162. "path": "collection",
  1163. "filters": [],
  1164. "orderBys": []
  1165. }
  1166. ],
  1167. "stateExpect": {
  1168. "activeTargets": {}
  1169. }
  1170. }
  1171. ]
  1172. }
  1173. }