offline_spec_test.json 31 KB

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