offline_spec_test.json 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210
  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. "key": "collection/a",
  323. "version": 1000,
  324. "value": {
  325. "key": "a"
  326. },
  327. "options": {
  328. "hasLocalMutations": false,
  329. "hasCommittedMutations": false
  330. }
  331. }
  332. ],
  333. "targets": [
  334. 2
  335. ]
  336. }
  337. },
  338. {
  339. "watchCurrent": [
  340. [
  341. 2
  342. ],
  343. "resume-token-1000"
  344. ]
  345. },
  346. {
  347. "watchSnapshot": {
  348. "version": 1000,
  349. "targetIds": []
  350. },
  351. "expect": [
  352. {
  353. "query": {
  354. "path": "collection",
  355. "filters": [],
  356. "orderBys": []
  357. },
  358. "added": [
  359. {
  360. "key": "collection/a",
  361. "version": 1000,
  362. "value": {
  363. "key": "a"
  364. },
  365. "options": {
  366. "hasLocalMutations": false,
  367. "hasCommittedMutations": false
  368. }
  369. }
  370. ],
  371. "errorCode": 0,
  372. "fromCache": false,
  373. "hasPendingWrites": false
  374. }
  375. ]
  376. },
  377. {
  378. "watchStreamClose": {
  379. "error": {
  380. "code": 14,
  381. "message": "Simulated Backend Error"
  382. },
  383. "runBackoffTimer": true
  384. },
  385. "stateExpect": {
  386. "activeTargets": {
  387. "2": {
  388. "query": {
  389. "path": "collection",
  390. "filters": [],
  391. "orderBys": []
  392. },
  393. "resumeToken": "resume-token-1000"
  394. }
  395. }
  396. }
  397. },
  398. {
  399. "watchStreamClose": {
  400. "error": {
  401. "code": 14,
  402. "message": "Simulated Backend Error"
  403. },
  404. "runBackoffTimer": true
  405. },
  406. "expect": [
  407. {
  408. "query": {
  409. "path": "collection",
  410. "filters": [],
  411. "orderBys": []
  412. },
  413. "errorCode": 0,
  414. "fromCache": true,
  415. "hasPendingWrites": false
  416. }
  417. ]
  418. },
  419. {
  420. "watchAck": [
  421. 2
  422. ]
  423. },
  424. {
  425. "watchEntity": {
  426. "docs": [],
  427. "targets": [
  428. 2
  429. ]
  430. }
  431. },
  432. {
  433. "watchCurrent": [
  434. [
  435. 2
  436. ],
  437. "resume-token-1000"
  438. ]
  439. },
  440. {
  441. "watchSnapshot": {
  442. "version": 1000,
  443. "targetIds": []
  444. },
  445. "expect": [
  446. {
  447. "query": {
  448. "path": "collection",
  449. "filters": [],
  450. "orderBys": []
  451. },
  452. "errorCode": 0,
  453. "fromCache": false,
  454. "hasPendingWrites": false
  455. }
  456. ]
  457. }
  458. ]
  459. },
  460. "Queries with limbo documents handle going offline.": {
  461. "describeName": "Offline:",
  462. "itName": "Queries with limbo documents handle going offline.",
  463. "tags": [],
  464. "config": {
  465. "useGarbageCollection": true,
  466. "numClients": 1
  467. },
  468. "steps": [
  469. {
  470. "userListen": [
  471. 2,
  472. {
  473. "path": "collection",
  474. "filters": [],
  475. "orderBys": []
  476. }
  477. ],
  478. "stateExpect": {
  479. "activeTargets": {
  480. "2": {
  481. "query": {
  482. "path": "collection",
  483. "filters": [],
  484. "orderBys": []
  485. },
  486. "resumeToken": ""
  487. }
  488. }
  489. }
  490. },
  491. {
  492. "watchAck": [
  493. 2
  494. ]
  495. },
  496. {
  497. "watchEntity": {
  498. "docs": [
  499. {
  500. "key": "collection/a",
  501. "version": 1000,
  502. "value": {
  503. "key": "a"
  504. },
  505. "options": {
  506. "hasLocalMutations": false,
  507. "hasCommittedMutations": false
  508. }
  509. }
  510. ],
  511. "targets": [
  512. 2
  513. ]
  514. }
  515. },
  516. {
  517. "watchCurrent": [
  518. [
  519. 2
  520. ],
  521. "resume-token-1000"
  522. ]
  523. },
  524. {
  525. "watchSnapshot": {
  526. "version": 1000,
  527. "targetIds": []
  528. },
  529. "expect": [
  530. {
  531. "query": {
  532. "path": "collection",
  533. "filters": [],
  534. "orderBys": []
  535. },
  536. "added": [
  537. {
  538. "key": "collection/a",
  539. "version": 1000,
  540. "value": {
  541. "key": "a"
  542. },
  543. "options": {
  544. "hasLocalMutations": false,
  545. "hasCommittedMutations": false
  546. }
  547. }
  548. ],
  549. "errorCode": 0,
  550. "fromCache": false,
  551. "hasPendingWrites": false
  552. }
  553. ]
  554. },
  555. {
  556. "watchReset": [
  557. 2
  558. ]
  559. },
  560. {
  561. "watchCurrent": [
  562. [
  563. 2
  564. ],
  565. "resume-token-1001"
  566. ]
  567. },
  568. {
  569. "watchSnapshot": {
  570. "version": 1001,
  571. "targetIds": []
  572. },
  573. "stateExpect": {
  574. "limboDocs": [
  575. "collection/a"
  576. ],
  577. "activeTargets": {
  578. "1": {
  579. "query": {
  580. "path": "collection/a",
  581. "filters": [],
  582. "orderBys": []
  583. },
  584. "resumeToken": ""
  585. },
  586. "2": {
  587. "query": {
  588. "path": "collection",
  589. "filters": [],
  590. "orderBys": []
  591. },
  592. "resumeToken": ""
  593. }
  594. }
  595. },
  596. "expect": [
  597. {
  598. "query": {
  599. "path": "collection",
  600. "filters": [],
  601. "orderBys": []
  602. },
  603. "errorCode": 0,
  604. "fromCache": true,
  605. "hasPendingWrites": false
  606. }
  607. ]
  608. },
  609. {
  610. "watchStreamClose": {
  611. "error": {
  612. "code": 14,
  613. "message": "Simulated Backend Error"
  614. },
  615. "runBackoffTimer": true
  616. },
  617. "stateExpect": {
  618. "activeTargets": {
  619. "1": {
  620. "query": {
  621. "path": "collection/a",
  622. "filters": [],
  623. "orderBys": []
  624. },
  625. "resumeToken": ""
  626. },
  627. "2": {
  628. "query": {
  629. "path": "collection",
  630. "filters": [],
  631. "orderBys": []
  632. },
  633. "resumeToken": "resume-token-1001"
  634. }
  635. }
  636. }
  637. },
  638. {
  639. "watchStreamClose": {
  640. "error": {
  641. "code": 14,
  642. "message": "Simulated Backend Error"
  643. },
  644. "runBackoffTimer": true
  645. }
  646. },
  647. {
  648. "watchAck": [
  649. 2
  650. ]
  651. },
  652. {
  653. "watchEntity": {
  654. "docs": [],
  655. "targets": [
  656. 2
  657. ]
  658. }
  659. },
  660. {
  661. "watchCurrent": [
  662. [
  663. 2
  664. ],
  665. "resume-token-1001"
  666. ]
  667. },
  668. {
  669. "watchSnapshot": {
  670. "version": 1001,
  671. "targetIds": []
  672. }
  673. },
  674. {
  675. "watchAck": [
  676. 1
  677. ]
  678. },
  679. {
  680. "watchEntity": {
  681. "docs": [],
  682. "targets": [
  683. 1
  684. ]
  685. }
  686. },
  687. {
  688. "watchCurrent": [
  689. [
  690. 1
  691. ],
  692. "resume-token-1001"
  693. ]
  694. },
  695. {
  696. "watchSnapshot": {
  697. "version": 1001,
  698. "targetIds": []
  699. },
  700. "expect": [
  701. {
  702. "query": {
  703. "path": "collection",
  704. "filters": [],
  705. "orderBys": []
  706. },
  707. "removed": [
  708. {
  709. "key": "collection/a",
  710. "version": 1000,
  711. "value": {
  712. "key": "a"
  713. },
  714. "options": {
  715. "hasLocalMutations": false,
  716. "hasCommittedMutations": false
  717. }
  718. }
  719. ],
  720. "errorCode": 0,
  721. "fromCache": false,
  722. "hasPendingWrites": false
  723. }
  724. ],
  725. "stateExpect": {
  726. "limboDocs": [],
  727. "activeTargets": {
  728. "2": {
  729. "query": {
  730. "path": "collection",
  731. "filters": [],
  732. "orderBys": []
  733. },
  734. "resumeToken": "resume-token-1001"
  735. }
  736. }
  737. }
  738. }
  739. ]
  740. },
  741. "OnlineState timeout triggers offline behavior": {
  742. "describeName": "Offline:",
  743. "itName": "OnlineState timeout triggers offline behavior",
  744. "tags": [],
  745. "config": {
  746. "useGarbageCollection": true,
  747. "numClients": 1
  748. },
  749. "steps": [
  750. {
  751. "userListen": [
  752. 2,
  753. {
  754. "path": "collection",
  755. "filters": [],
  756. "orderBys": []
  757. }
  758. ],
  759. "stateExpect": {
  760. "activeTargets": {
  761. "2": {
  762. "query": {
  763. "path": "collection",
  764. "filters": [],
  765. "orderBys": []
  766. },
  767. "resumeToken": ""
  768. }
  769. }
  770. }
  771. },
  772. {
  773. "runTimer": "online_state_timeout",
  774. "expect": [
  775. {
  776. "query": {
  777. "path": "collection",
  778. "filters": [],
  779. "orderBys": []
  780. },
  781. "errorCode": 0,
  782. "fromCache": true,
  783. "hasPendingWrites": false
  784. }
  785. ]
  786. },
  787. {
  788. "watchStreamClose": {
  789. "error": {
  790. "code": 14,
  791. "message": "Simulated Backend Error"
  792. },
  793. "runBackoffTimer": true
  794. }
  795. },
  796. {
  797. "watchStreamClose": {
  798. "error": {
  799. "code": 14,
  800. "message": "Simulated Backend Error"
  801. },
  802. "runBackoffTimer": true
  803. }
  804. },
  805. {
  806. "watchAck": [
  807. 2
  808. ]
  809. },
  810. {
  811. "watchEntity": {
  812. "docs": [
  813. {
  814. "key": "collection/a",
  815. "version": 1000,
  816. "value": {
  817. "key": "a"
  818. },
  819. "options": {
  820. "hasLocalMutations": false,
  821. "hasCommittedMutations": false
  822. }
  823. }
  824. ],
  825. "targets": [
  826. 2
  827. ]
  828. }
  829. },
  830. {
  831. "watchCurrent": [
  832. [
  833. 2
  834. ],
  835. "resume-token-1000"
  836. ]
  837. },
  838. {
  839. "watchSnapshot": {
  840. "version": 1000,
  841. "targetIds": []
  842. },
  843. "expect": [
  844. {
  845. "query": {
  846. "path": "collection",
  847. "filters": [],
  848. "orderBys": []
  849. },
  850. "added": [
  851. {
  852. "key": "collection/a",
  853. "version": 1000,
  854. "value": {
  855. "key": "a"
  856. },
  857. "options": {
  858. "hasLocalMutations": false,
  859. "hasCommittedMutations": false
  860. }
  861. }
  862. ],
  863. "errorCode": 0,
  864. "fromCache": false,
  865. "hasPendingWrites": false
  866. }
  867. ]
  868. },
  869. {
  870. "runTimer": "all"
  871. },
  872. {
  873. "watchStreamClose": {
  874. "error": {
  875. "code": 14,
  876. "message": "Simulated Backend Error"
  877. },
  878. "runBackoffTimer": true
  879. },
  880. "stateExpect": {
  881. "activeTargets": {
  882. "2": {
  883. "query": {
  884. "path": "collection",
  885. "filters": [],
  886. "orderBys": []
  887. },
  888. "resumeToken": "resume-token-1000"
  889. }
  890. }
  891. }
  892. },
  893. {
  894. "runTimer": "online_state_timeout",
  895. "expect": [
  896. {
  897. "query": {
  898. "path": "collection",
  899. "filters": [],
  900. "orderBys": []
  901. },
  902. "errorCode": 0,
  903. "fromCache": true,
  904. "hasPendingWrites": false
  905. }
  906. ]
  907. }
  908. ]
  909. },
  910. "New queries return immediately with fromCache=true when offline due to stream failures.": {
  911. "describeName": "Offline:",
  912. "itName": "New queries return immediately with fromCache=true when offline due to stream failures.",
  913. "tags": [],
  914. "config": {
  915. "useGarbageCollection": true,
  916. "numClients": 1
  917. },
  918. "steps": [
  919. {
  920. "userListen": [
  921. 2,
  922. {
  923. "path": "collection",
  924. "filters": [],
  925. "orderBys": []
  926. }
  927. ],
  928. "stateExpect": {
  929. "activeTargets": {
  930. "2": {
  931. "query": {
  932. "path": "collection",
  933. "filters": [],
  934. "orderBys": []
  935. },
  936. "resumeToken": ""
  937. }
  938. }
  939. }
  940. },
  941. {
  942. "watchStreamClose": {
  943. "error": {
  944. "code": 14,
  945. "message": "Simulated Backend Error"
  946. },
  947. "runBackoffTimer": true
  948. },
  949. "expect": [
  950. {
  951. "query": {
  952. "path": "collection",
  953. "filters": [],
  954. "orderBys": []
  955. },
  956. "errorCode": 0,
  957. "fromCache": true,
  958. "hasPendingWrites": false
  959. }
  960. ]
  961. },
  962. {
  963. "userListen": [
  964. 4,
  965. {
  966. "path": "collection2",
  967. "filters": [],
  968. "orderBys": []
  969. }
  970. ],
  971. "stateExpect": {
  972. "activeTargets": {
  973. "2": {
  974. "query": {
  975. "path": "collection",
  976. "filters": [],
  977. "orderBys": []
  978. },
  979. "resumeToken": ""
  980. },
  981. "4": {
  982. "query": {
  983. "path": "collection2",
  984. "filters": [],
  985. "orderBys": []
  986. },
  987. "resumeToken": ""
  988. }
  989. }
  990. },
  991. "expect": [
  992. {
  993. "query": {
  994. "path": "collection2",
  995. "filters": [],
  996. "orderBys": []
  997. },
  998. "errorCode": 0,
  999. "fromCache": true,
  1000. "hasPendingWrites": false
  1001. }
  1002. ]
  1003. }
  1004. ]
  1005. },
  1006. "New queries return immediately with fromCache=true when offline due to OnlineState timeout.": {
  1007. "describeName": "Offline:",
  1008. "itName": "New queries return immediately with fromCache=true when offline due to OnlineState timeout.",
  1009. "tags": [],
  1010. "config": {
  1011. "useGarbageCollection": true,
  1012. "numClients": 1
  1013. },
  1014. "steps": [
  1015. {
  1016. "userListen": [
  1017. 2,
  1018. {
  1019. "path": "collection",
  1020. "filters": [],
  1021. "orderBys": []
  1022. }
  1023. ],
  1024. "stateExpect": {
  1025. "activeTargets": {
  1026. "2": {
  1027. "query": {
  1028. "path": "collection",
  1029. "filters": [],
  1030. "orderBys": []
  1031. },
  1032. "resumeToken": ""
  1033. }
  1034. }
  1035. }
  1036. },
  1037. {
  1038. "runTimer": "online_state_timeout",
  1039. "expect": [
  1040. {
  1041. "query": {
  1042. "path": "collection",
  1043. "filters": [],
  1044. "orderBys": []
  1045. },
  1046. "errorCode": 0,
  1047. "fromCache": true,
  1048. "hasPendingWrites": false
  1049. }
  1050. ]
  1051. },
  1052. {
  1053. "userListen": [
  1054. 4,
  1055. {
  1056. "path": "collection2",
  1057. "filters": [],
  1058. "orderBys": []
  1059. }
  1060. ],
  1061. "stateExpect": {
  1062. "activeTargets": {
  1063. "2": {
  1064. "query": {
  1065. "path": "collection",
  1066. "filters": [],
  1067. "orderBys": []
  1068. },
  1069. "resumeToken": ""
  1070. },
  1071. "4": {
  1072. "query": {
  1073. "path": "collection2",
  1074. "filters": [],
  1075. "orderBys": []
  1076. },
  1077. "resumeToken": ""
  1078. }
  1079. }
  1080. },
  1081. "expect": [
  1082. {
  1083. "query": {
  1084. "path": "collection2",
  1085. "filters": [],
  1086. "orderBys": []
  1087. },
  1088. "errorCode": 0,
  1089. "fromCache": true,
  1090. "hasPendingWrites": false
  1091. }
  1092. ]
  1093. }
  1094. ]
  1095. },
  1096. "Queries return from cache when network disabled": {
  1097. "describeName": "Offline:",
  1098. "itName": "Queries return from cache when network disabled",
  1099. "tags": [
  1100. "eager-gc"
  1101. ],
  1102. "config": {
  1103. "useGarbageCollection": true,
  1104. "numClients": 1
  1105. },
  1106. "steps": [
  1107. {
  1108. "enableNetwork": false,
  1109. "stateExpect": {
  1110. "activeTargets": {},
  1111. "limboDocs": []
  1112. }
  1113. },
  1114. {
  1115. "userListen": [
  1116. 2,
  1117. {
  1118. "path": "collection",
  1119. "filters": [],
  1120. "orderBys": []
  1121. }
  1122. ],
  1123. "stateExpect": {
  1124. "activeTargets": {
  1125. "2": {
  1126. "query": {
  1127. "path": "collection",
  1128. "filters": [],
  1129. "orderBys": []
  1130. },
  1131. "resumeToken": ""
  1132. }
  1133. }
  1134. },
  1135. "expect": [
  1136. {
  1137. "query": {
  1138. "path": "collection",
  1139. "filters": [],
  1140. "orderBys": []
  1141. },
  1142. "errorCode": 0,
  1143. "fromCache": true,
  1144. "hasPendingWrites": false
  1145. }
  1146. ]
  1147. },
  1148. {
  1149. "userUnlisten": [
  1150. 2,
  1151. {
  1152. "path": "collection",
  1153. "filters": [],
  1154. "orderBys": []
  1155. }
  1156. ],
  1157. "stateExpect": {
  1158. "activeTargets": {}
  1159. }
  1160. },
  1161. {
  1162. "userListen": [
  1163. 4,
  1164. {
  1165. "path": "collection",
  1166. "filters": [],
  1167. "orderBys": []
  1168. }
  1169. ],
  1170. "stateExpect": {
  1171. "activeTargets": {
  1172. "4": {
  1173. "query": {
  1174. "path": "collection",
  1175. "filters": [],
  1176. "orderBys": []
  1177. },
  1178. "resumeToken": ""
  1179. }
  1180. }
  1181. },
  1182. "expect": [
  1183. {
  1184. "query": {
  1185. "path": "collection",
  1186. "filters": [],
  1187. "orderBys": []
  1188. },
  1189. "errorCode": 0,
  1190. "fromCache": true,
  1191. "hasPendingWrites": false
  1192. }
  1193. ]
  1194. },
  1195. {
  1196. "userUnlisten": [
  1197. 4,
  1198. {
  1199. "path": "collection",
  1200. "filters": [],
  1201. "orderBys": []
  1202. }
  1203. ],
  1204. "stateExpect": {
  1205. "activeTargets": {}
  1206. }
  1207. }
  1208. ]
  1209. }
  1210. }