offline_spec_test.json 24 KB

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