recovery_spec_test.json 110 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331
  1. {
  2. "Can re-add failed target": {
  3. "describeName": "Persistence Recovery",
  4. "itName": "Can re-add failed target",
  5. "tags": [
  6. "no-ios",
  7. "no-android"
  8. ],
  9. "config": {
  10. "numClients": 1,
  11. "useGarbageCollection": true
  12. },
  13. "steps": [
  14. {
  15. "userListen": {
  16. "query": {
  17. "filters": [
  18. ],
  19. "orderBys": [
  20. ],
  21. "path": "collection1"
  22. },
  23. "targetId": 2
  24. },
  25. "expectedState": {
  26. "activeTargets": {
  27. "2": {
  28. "queries": [
  29. {
  30. "filters": [
  31. ],
  32. "orderBys": [
  33. ],
  34. "path": "collection1"
  35. }
  36. ],
  37. "resumeToken": ""
  38. }
  39. }
  40. }
  41. },
  42. {
  43. "watchAck": [
  44. 2
  45. ]
  46. },
  47. {
  48. "watchEntity": {
  49. "docs": [
  50. ],
  51. "targets": [
  52. 2
  53. ]
  54. }
  55. },
  56. {
  57. "watchCurrent": [
  58. [
  59. 2
  60. ],
  61. "resume-token-1"
  62. ]
  63. },
  64. {
  65. "watchSnapshot": {
  66. "targetIds": [
  67. ],
  68. "version": 1
  69. },
  70. "expectedSnapshotEvents": [
  71. {
  72. "errorCode": 0,
  73. "fromCache": false,
  74. "hasPendingWrites": false,
  75. "query": {
  76. "filters": [
  77. ],
  78. "orderBys": [
  79. ],
  80. "path": "collection1"
  81. }
  82. }
  83. ]
  84. },
  85. {
  86. "failDatabase": [
  87. "Allocate target"
  88. ]
  89. },
  90. {
  91. "userListen": {
  92. "query": {
  93. "filters": [
  94. ],
  95. "orderBys": [
  96. ],
  97. "path": "collection2"
  98. },
  99. "targetId": 0
  100. },
  101. "expectedSnapshotEvents": [
  102. {
  103. "errorCode": 14,
  104. "fromCache": false,
  105. "hasPendingWrites": false,
  106. "query": {
  107. "filters": [
  108. ],
  109. "orderBys": [
  110. ],
  111. "path": "collection2"
  112. }
  113. }
  114. ]
  115. },
  116. {
  117. "failDatabase": false
  118. },
  119. {
  120. "userListen": {
  121. "query": {
  122. "filters": [
  123. ],
  124. "orderBys": [
  125. ],
  126. "path": "collection2"
  127. },
  128. "targetId": 4
  129. },
  130. "expectedState": {
  131. "activeTargets": {
  132. "2": {
  133. "queries": [
  134. {
  135. "filters": [
  136. ],
  137. "orderBys": [
  138. ],
  139. "path": "collection1"
  140. }
  141. ],
  142. "resumeToken": ""
  143. },
  144. "4": {
  145. "queries": [
  146. {
  147. "filters": [
  148. ],
  149. "orderBys": [
  150. ],
  151. "path": "collection2"
  152. }
  153. ],
  154. "resumeToken": ""
  155. }
  156. }
  157. }
  158. },
  159. {
  160. "watchAck": [
  161. 4
  162. ]
  163. },
  164. {
  165. "watchEntity": {
  166. "docs": [
  167. ],
  168. "targets": [
  169. 4
  170. ]
  171. }
  172. },
  173. {
  174. "watchCurrent": [
  175. [
  176. 4
  177. ],
  178. "resume-token-1"
  179. ]
  180. },
  181. {
  182. "watchSnapshot": {
  183. "targetIds": [
  184. ],
  185. "version": 1
  186. },
  187. "expectedSnapshotEvents": [
  188. {
  189. "errorCode": 0,
  190. "fromCache": false,
  191. "hasPendingWrites": false,
  192. "query": {
  193. "filters": [
  194. ],
  195. "orderBys": [
  196. ],
  197. "path": "collection2"
  198. }
  199. }
  200. ]
  201. }
  202. ]
  203. },
  204. "Can re-listen to query when unlisten fails": {
  205. "describeName": "Persistence Recovery",
  206. "itName": "Can re-listen to query when unlisten fails",
  207. "tags": [
  208. "no-ios",
  209. "no-android"
  210. ],
  211. "config": {
  212. "numClients": 1,
  213. "useGarbageCollection": false
  214. },
  215. "steps": [
  216. {
  217. "userListen": {
  218. "query": {
  219. "filters": [
  220. ],
  221. "orderBys": [
  222. ],
  223. "path": "collection"
  224. },
  225. "targetId": 2
  226. },
  227. "expectedState": {
  228. "activeTargets": {
  229. "2": {
  230. "queries": [
  231. {
  232. "filters": [
  233. ],
  234. "orderBys": [
  235. ],
  236. "path": "collection"
  237. }
  238. ],
  239. "resumeToken": ""
  240. }
  241. }
  242. }
  243. },
  244. {
  245. "watchAck": [
  246. 2
  247. ]
  248. },
  249. {
  250. "watchEntity": {
  251. "docs": [
  252. {
  253. "key": "collection/key1",
  254. "options": {
  255. "hasCommittedMutations": false,
  256. "hasLocalMutations": false
  257. },
  258. "value": {
  259. "foo": "a"
  260. },
  261. "version": 1
  262. }
  263. ],
  264. "targets": [
  265. 2
  266. ]
  267. }
  268. },
  269. {
  270. "watchCurrent": [
  271. [
  272. 2
  273. ],
  274. "resume-token-1000"
  275. ]
  276. },
  277. {
  278. "watchSnapshot": {
  279. "targetIds": [
  280. ],
  281. "version": 1000
  282. },
  283. "expectedSnapshotEvents": [
  284. {
  285. "added": [
  286. {
  287. "key": "collection/key1",
  288. "options": {
  289. "hasCommittedMutations": false,
  290. "hasLocalMutations": false
  291. },
  292. "value": {
  293. "foo": "a"
  294. },
  295. "version": 1
  296. }
  297. ],
  298. "errorCode": 0,
  299. "fromCache": false,
  300. "hasPendingWrites": false,
  301. "query": {
  302. "filters": [
  303. ],
  304. "orderBys": [
  305. ],
  306. "path": "collection"
  307. }
  308. }
  309. ]
  310. },
  311. {
  312. "failDatabase": [
  313. "Release target"
  314. ]
  315. },
  316. {
  317. "userUnlisten": [
  318. 2,
  319. {
  320. "filters": [
  321. ],
  322. "orderBys": [
  323. ],
  324. "path": "collection"
  325. }
  326. ],
  327. "expectedState": {
  328. "activeTargets": {
  329. }
  330. }
  331. },
  332. {
  333. "watchRemove": {
  334. "targetIds": [
  335. 2
  336. ]
  337. }
  338. },
  339. {
  340. "failDatabase": false
  341. },
  342. {
  343. "userListen": {
  344. "query": {
  345. "filters": [
  346. ],
  347. "orderBys": [
  348. ],
  349. "path": "collection"
  350. },
  351. "targetId": 2
  352. },
  353. "expectedSnapshotEvents": [
  354. {
  355. "added": [
  356. {
  357. "key": "collection/key1",
  358. "options": {
  359. "hasCommittedMutations": false,
  360. "hasLocalMutations": false
  361. },
  362. "value": {
  363. "foo": "a"
  364. },
  365. "version": 1
  366. }
  367. ],
  368. "errorCode": 0,
  369. "fromCache": true,
  370. "hasPendingWrites": false,
  371. "query": {
  372. "filters": [
  373. ],
  374. "orderBys": [
  375. ],
  376. "path": "collection"
  377. }
  378. }
  379. ],
  380. "expectedState": {
  381. "activeTargets": {
  382. "2": {
  383. "queries": [
  384. {
  385. "filters": [
  386. ],
  387. "orderBys": [
  388. ],
  389. "path": "collection"
  390. }
  391. ],
  392. "resumeToken": "resume-token-1000"
  393. }
  394. }
  395. }
  396. },
  397. {
  398. "watchAck": [
  399. 2
  400. ]
  401. },
  402. {
  403. "watchEntity": {
  404. "docs": [
  405. {
  406. "key": "collection/key2",
  407. "options": {
  408. "hasCommittedMutations": false,
  409. "hasLocalMutations": false
  410. },
  411. "value": {
  412. "foo": "b"
  413. },
  414. "version": 2
  415. }
  416. ],
  417. "targets": [
  418. 2
  419. ]
  420. }
  421. },
  422. {
  423. "watchCurrent": [
  424. [
  425. 2
  426. ],
  427. "resume-token-2000"
  428. ]
  429. },
  430. {
  431. "watchSnapshot": {
  432. "targetIds": [
  433. ],
  434. "version": 2000
  435. },
  436. "expectedSnapshotEvents": [
  437. {
  438. "added": [
  439. {
  440. "key": "collection/key2",
  441. "options": {
  442. "hasCommittedMutations": false,
  443. "hasLocalMutations": false
  444. },
  445. "value": {
  446. "foo": "b"
  447. },
  448. "version": 2
  449. }
  450. ],
  451. "errorCode": 0,
  452. "fromCache": false,
  453. "hasPendingWrites": false,
  454. "query": {
  455. "filters": [
  456. ],
  457. "orderBys": [
  458. ],
  459. "path": "collection"
  460. }
  461. }
  462. ]
  463. },
  464. {
  465. "userUnlisten": [
  466. 2,
  467. {
  468. "filters": [
  469. ],
  470. "orderBys": [
  471. ],
  472. "path": "collection"
  473. }
  474. ],
  475. "expectedState": {
  476. "activeTargets": {
  477. }
  478. }
  479. }
  480. ]
  481. },
  482. "Clients fail to lookup mutations (with recovery)": {
  483. "describeName": "Persistence Recovery",
  484. "itName": "Clients fail to lookup mutations (with recovery)",
  485. "tags": [
  486. "multi-client",
  487. "no-ios",
  488. "no-android"
  489. ],
  490. "config": {
  491. "numClients": 2,
  492. "useGarbageCollection": false
  493. },
  494. "steps": [
  495. {
  496. "clientIndex": 0,
  497. "drainQueue": true,
  498. "expectedState": {
  499. "isPrimary": true
  500. }
  501. },
  502. {
  503. "clientIndex": 0,
  504. "failDatabase": [
  505. "Lookup mutation documents"
  506. ]
  507. },
  508. {
  509. "clientIndex": 1,
  510. "drainQueue": true,
  511. "expectedState": {
  512. "isPrimary": false
  513. }
  514. },
  515. {
  516. "clientIndex": 1,
  517. "userSet": [
  518. "collection/a",
  519. {
  520. "v": 1
  521. }
  522. ]
  523. },
  524. {
  525. "clientIndex": 1,
  526. "failDatabase": [
  527. "Lookup mutation documents"
  528. ]
  529. },
  530. {
  531. "clientIndex": 0,
  532. "drainQueue": true
  533. },
  534. {
  535. "clientIndex": 0,
  536. "failDatabase": false
  537. },
  538. {
  539. "clientIndex": 0,
  540. "runTimer": "async_queue_retry"
  541. },
  542. {
  543. "clientIndex": 0,
  544. "writeAck": {
  545. "version": 1
  546. }
  547. },
  548. {
  549. "clientIndex": 1,
  550. "drainQueue": true
  551. },
  552. {
  553. "clientIndex": 1,
  554. "failDatabase": false
  555. },
  556. {
  557. "clientIndex": 1,
  558. "runTimer": "async_queue_retry",
  559. "expectedState": {
  560. "userCallbacks": {
  561. "acknowledgedDocs": [
  562. "collection/a"
  563. ],
  564. "rejectedDocs": [
  565. ]
  566. }
  567. }
  568. }
  569. ]
  570. },
  571. "Does not surface non-persisted writes": {
  572. "describeName": "Persistence Recovery",
  573. "itName": "Does not surface non-persisted writes",
  574. "tags": [
  575. "no-ios",
  576. "no-android"
  577. ],
  578. "config": {
  579. "numClients": 1,
  580. "useGarbageCollection": true
  581. },
  582. "steps": [
  583. {
  584. "userListen": {
  585. "query": {
  586. "filters": [
  587. ],
  588. "orderBys": [
  589. ],
  590. "path": "collection"
  591. },
  592. "targetId": 2
  593. },
  594. "expectedState": {
  595. "activeTargets": {
  596. "2": {
  597. "queries": [
  598. {
  599. "filters": [
  600. ],
  601. "orderBys": [
  602. ],
  603. "path": "collection"
  604. }
  605. ],
  606. "resumeToken": ""
  607. }
  608. }
  609. }
  610. },
  611. {
  612. "userSet": [
  613. "collection/key1",
  614. {
  615. "foo": "a"
  616. }
  617. ],
  618. "expectedSnapshotEvents": [
  619. {
  620. "added": [
  621. {
  622. "key": "collection/key1",
  623. "options": {
  624. "hasCommittedMutations": false,
  625. "hasLocalMutations": true
  626. },
  627. "value": {
  628. "foo": "a"
  629. },
  630. "version": 0
  631. }
  632. ],
  633. "errorCode": 0,
  634. "fromCache": true,
  635. "hasPendingWrites": true,
  636. "query": {
  637. "filters": [
  638. ],
  639. "orderBys": [
  640. ],
  641. "path": "collection"
  642. }
  643. }
  644. ]
  645. },
  646. {
  647. "failDatabase": [
  648. "Locally write mutations"
  649. ]
  650. },
  651. {
  652. "userSet": [
  653. "collection/key2",
  654. {
  655. "foo": "b"
  656. }
  657. ],
  658. "expectedState": {
  659. "userCallbacks": {
  660. "acknowledgedDocs": [
  661. ],
  662. "rejectedDocs": [
  663. "collection/key2"
  664. ]
  665. }
  666. }
  667. },
  668. {
  669. "failDatabase": false
  670. },
  671. {
  672. "userSet": [
  673. "collection/key3",
  674. {
  675. "foo": "c"
  676. }
  677. ],
  678. "expectedSnapshotEvents": [
  679. {
  680. "added": [
  681. {
  682. "key": "collection/key3",
  683. "options": {
  684. "hasCommittedMutations": false,
  685. "hasLocalMutations": true
  686. },
  687. "value": {
  688. "foo": "c"
  689. },
  690. "version": 0
  691. }
  692. ],
  693. "errorCode": 0,
  694. "fromCache": true,
  695. "hasPendingWrites": true,
  696. "query": {
  697. "filters": [
  698. ],
  699. "orderBys": [
  700. ],
  701. "path": "collection"
  702. }
  703. }
  704. ]
  705. },
  706. {
  707. "writeAck": {
  708. "version": 1
  709. },
  710. "expectedState": {
  711. "userCallbacks": {
  712. "acknowledgedDocs": [
  713. "collection/key1"
  714. ],
  715. "rejectedDocs": [
  716. ]
  717. }
  718. }
  719. },
  720. {
  721. "writeAck": {
  722. "version": 2
  723. },
  724. "expectedState": {
  725. "userCallbacks": {
  726. "acknowledgedDocs": [
  727. "collection/key3"
  728. ],
  729. "rejectedDocs": [
  730. ]
  731. }
  732. }
  733. },
  734. {
  735. "watchAck": [
  736. 2
  737. ]
  738. },
  739. {
  740. "watchEntity": {
  741. "docs": [
  742. {
  743. "key": "collection/key1",
  744. "options": {
  745. "hasCommittedMutations": false,
  746. "hasLocalMutations": false
  747. },
  748. "value": {
  749. "foo": "a"
  750. },
  751. "version": 1
  752. },
  753. {
  754. "key": "collection/key3",
  755. "options": {
  756. "hasCommittedMutations": false,
  757. "hasLocalMutations": false
  758. },
  759. "value": {
  760. "foo": "c"
  761. },
  762. "version": 2
  763. }
  764. ],
  765. "targets": [
  766. 2
  767. ]
  768. }
  769. },
  770. {
  771. "watchCurrent": [
  772. [
  773. 2
  774. ],
  775. "resume-token-2"
  776. ]
  777. },
  778. {
  779. "watchSnapshot": {
  780. "targetIds": [
  781. ],
  782. "version": 2
  783. },
  784. "expectedSnapshotEvents": [
  785. {
  786. "errorCode": 0,
  787. "fromCache": false,
  788. "hasPendingWrites": false,
  789. "metadata": [
  790. {
  791. "key": "collection/key1",
  792. "options": {
  793. "hasCommittedMutations": false,
  794. "hasLocalMutations": false
  795. },
  796. "value": {
  797. "foo": "a"
  798. },
  799. "version": 1
  800. },
  801. {
  802. "key": "collection/key3",
  803. "options": {
  804. "hasCommittedMutations": false,
  805. "hasLocalMutations": false
  806. },
  807. "value": {
  808. "foo": "c"
  809. },
  810. "version": 2
  811. }
  812. ],
  813. "query": {
  814. "filters": [
  815. ],
  816. "orderBys": [
  817. ],
  818. "path": "collection"
  819. }
  820. }
  821. ]
  822. }
  823. ]
  824. },
  825. "Excludes documents from future queries even if notifyLocalViewChanges fails": {
  826. "describeName": "Persistence Recovery",
  827. "itName": "Excludes documents from future queries even if notifyLocalViewChanges fails",
  828. "tags": [
  829. "no-ios",
  830. "no-android"
  831. ],
  832. "config": {
  833. "numClients": 1,
  834. "useGarbageCollection": false
  835. },
  836. "steps": [
  837. {
  838. "userListen": {
  839. "query": {
  840. "filters": [
  841. ],
  842. "orderBys": [
  843. ],
  844. "path": "collection"
  845. },
  846. "targetId": 2
  847. },
  848. "expectedState": {
  849. "activeTargets": {
  850. "2": {
  851. "queries": [
  852. {
  853. "filters": [
  854. ],
  855. "orderBys": [
  856. ],
  857. "path": "collection"
  858. }
  859. ],
  860. "resumeToken": ""
  861. }
  862. }
  863. }
  864. },
  865. {
  866. "watchAck": [
  867. 2
  868. ]
  869. },
  870. {
  871. "watchEntity": {
  872. "docs": [
  873. {
  874. "key": "collection/key1",
  875. "options": {
  876. "hasCommittedMutations": false,
  877. "hasLocalMutations": false
  878. },
  879. "value": {
  880. "foo": "a"
  881. },
  882. "version": 1000
  883. }
  884. ],
  885. "targets": [
  886. 2
  887. ]
  888. }
  889. },
  890. {
  891. "watchCurrent": [
  892. [
  893. 2
  894. ],
  895. "resume-token-1000"
  896. ]
  897. },
  898. {
  899. "watchSnapshot": {
  900. "targetIds": [
  901. ],
  902. "version": 1000
  903. },
  904. "expectedSnapshotEvents": [
  905. {
  906. "added": [
  907. {
  908. "key": "collection/key1",
  909. "options": {
  910. "hasCommittedMutations": false,
  911. "hasLocalMutations": false
  912. },
  913. "value": {
  914. "foo": "a"
  915. },
  916. "version": 1000
  917. }
  918. ],
  919. "errorCode": 0,
  920. "fromCache": false,
  921. "hasPendingWrites": false,
  922. "query": {
  923. "filters": [
  924. ],
  925. "orderBys": [
  926. ],
  927. "path": "collection"
  928. }
  929. }
  930. ]
  931. },
  932. {
  933. "failDatabase": [
  934. "notifyLocalViewChanges"
  935. ]
  936. },
  937. {
  938. "watchEntity": {
  939. "docs": [
  940. {
  941. "key": "collection/key1",
  942. "value": null,
  943. "version": 2000
  944. }
  945. ],
  946. "removedTargets": [
  947. 2
  948. ]
  949. }
  950. },
  951. {
  952. "watchSnapshot": {
  953. "targetIds": [
  954. ],
  955. "version": 2000
  956. },
  957. "expectedSnapshotEvents": [
  958. {
  959. "errorCode": 0,
  960. "fromCache": false,
  961. "hasPendingWrites": false,
  962. "query": {
  963. "filters": [
  964. ],
  965. "orderBys": [
  966. ],
  967. "path": "collection"
  968. },
  969. "removed": [
  970. {
  971. "key": "collection/key1",
  972. "options": {
  973. "hasCommittedMutations": false,
  974. "hasLocalMutations": false
  975. },
  976. "value": {
  977. "foo": "a"
  978. },
  979. "version": 1000
  980. }
  981. ]
  982. }
  983. ]
  984. },
  985. {
  986. "failDatabase": false
  987. },
  988. {
  989. "userUnlisten": [
  990. 2,
  991. {
  992. "filters": [
  993. ],
  994. "orderBys": [
  995. ],
  996. "path": "collection"
  997. }
  998. ],
  999. "expectedState": {
  1000. "activeTargets": {
  1001. }
  1002. }
  1003. },
  1004. {
  1005. "userListen": {
  1006. "query": {
  1007. "filters": [
  1008. ],
  1009. "orderBys": [
  1010. ],
  1011. "path": "collection"
  1012. },
  1013. "targetId": 2
  1014. },
  1015. "expectedState": {
  1016. "activeTargets": {
  1017. "2": {
  1018. "queries": [
  1019. {
  1020. "filters": [
  1021. ],
  1022. "orderBys": [
  1023. ],
  1024. "path": "collection"
  1025. }
  1026. ],
  1027. "resumeToken": "resume-token-1000"
  1028. }
  1029. }
  1030. }
  1031. }
  1032. ]
  1033. },
  1034. "Fails targets that cannot be allocated": {
  1035. "describeName": "Persistence Recovery",
  1036. "itName": "Fails targets that cannot be allocated",
  1037. "tags": [
  1038. "no-ios",
  1039. "no-android"
  1040. ],
  1041. "config": {
  1042. "numClients": 1,
  1043. "useGarbageCollection": true
  1044. },
  1045. "steps": [
  1046. {
  1047. "userListen": {
  1048. "query": {
  1049. "filters": [
  1050. ],
  1051. "orderBys": [
  1052. ],
  1053. "path": "collection1"
  1054. },
  1055. "targetId": 2
  1056. },
  1057. "expectedState": {
  1058. "activeTargets": {
  1059. "2": {
  1060. "queries": [
  1061. {
  1062. "filters": [
  1063. ],
  1064. "orderBys": [
  1065. ],
  1066. "path": "collection1"
  1067. }
  1068. ],
  1069. "resumeToken": ""
  1070. }
  1071. }
  1072. }
  1073. },
  1074. {
  1075. "watchAck": [
  1076. 2
  1077. ]
  1078. },
  1079. {
  1080. "watchEntity": {
  1081. "docs": [
  1082. ],
  1083. "targets": [
  1084. 2
  1085. ]
  1086. }
  1087. },
  1088. {
  1089. "watchCurrent": [
  1090. [
  1091. 2
  1092. ],
  1093. "resume-token-1"
  1094. ]
  1095. },
  1096. {
  1097. "watchSnapshot": {
  1098. "targetIds": [
  1099. ],
  1100. "version": 1
  1101. },
  1102. "expectedSnapshotEvents": [
  1103. {
  1104. "errorCode": 0,
  1105. "fromCache": false,
  1106. "hasPendingWrites": false,
  1107. "query": {
  1108. "filters": [
  1109. ],
  1110. "orderBys": [
  1111. ],
  1112. "path": "collection1"
  1113. }
  1114. }
  1115. ]
  1116. },
  1117. {
  1118. "failDatabase": [
  1119. "Allocate target"
  1120. ]
  1121. },
  1122. {
  1123. "userListen": {
  1124. "query": {
  1125. "filters": [
  1126. ],
  1127. "orderBys": [
  1128. ],
  1129. "path": "collection2"
  1130. },
  1131. "targetId": 0
  1132. },
  1133. "expectedSnapshotEvents": [
  1134. {
  1135. "errorCode": 14,
  1136. "fromCache": false,
  1137. "hasPendingWrites": false,
  1138. "query": {
  1139. "filters": [
  1140. ],
  1141. "orderBys": [
  1142. ],
  1143. "path": "collection2"
  1144. }
  1145. }
  1146. ]
  1147. },
  1148. {
  1149. "failDatabase": false
  1150. },
  1151. {
  1152. "userListen": {
  1153. "query": {
  1154. "filters": [
  1155. ],
  1156. "orderBys": [
  1157. ],
  1158. "path": "collection3"
  1159. },
  1160. "targetId": 4
  1161. },
  1162. "expectedState": {
  1163. "activeTargets": {
  1164. "2": {
  1165. "queries": [
  1166. {
  1167. "filters": [
  1168. ],
  1169. "orderBys": [
  1170. ],
  1171. "path": "collection1"
  1172. }
  1173. ],
  1174. "resumeToken": ""
  1175. },
  1176. "4": {
  1177. "queries": [
  1178. {
  1179. "filters": [
  1180. ],
  1181. "orderBys": [
  1182. ],
  1183. "path": "collection3"
  1184. }
  1185. ],
  1186. "resumeToken": ""
  1187. }
  1188. }
  1189. }
  1190. },
  1191. {
  1192. "watchAck": [
  1193. 4
  1194. ]
  1195. },
  1196. {
  1197. "watchEntity": {
  1198. "docs": [
  1199. ],
  1200. "targets": [
  1201. 4
  1202. ]
  1203. }
  1204. },
  1205. {
  1206. "watchCurrent": [
  1207. [
  1208. 4
  1209. ],
  1210. "resume-token-1"
  1211. ]
  1212. },
  1213. {
  1214. "watchSnapshot": {
  1215. "targetIds": [
  1216. ],
  1217. "version": 1
  1218. },
  1219. "expectedSnapshotEvents": [
  1220. {
  1221. "errorCode": 0,
  1222. "fromCache": false,
  1223. "hasPendingWrites": false,
  1224. "query": {
  1225. "filters": [
  1226. ],
  1227. "orderBys": [
  1228. ],
  1229. "path": "collection3"
  1230. }
  1231. }
  1232. ]
  1233. }
  1234. ]
  1235. },
  1236. "Handles rejections that cannot be persisted": {
  1237. "describeName": "Persistence Recovery",
  1238. "itName": "Handles rejections that cannot be persisted",
  1239. "tags": [
  1240. "no-ios",
  1241. "no-android"
  1242. ],
  1243. "config": {
  1244. "numClients": 1,
  1245. "useGarbageCollection": false
  1246. },
  1247. "steps": [
  1248. {
  1249. "userListen": {
  1250. "query": {
  1251. "filters": [
  1252. ],
  1253. "orderBys": [
  1254. ],
  1255. "path": "collection/key1"
  1256. },
  1257. "targetId": 2
  1258. },
  1259. "expectedState": {
  1260. "activeTargets": {
  1261. "2": {
  1262. "queries": [
  1263. {
  1264. "filters": [
  1265. ],
  1266. "orderBys": [
  1267. ],
  1268. "path": "collection/key1"
  1269. }
  1270. ],
  1271. "resumeToken": ""
  1272. }
  1273. }
  1274. }
  1275. },
  1276. {
  1277. "watchAck": [
  1278. 2
  1279. ]
  1280. },
  1281. {
  1282. "watchEntity": {
  1283. "docs": [
  1284. {
  1285. "key": "collection/key1",
  1286. "options": {
  1287. "hasCommittedMutations": false,
  1288. "hasLocalMutations": false
  1289. },
  1290. "value": {
  1291. "foo": "a"
  1292. },
  1293. "version": 1000
  1294. }
  1295. ],
  1296. "targets": [
  1297. 2
  1298. ]
  1299. }
  1300. },
  1301. {
  1302. "watchCurrent": [
  1303. [
  1304. 2
  1305. ],
  1306. "resume-token-1000"
  1307. ]
  1308. },
  1309. {
  1310. "watchSnapshot": {
  1311. "targetIds": [
  1312. ],
  1313. "version": 1000
  1314. },
  1315. "expectedSnapshotEvents": [
  1316. {
  1317. "added": [
  1318. {
  1319. "key": "collection/key1",
  1320. "options": {
  1321. "hasCommittedMutations": false,
  1322. "hasLocalMutations": false
  1323. },
  1324. "value": {
  1325. "foo": "a"
  1326. },
  1327. "version": 1000
  1328. }
  1329. ],
  1330. "errorCode": 0,
  1331. "fromCache": false,
  1332. "hasPendingWrites": false,
  1333. "query": {
  1334. "filters": [
  1335. ],
  1336. "orderBys": [
  1337. ],
  1338. "path": "collection/key1"
  1339. }
  1340. }
  1341. ]
  1342. },
  1343. {
  1344. "userListen": {
  1345. "query": {
  1346. "filters": [
  1347. ],
  1348. "orderBys": [
  1349. ],
  1350. "path": "collection/key2"
  1351. },
  1352. "targetId": 4
  1353. },
  1354. "expectedState": {
  1355. "activeTargets": {
  1356. "2": {
  1357. "queries": [
  1358. {
  1359. "filters": [
  1360. ],
  1361. "orderBys": [
  1362. ],
  1363. "path": "collection/key1"
  1364. }
  1365. ],
  1366. "resumeToken": ""
  1367. },
  1368. "4": {
  1369. "queries": [
  1370. {
  1371. "filters": [
  1372. ],
  1373. "orderBys": [
  1374. ],
  1375. "path": "collection/key2"
  1376. }
  1377. ],
  1378. "resumeToken": ""
  1379. }
  1380. }
  1381. }
  1382. },
  1383. {
  1384. "watchAck": [
  1385. 4
  1386. ]
  1387. },
  1388. {
  1389. "watchEntity": {
  1390. "docs": [
  1391. {
  1392. "key": "collection/key2",
  1393. "options": {
  1394. "hasCommittedMutations": false,
  1395. "hasLocalMutations": false
  1396. },
  1397. "value": {
  1398. "foo": "b"
  1399. },
  1400. "version": 2000
  1401. }
  1402. ],
  1403. "targets": [
  1404. 4
  1405. ]
  1406. }
  1407. },
  1408. {
  1409. "watchCurrent": [
  1410. [
  1411. 4
  1412. ],
  1413. "resume-token-2000"
  1414. ]
  1415. },
  1416. {
  1417. "watchSnapshot": {
  1418. "targetIds": [
  1419. ],
  1420. "version": 2000
  1421. },
  1422. "expectedSnapshotEvents": [
  1423. {
  1424. "added": [
  1425. {
  1426. "key": "collection/key2",
  1427. "options": {
  1428. "hasCommittedMutations": false,
  1429. "hasLocalMutations": false
  1430. },
  1431. "value": {
  1432. "foo": "b"
  1433. },
  1434. "version": 2000
  1435. }
  1436. ],
  1437. "errorCode": 0,
  1438. "fromCache": false,
  1439. "hasPendingWrites": false,
  1440. "query": {
  1441. "filters": [
  1442. ],
  1443. "orderBys": [
  1444. ],
  1445. "path": "collection/key2"
  1446. }
  1447. }
  1448. ]
  1449. },
  1450. {
  1451. "failDatabase": [
  1452. "Release target",
  1453. "Get last remote snapshot version"
  1454. ]
  1455. },
  1456. {
  1457. "watchRemove": {
  1458. "cause": {
  1459. "code": 7
  1460. },
  1461. "targetIds": [
  1462. 2
  1463. ]
  1464. },
  1465. "expectedSnapshotEvents": [
  1466. {
  1467. "errorCode": 7,
  1468. "fromCache": false,
  1469. "hasPendingWrites": false,
  1470. "query": {
  1471. "filters": [
  1472. ],
  1473. "orderBys": [
  1474. ],
  1475. "path": "collection/key1"
  1476. }
  1477. }
  1478. ],
  1479. "expectedState": {
  1480. "activeTargets": {
  1481. "4": {
  1482. "queries": [
  1483. {
  1484. "filters": [
  1485. ],
  1486. "orderBys": [
  1487. ],
  1488. "path": "collection/key2"
  1489. }
  1490. ],
  1491. "resumeToken": ""
  1492. }
  1493. }
  1494. }
  1495. },
  1496. {
  1497. "failDatabase": false
  1498. },
  1499. {
  1500. "watchRemove": {
  1501. "cause": {
  1502. "code": 7
  1503. },
  1504. "targetIds": [
  1505. 4
  1506. ]
  1507. },
  1508. "expectedSnapshotEvents": [
  1509. {
  1510. "errorCode": 7,
  1511. "fromCache": false,
  1512. "hasPendingWrites": false,
  1513. "query": {
  1514. "filters": [
  1515. ],
  1516. "orderBys": [
  1517. ],
  1518. "path": "collection/key2"
  1519. }
  1520. }
  1521. ],
  1522. "expectedState": {
  1523. "activeTargets": {
  1524. }
  1525. }
  1526. },
  1527. {
  1528. "userListen": {
  1529. "query": {
  1530. "filters": [
  1531. ],
  1532. "orderBys": [
  1533. ],
  1534. "path": "collection/key1"
  1535. },
  1536. "targetId": 2
  1537. },
  1538. "expectedSnapshotEvents": [
  1539. {
  1540. "added": [
  1541. {
  1542. "key": "collection/key1",
  1543. "options": {
  1544. "hasCommittedMutations": false,
  1545. "hasLocalMutations": false
  1546. },
  1547. "value": {
  1548. "foo": "a"
  1549. },
  1550. "version": 1000
  1551. }
  1552. ],
  1553. "errorCode": 0,
  1554. "fromCache": true,
  1555. "hasPendingWrites": false,
  1556. "query": {
  1557. "filters": [
  1558. ],
  1559. "orderBys": [
  1560. ],
  1561. "path": "collection/key1"
  1562. }
  1563. }
  1564. ],
  1565. "expectedState": {
  1566. "activeTargets": {
  1567. "2": {
  1568. "queries": [
  1569. {
  1570. "filters": [
  1571. ],
  1572. "orderBys": [
  1573. ],
  1574. "path": "collection/key1"
  1575. }
  1576. ],
  1577. "resumeToken": "resume-token-1000"
  1578. }
  1579. }
  1580. }
  1581. },
  1582. {
  1583. "watchAck": [
  1584. 2
  1585. ]
  1586. },
  1587. {
  1588. "watchEntity": {
  1589. "docs": [
  1590. {
  1591. "key": "collection/key1",
  1592. "options": {
  1593. "hasCommittedMutations": false,
  1594. "hasLocalMutations": false
  1595. },
  1596. "value": {
  1597. "foo": "a",
  1598. "updated": true
  1599. },
  1600. "version": 4000
  1601. }
  1602. ],
  1603. "targets": [
  1604. 2
  1605. ]
  1606. }
  1607. },
  1608. {
  1609. "watchCurrent": [
  1610. [
  1611. 2
  1612. ],
  1613. "resume-token-4000"
  1614. ]
  1615. },
  1616. {
  1617. "watchSnapshot": {
  1618. "targetIds": [
  1619. ],
  1620. "version": 4000
  1621. },
  1622. "expectedSnapshotEvents": [
  1623. {
  1624. "errorCode": 0,
  1625. "fromCache": false,
  1626. "hasPendingWrites": false,
  1627. "modified": [
  1628. {
  1629. "key": "collection/key1",
  1630. "options": {
  1631. "hasCommittedMutations": false,
  1632. "hasLocalMutations": false
  1633. },
  1634. "value": {
  1635. "foo": "a",
  1636. "updated": true
  1637. },
  1638. "version": 4000
  1639. }
  1640. ],
  1641. "query": {
  1642. "filters": [
  1643. ],
  1644. "orderBys": [
  1645. ],
  1646. "path": "collection/key1"
  1647. }
  1648. }
  1649. ]
  1650. }
  1651. ]
  1652. },
  1653. "Ignores intermittent lease refresh failures (with recovery)": {
  1654. "describeName": "Persistence Recovery",
  1655. "itName": "Ignores intermittent lease refresh failures (with recovery)",
  1656. "tags": [
  1657. "multi-client",
  1658. "no-ios",
  1659. "no-android"
  1660. ],
  1661. "config": {
  1662. "numClients": 2,
  1663. "useGarbageCollection": false
  1664. },
  1665. "steps": [
  1666. {
  1667. "clientIndex": 0,
  1668. "drainQueue": true,
  1669. "expectedState": {
  1670. "isPrimary": true
  1671. }
  1672. },
  1673. {
  1674. "clientIndex": 1,
  1675. "drainQueue": true,
  1676. "expectedState": {
  1677. "isPrimary": false
  1678. }
  1679. },
  1680. {
  1681. "clientIndex": 0,
  1682. "drainQueue": true
  1683. },
  1684. {
  1685. "clientIndex": 0,
  1686. "failDatabase": [
  1687. "updateClientMetadataAndTryBecomePrimary"
  1688. ]
  1689. },
  1690. {
  1691. "clientIndex": 0,
  1692. "runTimer": "client_metadata_refresh"
  1693. },
  1694. {
  1695. "clientIndex": 1,
  1696. "drainQueue": true
  1697. },
  1698. {
  1699. "clientIndex": 1,
  1700. "failDatabase": [
  1701. "updateClientMetadataAndTryBecomePrimary"
  1702. ]
  1703. },
  1704. {
  1705. "clientIndex": 1,
  1706. "runTimer": "client_metadata_refresh"
  1707. },
  1708. {
  1709. "clientIndex": 0,
  1710. "drainQueue": true
  1711. },
  1712. {
  1713. "clientIndex": 0,
  1714. "failDatabase": false
  1715. },
  1716. {
  1717. "clientIndex": 0,
  1718. "runTimer": "client_metadata_refresh",
  1719. "expectedState": {
  1720. "isPrimary": true
  1721. }
  1722. },
  1723. {
  1724. "clientIndex": 1,
  1725. "drainQueue": true
  1726. },
  1727. {
  1728. "clientIndex": 1,
  1729. "failDatabase": false
  1730. },
  1731. {
  1732. "clientIndex": 1,
  1733. "runTimer": "client_metadata_refresh",
  1734. "expectedState": {
  1735. "isPrimary": false
  1736. }
  1737. },
  1738. {
  1739. "clientIndex": 1,
  1740. "drainQueue": true
  1741. },
  1742. {
  1743. "clientIndex": 1,
  1744. "failDatabase": [
  1745. "updateClientMetadataAndTryBecomePrimary"
  1746. ]
  1747. },
  1748. {
  1749. "clientIndex": 1,
  1750. "runTimer": "client_metadata_refresh"
  1751. },
  1752. {
  1753. "clientIndex": 0,
  1754. "drainQueue": true
  1755. },
  1756. {
  1757. "clientIndex": 0,
  1758. "failDatabase": [
  1759. "updateClientMetadataAndTryBecomePrimary"
  1760. ]
  1761. },
  1762. {
  1763. "clientIndex": 0,
  1764. "runTimer": "client_metadata_refresh"
  1765. },
  1766. {
  1767. "clientIndex": 1,
  1768. "drainQueue": true
  1769. },
  1770. {
  1771. "clientIndex": 1,
  1772. "failDatabase": false
  1773. },
  1774. {
  1775. "clientIndex": 1,
  1776. "runTimer": "client_metadata_refresh",
  1777. "expectedState": {
  1778. "isPrimary": false
  1779. }
  1780. },
  1781. {
  1782. "clientIndex": 0,
  1783. "drainQueue": true
  1784. },
  1785. {
  1786. "clientIndex": 0,
  1787. "failDatabase": false
  1788. },
  1789. {
  1790. "clientIndex": 0,
  1791. "runTimer": "client_metadata_refresh",
  1792. "expectedState": {
  1793. "isPrimary": true
  1794. }
  1795. }
  1796. ]
  1797. },
  1798. "Multiple user changes during transaction failure (with recovery)": {
  1799. "describeName": "Persistence Recovery",
  1800. "itName": "Multiple user changes during transaction failure (with recovery)",
  1801. "tags": [
  1802. "durable-persistence",
  1803. "no-ios",
  1804. "no-android"
  1805. ],
  1806. "config": {
  1807. "numClients": 1,
  1808. "useGarbageCollection": true
  1809. },
  1810. "steps": [
  1811. {
  1812. "changeUser": "user1"
  1813. },
  1814. {
  1815. "userSet": [
  1816. "collection/key1",
  1817. {
  1818. "foo": "a"
  1819. }
  1820. ]
  1821. },
  1822. {
  1823. "userListen": {
  1824. "query": {
  1825. "filters": [
  1826. ],
  1827. "orderBys": [
  1828. ],
  1829. "path": "collection"
  1830. },
  1831. "targetId": 2
  1832. },
  1833. "expectedSnapshotEvents": [
  1834. {
  1835. "added": [
  1836. {
  1837. "key": "collection/key1",
  1838. "options": {
  1839. "hasCommittedMutations": false,
  1840. "hasLocalMutations": true
  1841. },
  1842. "value": {
  1843. "foo": "a"
  1844. },
  1845. "version": 0
  1846. }
  1847. ],
  1848. "errorCode": 0,
  1849. "fromCache": true,
  1850. "hasPendingWrites": true,
  1851. "query": {
  1852. "filters": [
  1853. ],
  1854. "orderBys": [
  1855. ],
  1856. "path": "collection"
  1857. }
  1858. }
  1859. ],
  1860. "expectedState": {
  1861. "activeTargets": {
  1862. "2": {
  1863. "queries": [
  1864. {
  1865. "filters": [
  1866. ],
  1867. "orderBys": [
  1868. ],
  1869. "path": "collection"
  1870. }
  1871. ],
  1872. "resumeToken": ""
  1873. }
  1874. }
  1875. }
  1876. },
  1877. {
  1878. "failDatabase": [
  1879. "Handle user change"
  1880. ]
  1881. },
  1882. {
  1883. "changeUser": "user2",
  1884. "expectedState": {
  1885. "activeTargets": {
  1886. }
  1887. }
  1888. },
  1889. {
  1890. "changeUser": "user1"
  1891. },
  1892. {
  1893. "failDatabase": false
  1894. },
  1895. {
  1896. "runTimer": "async_queue_retry",
  1897. "expectedSnapshotEvents": [
  1898. {
  1899. "errorCode": 0,
  1900. "fromCache": true,
  1901. "hasPendingWrites": false,
  1902. "query": {
  1903. "filters": [
  1904. ],
  1905. "orderBys": [
  1906. ],
  1907. "path": "collection"
  1908. },
  1909. "removed": [
  1910. {
  1911. "key": "collection/key1",
  1912. "options": {
  1913. "hasCommittedMutations": false,
  1914. "hasLocalMutations": true
  1915. },
  1916. "value": {
  1917. "foo": "a"
  1918. },
  1919. "version": 0
  1920. }
  1921. ]
  1922. }
  1923. ],
  1924. "expectedState": {
  1925. "activeTargets": {
  1926. "2": {
  1927. "queries": [
  1928. {
  1929. "filters": [
  1930. ],
  1931. "orderBys": [
  1932. ],
  1933. "path": "collection"
  1934. }
  1935. ],
  1936. "resumeToken": ""
  1937. }
  1938. }
  1939. }
  1940. },
  1941. {
  1942. "runTimer": "async_queue_retry",
  1943. "expectedSnapshotEvents": [
  1944. {
  1945. "added": [
  1946. {
  1947. "key": "collection/key1",
  1948. "options": {
  1949. "hasCommittedMutations": false,
  1950. "hasLocalMutations": true
  1951. },
  1952. "value": {
  1953. "foo": "a"
  1954. },
  1955. "version": 0
  1956. }
  1957. ],
  1958. "errorCode": 0,
  1959. "fromCache": true,
  1960. "hasPendingWrites": true,
  1961. "query": {
  1962. "filters": [
  1963. ],
  1964. "orderBys": [
  1965. ],
  1966. "path": "collection"
  1967. }
  1968. }
  1969. ]
  1970. }
  1971. ]
  1972. },
  1973. "Query is listened to by primary (with recovery)": {
  1974. "describeName": "Persistence Recovery",
  1975. "itName": "Query is listened to by primary (with recovery)",
  1976. "tags": [
  1977. "multi-client",
  1978. "no-ios",
  1979. "no-android"
  1980. ],
  1981. "config": {
  1982. "numClients": 2,
  1983. "useGarbageCollection": false
  1984. },
  1985. "steps": [
  1986. {
  1987. "clientIndex": 0,
  1988. "drainQueue": true,
  1989. "expectedState": {
  1990. "isPrimary": true
  1991. }
  1992. },
  1993. {
  1994. "clientIndex": 0,
  1995. "failDatabase": [
  1996. "Allocate target",
  1997. "Get target data"
  1998. ]
  1999. },
  2000. {
  2001. "clientIndex": 1,
  2002. "drainQueue": true
  2003. },
  2004. {
  2005. "clientIndex": 1,
  2006. "userListen": {
  2007. "query": {
  2008. "filters": [
  2009. ],
  2010. "orderBys": [
  2011. ],
  2012. "path": "collection"
  2013. },
  2014. "targetId": 2
  2015. },
  2016. "expectedState": {
  2017. "activeTargets": {
  2018. "2": {
  2019. "queries": [
  2020. {
  2021. "filters": [
  2022. ],
  2023. "orderBys": [
  2024. ],
  2025. "path": "collection"
  2026. }
  2027. ],
  2028. "resumeToken": ""
  2029. }
  2030. }
  2031. }
  2032. },
  2033. {
  2034. "clientIndex": 0,
  2035. "drainQueue": true
  2036. },
  2037. {
  2038. "clientIndex": 0,
  2039. "failDatabase": false
  2040. },
  2041. {
  2042. "clientIndex": 0,
  2043. "runTimer": "async_queue_retry",
  2044. "expectedState": {
  2045. "activeTargets": {
  2046. "2": {
  2047. "queries": [
  2048. {
  2049. "filters": [
  2050. ],
  2051. "orderBys": [
  2052. ],
  2053. "path": "collection"
  2054. }
  2055. ],
  2056. "resumeToken": ""
  2057. }
  2058. }
  2059. }
  2060. },
  2061. {
  2062. "clientIndex": 0,
  2063. "failDatabase": [
  2064. "Release target"
  2065. ]
  2066. },
  2067. {
  2068. "clientIndex": 1,
  2069. "drainQueue": true
  2070. },
  2071. {
  2072. "clientIndex": 1,
  2073. "userUnlisten": [
  2074. 2,
  2075. {
  2076. "filters": [
  2077. ],
  2078. "orderBys": [
  2079. ],
  2080. "path": "collection"
  2081. }
  2082. ],
  2083. "expectedState": {
  2084. "activeTargets": {
  2085. }
  2086. }
  2087. },
  2088. {
  2089. "clientIndex": 0,
  2090. "drainQueue": true,
  2091. "expectedState": {
  2092. "activeTargets": {
  2093. "2": {
  2094. "queries": [
  2095. {
  2096. "filters": [
  2097. ],
  2098. "orderBys": [
  2099. ],
  2100. "path": "collection"
  2101. }
  2102. ],
  2103. "resumeToken": ""
  2104. }
  2105. }
  2106. }
  2107. },
  2108. {
  2109. "clientIndex": 0,
  2110. "failDatabase": false
  2111. },
  2112. {
  2113. "clientIndex": 0,
  2114. "runTimer": "async_queue_retry",
  2115. "expectedState": {
  2116. "activeTargets": {
  2117. }
  2118. }
  2119. }
  2120. ]
  2121. },
  2122. "Query raises events in secondary client (with recovery)": {
  2123. "describeName": "Persistence Recovery",
  2124. "itName": "Query raises events in secondary client (with recovery)",
  2125. "tags": [
  2126. "multi-client",
  2127. "no-ios",
  2128. "no-android"
  2129. ],
  2130. "config": {
  2131. "numClients": 2,
  2132. "useGarbageCollection": false
  2133. },
  2134. "steps": [
  2135. {
  2136. "clientIndex": 0,
  2137. "drainQueue": true,
  2138. "expectedState": {
  2139. "isPrimary": true
  2140. }
  2141. },
  2142. {
  2143. "clientIndex": 1,
  2144. "drainQueue": true,
  2145. "expectedState": {
  2146. "isPrimary": false
  2147. }
  2148. },
  2149. {
  2150. "clientIndex": 1,
  2151. "userListen": {
  2152. "query": {
  2153. "filters": [
  2154. ],
  2155. "orderBys": [
  2156. ],
  2157. "path": "collection"
  2158. },
  2159. "targetId": 2
  2160. },
  2161. "expectedState": {
  2162. "activeTargets": {
  2163. "2": {
  2164. "queries": [
  2165. {
  2166. "filters": [
  2167. ],
  2168. "orderBys": [
  2169. ],
  2170. "path": "collection"
  2171. }
  2172. ],
  2173. "resumeToken": ""
  2174. }
  2175. }
  2176. }
  2177. },
  2178. {
  2179. "clientIndex": 1,
  2180. "failDatabase": [
  2181. "Get new document changes"
  2182. ]
  2183. },
  2184. {
  2185. "clientIndex": 0,
  2186. "drainQueue": true,
  2187. "expectedState": {
  2188. "activeTargets": {
  2189. "2": {
  2190. "queries": [
  2191. {
  2192. "filters": [
  2193. ],
  2194. "orderBys": [
  2195. ],
  2196. "path": "collection"
  2197. }
  2198. ],
  2199. "resumeToken": ""
  2200. }
  2201. }
  2202. }
  2203. },
  2204. {
  2205. "clientIndex": 0,
  2206. "watchAck": [
  2207. 2
  2208. ]
  2209. },
  2210. {
  2211. "clientIndex": 0,
  2212. "watchEntity": {
  2213. "docs": [
  2214. {
  2215. "key": "collection/doc",
  2216. "options": {
  2217. "hasCommittedMutations": false,
  2218. "hasLocalMutations": false
  2219. },
  2220. "value": {
  2221. "foo": "a"
  2222. },
  2223. "version": 1
  2224. }
  2225. ],
  2226. "targets": [
  2227. 2
  2228. ]
  2229. }
  2230. },
  2231. {
  2232. "clientIndex": 0,
  2233. "watchCurrent": [
  2234. [
  2235. 2
  2236. ],
  2237. "resume-token-1000"
  2238. ]
  2239. },
  2240. {
  2241. "clientIndex": 0,
  2242. "watchSnapshot": {
  2243. "targetIds": [
  2244. ],
  2245. "version": 1000
  2246. }
  2247. },
  2248. {
  2249. "clientIndex": 1,
  2250. "drainQueue": true
  2251. },
  2252. {
  2253. "clientIndex": 1,
  2254. "failDatabase": false
  2255. },
  2256. {
  2257. "clientIndex": 1,
  2258. "runTimer": "async_queue_retry",
  2259. "expectedSnapshotEvents": [
  2260. {
  2261. "added": [
  2262. {
  2263. "key": "collection/doc",
  2264. "options": {
  2265. "hasCommittedMutations": false,
  2266. "hasLocalMutations": false
  2267. },
  2268. "value": {
  2269. "foo": "a"
  2270. },
  2271. "version": 1
  2272. }
  2273. ],
  2274. "errorCode": 0,
  2275. "fromCache": false,
  2276. "hasPendingWrites": false,
  2277. "query": {
  2278. "filters": [
  2279. ],
  2280. "orderBys": [
  2281. ],
  2282. "path": "collection"
  2283. }
  2284. }
  2285. ]
  2286. }
  2287. ]
  2288. },
  2289. "Query with active view recovers after primary tab failover (with recovery)": {
  2290. "describeName": "Persistence Recovery",
  2291. "itName": "Query with active view recovers after primary tab failover (with recovery)",
  2292. "tags": [
  2293. "multi-client",
  2294. "no-ios",
  2295. "no-android"
  2296. ],
  2297. "config": {
  2298. "numClients": 2,
  2299. "useGarbageCollection": false
  2300. },
  2301. "steps": [
  2302. {
  2303. "clientIndex": 0,
  2304. "drainQueue": true,
  2305. "expectedState": {
  2306. "isPrimary": true
  2307. }
  2308. },
  2309. {
  2310. "clientIndex": 1,
  2311. "drainQueue": true
  2312. },
  2313. {
  2314. "clientIndex": 1,
  2315. "userListen": {
  2316. "query": {
  2317. "filters": [
  2318. ],
  2319. "orderBys": [
  2320. ],
  2321. "path": "collection"
  2322. },
  2323. "targetId": 2
  2324. },
  2325. "expectedState": {
  2326. "activeTargets": {
  2327. "2": {
  2328. "queries": [
  2329. {
  2330. "filters": [
  2331. ],
  2332. "orderBys": [
  2333. ],
  2334. "path": "collection"
  2335. }
  2336. ],
  2337. "resumeToken": ""
  2338. }
  2339. }
  2340. }
  2341. },
  2342. {
  2343. "clientIndex": 0,
  2344. "drainQueue": true,
  2345. "expectedState": {
  2346. "activeTargets": {
  2347. "2": {
  2348. "queries": [
  2349. {
  2350. "filters": [
  2351. ],
  2352. "orderBys": [
  2353. ],
  2354. "path": "collection"
  2355. }
  2356. ],
  2357. "resumeToken": ""
  2358. }
  2359. }
  2360. }
  2361. },
  2362. {
  2363. "clientIndex": 0,
  2364. "watchAck": [
  2365. 2
  2366. ]
  2367. },
  2368. {
  2369. "clientIndex": 0,
  2370. "watchEntity": {
  2371. "docs": [
  2372. {
  2373. "key": "collection/a",
  2374. "options": {
  2375. "hasCommittedMutations": false,
  2376. "hasLocalMutations": false
  2377. },
  2378. "value": {
  2379. "key": "a"
  2380. },
  2381. "version": 1000
  2382. }
  2383. ],
  2384. "targets": [
  2385. 2
  2386. ]
  2387. }
  2388. },
  2389. {
  2390. "clientIndex": 0,
  2391. "watchCurrent": [
  2392. [
  2393. 2
  2394. ],
  2395. "resume-token-1000"
  2396. ]
  2397. },
  2398. {
  2399. "clientIndex": 0,
  2400. "watchSnapshot": {
  2401. "targetIds": [
  2402. ],
  2403. "version": 1000
  2404. }
  2405. },
  2406. {
  2407. "clientIndex": 0,
  2408. "shutdown": true,
  2409. "expectedState": {
  2410. "activeLimboDocs": [
  2411. ],
  2412. "activeTargets": {
  2413. },
  2414. "enqueuedLimboDocs": [
  2415. ]
  2416. }
  2417. },
  2418. {
  2419. "clientIndex": 1,
  2420. "drainQueue": true,
  2421. "expectedSnapshotEvents": [
  2422. {
  2423. "added": [
  2424. {
  2425. "key": "collection/a",
  2426. "options": {
  2427. "hasCommittedMutations": false,
  2428. "hasLocalMutations": false
  2429. },
  2430. "value": {
  2431. "key": "a"
  2432. },
  2433. "version": 1000
  2434. }
  2435. ],
  2436. "errorCode": 0,
  2437. "fromCache": false,
  2438. "hasPendingWrites": false,
  2439. "query": {
  2440. "filters": [
  2441. ],
  2442. "orderBys": [
  2443. ],
  2444. "path": "collection"
  2445. }
  2446. }
  2447. ]
  2448. },
  2449. {
  2450. "clientIndex": 1,
  2451. "failDatabase": [
  2452. "Allocate target"
  2453. ]
  2454. },
  2455. {
  2456. "clientIndex": 1,
  2457. "runTimer": "client_metadata_refresh",
  2458. "expectedState": {
  2459. "isPrimary": false
  2460. }
  2461. },
  2462. {
  2463. "clientIndex": 1,
  2464. "failDatabase": false
  2465. },
  2466. {
  2467. "clientIndex": 1,
  2468. "runTimer": "async_queue_retry",
  2469. "expectedState": {
  2470. "activeTargets": {
  2471. "2": {
  2472. "queries": [
  2473. {
  2474. "filters": [
  2475. ],
  2476. "orderBys": [
  2477. ],
  2478. "path": "collection"
  2479. }
  2480. ],
  2481. "resumeToken": "resume-token-1000"
  2482. }
  2483. },
  2484. "isPrimary": true
  2485. }
  2486. },
  2487. {
  2488. "clientIndex": 1,
  2489. "watchAck": [
  2490. 2
  2491. ]
  2492. },
  2493. {
  2494. "clientIndex": 1,
  2495. "watchEntity": {
  2496. "docs": [
  2497. {
  2498. "key": "collection/b",
  2499. "options": {
  2500. "hasCommittedMutations": false,
  2501. "hasLocalMutations": false
  2502. },
  2503. "value": {
  2504. "key": "b"
  2505. },
  2506. "version": 2000
  2507. }
  2508. ],
  2509. "targets": [
  2510. 2
  2511. ]
  2512. }
  2513. },
  2514. {
  2515. "clientIndex": 1,
  2516. "watchCurrent": [
  2517. [
  2518. 2
  2519. ],
  2520. "resume-token-2000"
  2521. ]
  2522. },
  2523. {
  2524. "clientIndex": 1,
  2525. "watchSnapshot": {
  2526. "targetIds": [
  2527. ],
  2528. "version": 2000
  2529. },
  2530. "expectedSnapshotEvents": [
  2531. {
  2532. "added": [
  2533. {
  2534. "key": "collection/b",
  2535. "options": {
  2536. "hasCommittedMutations": false,
  2537. "hasLocalMutations": false
  2538. },
  2539. "value": {
  2540. "key": "b"
  2541. },
  2542. "version": 2000
  2543. }
  2544. ],
  2545. "errorCode": 0,
  2546. "fromCache": false,
  2547. "hasPendingWrites": false,
  2548. "query": {
  2549. "filters": [
  2550. ],
  2551. "orderBys": [
  2552. ],
  2553. "path": "collection"
  2554. }
  2555. }
  2556. ]
  2557. }
  2558. ]
  2559. },
  2560. "Query without active view recovers after primary tab failover (with recovery)": {
  2561. "describeName": "Persistence Recovery",
  2562. "itName": "Query without active view recovers after primary tab failover (with recovery)",
  2563. "tags": [
  2564. "multi-client",
  2565. "no-ios",
  2566. "no-android"
  2567. ],
  2568. "config": {
  2569. "numClients": 3,
  2570. "useGarbageCollection": false
  2571. },
  2572. "steps": [
  2573. {
  2574. "clientIndex": 0,
  2575. "drainQueue": true,
  2576. "expectedState": {
  2577. "isPrimary": true
  2578. }
  2579. },
  2580. {
  2581. "clientIndex": 1,
  2582. "drainQueue": true
  2583. },
  2584. {
  2585. "clientIndex": 2,
  2586. "drainQueue": true
  2587. },
  2588. {
  2589. "clientIndex": 2,
  2590. "userListen": {
  2591. "query": {
  2592. "filters": [
  2593. ],
  2594. "orderBys": [
  2595. ],
  2596. "path": "collection"
  2597. },
  2598. "targetId": 2
  2599. },
  2600. "expectedState": {
  2601. "activeTargets": {
  2602. "2": {
  2603. "queries": [
  2604. {
  2605. "filters": [
  2606. ],
  2607. "orderBys": [
  2608. ],
  2609. "path": "collection"
  2610. }
  2611. ],
  2612. "resumeToken": ""
  2613. }
  2614. }
  2615. }
  2616. },
  2617. {
  2618. "clientIndex": 0,
  2619. "drainQueue": true,
  2620. "expectedState": {
  2621. "activeTargets": {
  2622. "2": {
  2623. "queries": [
  2624. {
  2625. "filters": [
  2626. ],
  2627. "orderBys": [
  2628. ],
  2629. "path": "collection"
  2630. }
  2631. ],
  2632. "resumeToken": ""
  2633. }
  2634. }
  2635. }
  2636. },
  2637. {
  2638. "clientIndex": 0,
  2639. "watchAck": [
  2640. 2
  2641. ]
  2642. },
  2643. {
  2644. "clientIndex": 0,
  2645. "watchEntity": {
  2646. "docs": [
  2647. {
  2648. "key": "collection/a",
  2649. "options": {
  2650. "hasCommittedMutations": false,
  2651. "hasLocalMutations": false
  2652. },
  2653. "value": {
  2654. "key": "a"
  2655. },
  2656. "version": 1000
  2657. }
  2658. ],
  2659. "targets": [
  2660. 2
  2661. ]
  2662. }
  2663. },
  2664. {
  2665. "clientIndex": 0,
  2666. "watchCurrent": [
  2667. [
  2668. 2
  2669. ],
  2670. "resume-token-1000"
  2671. ]
  2672. },
  2673. {
  2674. "clientIndex": 0,
  2675. "watchSnapshot": {
  2676. "targetIds": [
  2677. ],
  2678. "version": 1000
  2679. }
  2680. },
  2681. {
  2682. "clientIndex": 2,
  2683. "drainQueue": true,
  2684. "expectedSnapshotEvents": [
  2685. {
  2686. "added": [
  2687. {
  2688. "key": "collection/a",
  2689. "options": {
  2690. "hasCommittedMutations": false,
  2691. "hasLocalMutations": false
  2692. },
  2693. "value": {
  2694. "key": "a"
  2695. },
  2696. "version": 1000
  2697. }
  2698. ],
  2699. "errorCode": 0,
  2700. "fromCache": false,
  2701. "hasPendingWrites": false,
  2702. "query": {
  2703. "filters": [
  2704. ],
  2705. "orderBys": [
  2706. ],
  2707. "path": "collection"
  2708. }
  2709. }
  2710. ]
  2711. },
  2712. {
  2713. "clientIndex": 0,
  2714. "drainQueue": true
  2715. },
  2716. {
  2717. "clientIndex": 0,
  2718. "shutdown": true,
  2719. "expectedState": {
  2720. "activeLimboDocs": [
  2721. ],
  2722. "activeTargets": {
  2723. },
  2724. "enqueuedLimboDocs": [
  2725. ]
  2726. }
  2727. },
  2728. {
  2729. "clientIndex": 1,
  2730. "drainQueue": true
  2731. },
  2732. {
  2733. "clientIndex": 1,
  2734. "failDatabase": [
  2735. "Allocate target"
  2736. ]
  2737. },
  2738. {
  2739. "clientIndex": 1,
  2740. "runTimer": "client_metadata_refresh",
  2741. "expectedState": {
  2742. "isPrimary": false
  2743. }
  2744. },
  2745. {
  2746. "clientIndex": 1,
  2747. "failDatabase": false
  2748. },
  2749. {
  2750. "clientIndex": 1,
  2751. "runTimer": "async_queue_retry",
  2752. "expectedState": {
  2753. "activeTargets": {
  2754. "2": {
  2755. "queries": [
  2756. {
  2757. "filters": [
  2758. ],
  2759. "orderBys": [
  2760. ],
  2761. "path": "collection"
  2762. }
  2763. ],
  2764. "resumeToken": "resume-token-1000"
  2765. }
  2766. },
  2767. "isPrimary": true
  2768. }
  2769. },
  2770. {
  2771. "clientIndex": 1,
  2772. "watchAck": [
  2773. 2
  2774. ]
  2775. },
  2776. {
  2777. "clientIndex": 1,
  2778. "watchEntity": {
  2779. "docs": [
  2780. {
  2781. "key": "collection/b",
  2782. "options": {
  2783. "hasCommittedMutations": false,
  2784. "hasLocalMutations": false
  2785. },
  2786. "value": {
  2787. "key": "b"
  2788. },
  2789. "version": 2000
  2790. }
  2791. ],
  2792. "targets": [
  2793. 2
  2794. ]
  2795. }
  2796. },
  2797. {
  2798. "clientIndex": 1,
  2799. "watchCurrent": [
  2800. [
  2801. 2
  2802. ],
  2803. "resume-token-2000"
  2804. ]
  2805. },
  2806. {
  2807. "clientIndex": 1,
  2808. "watchSnapshot": {
  2809. "targetIds": [
  2810. ],
  2811. "version": 2000
  2812. }
  2813. },
  2814. {
  2815. "clientIndex": 2,
  2816. "drainQueue": true,
  2817. "expectedSnapshotEvents": [
  2818. {
  2819. "added": [
  2820. {
  2821. "key": "collection/b",
  2822. "options": {
  2823. "hasCommittedMutations": false,
  2824. "hasLocalMutations": false
  2825. },
  2826. "value": {
  2827. "key": "b"
  2828. },
  2829. "version": 2000
  2830. }
  2831. ],
  2832. "errorCode": 0,
  2833. "fromCache": false,
  2834. "hasPendingWrites": false,
  2835. "query": {
  2836. "filters": [
  2837. ],
  2838. "orderBys": [
  2839. ],
  2840. "path": "collection"
  2841. }
  2842. }
  2843. ]
  2844. }
  2845. ]
  2846. },
  2847. "Recovers when Limbo acknowledgement cannot be persisted": {
  2848. "describeName": "Persistence Recovery",
  2849. "itName": "Recovers when Limbo acknowledgement cannot be persisted",
  2850. "tags": [
  2851. "no-ios",
  2852. "no-android"
  2853. ],
  2854. "config": {
  2855. "numClients": 1,
  2856. "useGarbageCollection": false
  2857. },
  2858. "steps": [
  2859. {
  2860. "userListen": {
  2861. "query": {
  2862. "filters": [
  2863. ],
  2864. "orderBys": [
  2865. ],
  2866. "path": "collection"
  2867. },
  2868. "targetId": 2
  2869. },
  2870. "expectedState": {
  2871. "activeTargets": {
  2872. "2": {
  2873. "queries": [
  2874. {
  2875. "filters": [
  2876. ],
  2877. "orderBys": [
  2878. ],
  2879. "path": "collection"
  2880. }
  2881. ],
  2882. "resumeToken": ""
  2883. }
  2884. }
  2885. }
  2886. },
  2887. {
  2888. "watchAck": [
  2889. 2
  2890. ]
  2891. },
  2892. {
  2893. "watchEntity": {
  2894. "docs": [
  2895. {
  2896. "key": "collection/key1",
  2897. "options": {
  2898. "hasCommittedMutations": false,
  2899. "hasLocalMutations": false
  2900. },
  2901. "value": {
  2902. "included": true
  2903. },
  2904. "version": 1
  2905. }
  2906. ],
  2907. "targets": [
  2908. 2
  2909. ]
  2910. }
  2911. },
  2912. {
  2913. "watchCurrent": [
  2914. [
  2915. 2
  2916. ],
  2917. "resume-token-1000"
  2918. ]
  2919. },
  2920. {
  2921. "watchSnapshot": {
  2922. "targetIds": [
  2923. ],
  2924. "version": 1000
  2925. },
  2926. "expectedSnapshotEvents": [
  2927. {
  2928. "added": [
  2929. {
  2930. "key": "collection/key1",
  2931. "options": {
  2932. "hasCommittedMutations": false,
  2933. "hasLocalMutations": false
  2934. },
  2935. "value": {
  2936. "included": true
  2937. },
  2938. "version": 1
  2939. }
  2940. ],
  2941. "errorCode": 0,
  2942. "fromCache": false,
  2943. "hasPendingWrites": false,
  2944. "query": {
  2945. "filters": [
  2946. ],
  2947. "orderBys": [
  2948. ],
  2949. "path": "collection"
  2950. }
  2951. }
  2952. ]
  2953. },
  2954. {
  2955. "userUnlisten": [
  2956. 2,
  2957. {
  2958. "filters": [
  2959. ],
  2960. "orderBys": [
  2961. ],
  2962. "path": "collection"
  2963. }
  2964. ],
  2965. "expectedState": {
  2966. "activeTargets": {
  2967. }
  2968. }
  2969. },
  2970. {
  2971. "userListen": {
  2972. "query": {
  2973. "filters": [
  2974. [
  2975. "included",
  2976. "==",
  2977. true
  2978. ]
  2979. ],
  2980. "orderBys": [
  2981. ],
  2982. "path": "collection"
  2983. },
  2984. "targetId": 4
  2985. },
  2986. "expectedSnapshotEvents": [
  2987. {
  2988. "added": [
  2989. {
  2990. "key": "collection/key1",
  2991. "options": {
  2992. "hasCommittedMutations": false,
  2993. "hasLocalMutations": false
  2994. },
  2995. "value": {
  2996. "included": true
  2997. },
  2998. "version": 1
  2999. }
  3000. ],
  3001. "errorCode": 0,
  3002. "fromCache": true,
  3003. "hasPendingWrites": false,
  3004. "query": {
  3005. "filters": [
  3006. [
  3007. "included",
  3008. "==",
  3009. true
  3010. ]
  3011. ],
  3012. "orderBys": [
  3013. ],
  3014. "path": "collection"
  3015. }
  3016. }
  3017. ],
  3018. "expectedState": {
  3019. "activeTargets": {
  3020. "4": {
  3021. "queries": [
  3022. {
  3023. "filters": [
  3024. [
  3025. "included",
  3026. "==",
  3027. true
  3028. ]
  3029. ],
  3030. "orderBys": [
  3031. ],
  3032. "path": "collection"
  3033. }
  3034. ],
  3035. "resumeToken": ""
  3036. }
  3037. }
  3038. }
  3039. },
  3040. {
  3041. "watchAck": [
  3042. 4
  3043. ]
  3044. },
  3045. {
  3046. "watchEntity": {
  3047. "docs": [
  3048. ],
  3049. "targets": [
  3050. 4
  3051. ]
  3052. }
  3053. },
  3054. {
  3055. "watchCurrent": [
  3056. [
  3057. 4
  3058. ],
  3059. "resume-token-2000"
  3060. ]
  3061. },
  3062. {
  3063. "watchSnapshot": {
  3064. "targetIds": [
  3065. ],
  3066. "version": 2000
  3067. },
  3068. "expectedState": {
  3069. "activeLimboDocs": [
  3070. "collection/key1"
  3071. ],
  3072. "activeTargets": {
  3073. "1": {
  3074. "queries": [
  3075. {
  3076. "filters": [
  3077. ],
  3078. "orderBys": [
  3079. ],
  3080. "path": "collection/key1"
  3081. }
  3082. ],
  3083. "resumeToken": ""
  3084. },
  3085. "4": {
  3086. "queries": [
  3087. {
  3088. "filters": [
  3089. [
  3090. "included",
  3091. "==",
  3092. true
  3093. ]
  3094. ],
  3095. "orderBys": [
  3096. ],
  3097. "path": "collection"
  3098. }
  3099. ],
  3100. "resumeToken": ""
  3101. }
  3102. }
  3103. }
  3104. },
  3105. {
  3106. "failDatabase": [
  3107. "Get last remote snapshot version"
  3108. ]
  3109. },
  3110. {
  3111. "watchAck": [
  3112. 1
  3113. ]
  3114. },
  3115. {
  3116. "watchEntity": {
  3117. "docs": [
  3118. {
  3119. "key": "collection/key1",
  3120. "options": {
  3121. "hasCommittedMutations": false,
  3122. "hasLocalMutations": false
  3123. },
  3124. "value": {
  3125. "included": false
  3126. },
  3127. "version": 1500
  3128. }
  3129. ],
  3130. "targets": [
  3131. 1
  3132. ]
  3133. }
  3134. },
  3135. {
  3136. "watchCurrent": [
  3137. [
  3138. 1
  3139. ],
  3140. "resume-token-3000"
  3141. ]
  3142. },
  3143. {
  3144. "watchSnapshot": {
  3145. "targetIds": [
  3146. ],
  3147. "version": 3000
  3148. },
  3149. "expectedState": {
  3150. "activeTargets": {
  3151. }
  3152. }
  3153. },
  3154. {
  3155. "failDatabase": false
  3156. },
  3157. {
  3158. "runTimer": "async_queue_retry",
  3159. "expectedState": {
  3160. "activeTargets": {
  3161. "1": {
  3162. "queries": [
  3163. {
  3164. "filters": [
  3165. ],
  3166. "orderBys": [
  3167. ],
  3168. "path": "collection/key1"
  3169. }
  3170. ],
  3171. "resumeToken": ""
  3172. },
  3173. "4": {
  3174. "queries": [
  3175. {
  3176. "filters": [
  3177. [
  3178. "included",
  3179. "==",
  3180. true
  3181. ]
  3182. ],
  3183. "orderBys": [
  3184. ],
  3185. "path": "collection"
  3186. }
  3187. ],
  3188. "resumeToken": "resume-token-2000"
  3189. }
  3190. }
  3191. }
  3192. },
  3193. {
  3194. "watchAck": [
  3195. 4
  3196. ]
  3197. },
  3198. {
  3199. "watchEntity": {
  3200. "docs": [
  3201. ],
  3202. "targets": [
  3203. 4
  3204. ]
  3205. }
  3206. },
  3207. {
  3208. "watchCurrent": [
  3209. [
  3210. 4
  3211. ],
  3212. "resume-token-4000"
  3213. ]
  3214. },
  3215. {
  3216. "watchSnapshot": {
  3217. "targetIds": [
  3218. ],
  3219. "version": 4000
  3220. }
  3221. },
  3222. {
  3223. "watchAck": [
  3224. 1
  3225. ]
  3226. },
  3227. {
  3228. "watchEntity": {
  3229. "docs": [
  3230. {
  3231. "key": "collection/key1",
  3232. "options": {
  3233. "hasCommittedMutations": false,
  3234. "hasLocalMutations": false
  3235. },
  3236. "value": {
  3237. "included": false
  3238. },
  3239. "version": 1500
  3240. }
  3241. ],
  3242. "targets": [
  3243. 1
  3244. ]
  3245. }
  3246. },
  3247. {
  3248. "watchCurrent": [
  3249. [
  3250. 1
  3251. ],
  3252. "resume-token-4000"
  3253. ]
  3254. },
  3255. {
  3256. "watchSnapshot": {
  3257. "targetIds": [
  3258. ],
  3259. "version": 4000
  3260. },
  3261. "expectedSnapshotEvents": [
  3262. {
  3263. "errorCode": 0,
  3264. "fromCache": false,
  3265. "hasPendingWrites": false,
  3266. "query": {
  3267. "filters": [
  3268. [
  3269. "included",
  3270. "==",
  3271. true
  3272. ]
  3273. ],
  3274. "orderBys": [
  3275. ],
  3276. "path": "collection"
  3277. },
  3278. "removed": [
  3279. {
  3280. "key": "collection/key1",
  3281. "options": {
  3282. "hasCommittedMutations": false,
  3283. "hasLocalMutations": false
  3284. },
  3285. "value": {
  3286. "included": true
  3287. },
  3288. "version": 1
  3289. }
  3290. ]
  3291. }
  3292. ],
  3293. "expectedState": {
  3294. "activeLimboDocs": [
  3295. ],
  3296. "activeTargets": {
  3297. "4": {
  3298. "queries": [
  3299. {
  3300. "filters": [
  3301. [
  3302. "included",
  3303. "==",
  3304. true
  3305. ]
  3306. ],
  3307. "orderBys": [
  3308. ],
  3309. "path": "collection"
  3310. }
  3311. ],
  3312. "resumeToken": "resume-token-2000"
  3313. }
  3314. }
  3315. }
  3316. }
  3317. ]
  3318. },
  3319. "Recovers when Limbo rejection cannot be persisted": {
  3320. "describeName": "Persistence Recovery",
  3321. "itName": "Recovers when Limbo rejection cannot be persisted",
  3322. "tags": [
  3323. "no-ios",
  3324. "no-android"
  3325. ],
  3326. "config": {
  3327. "numClients": 1,
  3328. "useGarbageCollection": false
  3329. },
  3330. "steps": [
  3331. {
  3332. "userListen": {
  3333. "query": {
  3334. "filters": [
  3335. ],
  3336. "orderBys": [
  3337. ],
  3338. "path": "collection"
  3339. },
  3340. "targetId": 2
  3341. },
  3342. "expectedState": {
  3343. "activeTargets": {
  3344. "2": {
  3345. "queries": [
  3346. {
  3347. "filters": [
  3348. ],
  3349. "orderBys": [
  3350. ],
  3351. "path": "collection"
  3352. }
  3353. ],
  3354. "resumeToken": ""
  3355. }
  3356. }
  3357. }
  3358. },
  3359. {
  3360. "watchAck": [
  3361. 2
  3362. ]
  3363. },
  3364. {
  3365. "watchEntity": {
  3366. "docs": [
  3367. {
  3368. "key": "collection/key1",
  3369. "options": {
  3370. "hasCommittedMutations": false,
  3371. "hasLocalMutations": false
  3372. },
  3373. "value": {
  3374. "included": true
  3375. },
  3376. "version": 1
  3377. }
  3378. ],
  3379. "targets": [
  3380. 2
  3381. ]
  3382. }
  3383. },
  3384. {
  3385. "watchCurrent": [
  3386. [
  3387. 2
  3388. ],
  3389. "resume-token-1000"
  3390. ]
  3391. },
  3392. {
  3393. "watchSnapshot": {
  3394. "targetIds": [
  3395. ],
  3396. "version": 1000
  3397. },
  3398. "expectedSnapshotEvents": [
  3399. {
  3400. "added": [
  3401. {
  3402. "key": "collection/key1",
  3403. "options": {
  3404. "hasCommittedMutations": false,
  3405. "hasLocalMutations": false
  3406. },
  3407. "value": {
  3408. "included": true
  3409. },
  3410. "version": 1
  3411. }
  3412. ],
  3413. "errorCode": 0,
  3414. "fromCache": false,
  3415. "hasPendingWrites": false,
  3416. "query": {
  3417. "filters": [
  3418. ],
  3419. "orderBys": [
  3420. ],
  3421. "path": "collection"
  3422. }
  3423. }
  3424. ]
  3425. },
  3426. {
  3427. "userUnlisten": [
  3428. 2,
  3429. {
  3430. "filters": [
  3431. ],
  3432. "orderBys": [
  3433. ],
  3434. "path": "collection"
  3435. }
  3436. ],
  3437. "expectedState": {
  3438. "activeTargets": {
  3439. }
  3440. }
  3441. },
  3442. {
  3443. "userListen": {
  3444. "query": {
  3445. "filters": [
  3446. [
  3447. "included",
  3448. "==",
  3449. true
  3450. ]
  3451. ],
  3452. "orderBys": [
  3453. ],
  3454. "path": "collection"
  3455. },
  3456. "targetId": 4
  3457. },
  3458. "expectedSnapshotEvents": [
  3459. {
  3460. "added": [
  3461. {
  3462. "key": "collection/key1",
  3463. "options": {
  3464. "hasCommittedMutations": false,
  3465. "hasLocalMutations": false
  3466. },
  3467. "value": {
  3468. "included": true
  3469. },
  3470. "version": 1
  3471. }
  3472. ],
  3473. "errorCode": 0,
  3474. "fromCache": true,
  3475. "hasPendingWrites": false,
  3476. "query": {
  3477. "filters": [
  3478. [
  3479. "included",
  3480. "==",
  3481. true
  3482. ]
  3483. ],
  3484. "orderBys": [
  3485. ],
  3486. "path": "collection"
  3487. }
  3488. }
  3489. ],
  3490. "expectedState": {
  3491. "activeTargets": {
  3492. "4": {
  3493. "queries": [
  3494. {
  3495. "filters": [
  3496. [
  3497. "included",
  3498. "==",
  3499. true
  3500. ]
  3501. ],
  3502. "orderBys": [
  3503. ],
  3504. "path": "collection"
  3505. }
  3506. ],
  3507. "resumeToken": ""
  3508. }
  3509. }
  3510. }
  3511. },
  3512. {
  3513. "watchAck": [
  3514. 4
  3515. ]
  3516. },
  3517. {
  3518. "watchEntity": {
  3519. "docs": [
  3520. ],
  3521. "targets": [
  3522. 4
  3523. ]
  3524. }
  3525. },
  3526. {
  3527. "watchCurrent": [
  3528. [
  3529. 4
  3530. ],
  3531. "resume-token-2000"
  3532. ]
  3533. },
  3534. {
  3535. "watchSnapshot": {
  3536. "targetIds": [
  3537. ],
  3538. "version": 2000
  3539. },
  3540. "expectedState": {
  3541. "activeLimboDocs": [
  3542. "collection/key1"
  3543. ],
  3544. "activeTargets": {
  3545. "1": {
  3546. "queries": [
  3547. {
  3548. "filters": [
  3549. ],
  3550. "orderBys": [
  3551. ],
  3552. "path": "collection/key1"
  3553. }
  3554. ],
  3555. "resumeToken": ""
  3556. },
  3557. "4": {
  3558. "queries": [
  3559. {
  3560. "filters": [
  3561. [
  3562. "included",
  3563. "==",
  3564. true
  3565. ]
  3566. ],
  3567. "orderBys": [
  3568. ],
  3569. "path": "collection"
  3570. }
  3571. ],
  3572. "resumeToken": ""
  3573. }
  3574. }
  3575. }
  3576. },
  3577. {
  3578. "failDatabase": [
  3579. "Apply remote event",
  3580. "Get last remote snapshot version"
  3581. ]
  3582. },
  3583. {
  3584. "watchRemove": {
  3585. "cause": {
  3586. "code": 7
  3587. },
  3588. "targetIds": [
  3589. 1
  3590. ]
  3591. },
  3592. "expectedState": {
  3593. "activeTargets": {
  3594. }
  3595. }
  3596. },
  3597. {
  3598. "failDatabase": false
  3599. },
  3600. {
  3601. "runTimer": "async_queue_retry",
  3602. "expectedState": {
  3603. "activeTargets": {
  3604. "1": {
  3605. "queries": [
  3606. {
  3607. "filters": [
  3608. ],
  3609. "orderBys": [
  3610. ],
  3611. "path": "collection/key1"
  3612. }
  3613. ],
  3614. "resumeToken": ""
  3615. },
  3616. "4": {
  3617. "queries": [
  3618. {
  3619. "filters": [
  3620. [
  3621. "included",
  3622. "==",
  3623. true
  3624. ]
  3625. ],
  3626. "orderBys": [
  3627. ],
  3628. "path": "collection"
  3629. }
  3630. ],
  3631. "resumeToken": "resume-token-2000"
  3632. }
  3633. }
  3634. }
  3635. },
  3636. {
  3637. "watchAck": [
  3638. 4
  3639. ]
  3640. },
  3641. {
  3642. "watchEntity": {
  3643. "docs": [
  3644. ],
  3645. "targets": [
  3646. 4
  3647. ]
  3648. }
  3649. },
  3650. {
  3651. "watchCurrent": [
  3652. [
  3653. 4
  3654. ],
  3655. "resume-token-3000"
  3656. ]
  3657. },
  3658. {
  3659. "watchSnapshot": {
  3660. "targetIds": [
  3661. ],
  3662. "version": 3000
  3663. }
  3664. },
  3665. {
  3666. "watchRemove": {
  3667. "cause": {
  3668. "code": 7
  3669. },
  3670. "targetIds": [
  3671. 1
  3672. ]
  3673. },
  3674. "expectedSnapshotEvents": [
  3675. {
  3676. "errorCode": 0,
  3677. "fromCache": false,
  3678. "hasPendingWrites": false,
  3679. "query": {
  3680. "filters": [
  3681. [
  3682. "included",
  3683. "==",
  3684. true
  3685. ]
  3686. ],
  3687. "orderBys": [
  3688. ],
  3689. "path": "collection"
  3690. },
  3691. "removed": [
  3692. {
  3693. "key": "collection/key1",
  3694. "options": {
  3695. "hasCommittedMutations": false,
  3696. "hasLocalMutations": false
  3697. },
  3698. "value": {
  3699. "included": true
  3700. },
  3701. "version": 1
  3702. }
  3703. ]
  3704. }
  3705. ],
  3706. "expectedState": {
  3707. "activeLimboDocs": [
  3708. ],
  3709. "activeTargets": {
  3710. "4": {
  3711. "queries": [
  3712. {
  3713. "filters": [
  3714. [
  3715. "included",
  3716. "==",
  3717. true
  3718. ]
  3719. ],
  3720. "orderBys": [
  3721. ],
  3722. "path": "collection"
  3723. }
  3724. ],
  3725. "resumeToken": "resume-token-2000"
  3726. }
  3727. }
  3728. }
  3729. }
  3730. ]
  3731. },
  3732. "Recovers when watch update cannot be persisted": {
  3733. "describeName": "Persistence Recovery",
  3734. "itName": "Recovers when watch update cannot be persisted",
  3735. "tags": [
  3736. "no-ios",
  3737. "no-android"
  3738. ],
  3739. "config": {
  3740. "numClients": 1,
  3741. "useGarbageCollection": false
  3742. },
  3743. "steps": [
  3744. {
  3745. "userListen": {
  3746. "query": {
  3747. "filters": [
  3748. ],
  3749. "orderBys": [
  3750. ],
  3751. "path": "collection"
  3752. },
  3753. "targetId": 2
  3754. },
  3755. "expectedState": {
  3756. "activeTargets": {
  3757. "2": {
  3758. "queries": [
  3759. {
  3760. "filters": [
  3761. ],
  3762. "orderBys": [
  3763. ],
  3764. "path": "collection"
  3765. }
  3766. ],
  3767. "resumeToken": ""
  3768. }
  3769. }
  3770. }
  3771. },
  3772. {
  3773. "watchAck": [
  3774. 2
  3775. ]
  3776. },
  3777. {
  3778. "watchEntity": {
  3779. "docs": [
  3780. {
  3781. "key": "collection/key1",
  3782. "options": {
  3783. "hasCommittedMutations": false,
  3784. "hasLocalMutations": false
  3785. },
  3786. "value": {
  3787. "foo": "a"
  3788. },
  3789. "version": 1000
  3790. }
  3791. ],
  3792. "targets": [
  3793. 2
  3794. ]
  3795. }
  3796. },
  3797. {
  3798. "watchCurrent": [
  3799. [
  3800. 2
  3801. ],
  3802. "resume-token-1000"
  3803. ]
  3804. },
  3805. {
  3806. "watchSnapshot": {
  3807. "targetIds": [
  3808. ],
  3809. "version": 1000
  3810. },
  3811. "expectedSnapshotEvents": [
  3812. {
  3813. "added": [
  3814. {
  3815. "key": "collection/key1",
  3816. "options": {
  3817. "hasCommittedMutations": false,
  3818. "hasLocalMutations": false
  3819. },
  3820. "value": {
  3821. "foo": "a"
  3822. },
  3823. "version": 1000
  3824. }
  3825. ],
  3826. "errorCode": 0,
  3827. "fromCache": false,
  3828. "hasPendingWrites": false,
  3829. "query": {
  3830. "filters": [
  3831. ],
  3832. "orderBys": [
  3833. ],
  3834. "path": "collection"
  3835. }
  3836. }
  3837. ]
  3838. },
  3839. {
  3840. "watchEntity": {
  3841. "docs": [
  3842. {
  3843. "key": "collection/key2",
  3844. "options": {
  3845. "hasCommittedMutations": false,
  3846. "hasLocalMutations": false
  3847. },
  3848. "value": {
  3849. "foo": "b"
  3850. },
  3851. "version": 2000
  3852. }
  3853. ],
  3854. "targets": [
  3855. 2
  3856. ]
  3857. }
  3858. },
  3859. {
  3860. "failDatabase": [
  3861. "Get last remote snapshot version"
  3862. ]
  3863. },
  3864. {
  3865. "watchSnapshot": {
  3866. "targetIds": [
  3867. ],
  3868. "version": 1500
  3869. },
  3870. "expectedSnapshotEvents": [
  3871. {
  3872. "errorCode": 0,
  3873. "fromCache": true,
  3874. "hasPendingWrites": false,
  3875. "query": {
  3876. "filters": [
  3877. ],
  3878. "orderBys": [
  3879. ],
  3880. "path": "collection"
  3881. }
  3882. }
  3883. ],
  3884. "expectedState": {
  3885. "activeTargets": {
  3886. }
  3887. }
  3888. },
  3889. {
  3890. "failDatabase": false
  3891. },
  3892. {
  3893. "runTimer": "async_queue_retry",
  3894. "expectedState": {
  3895. "activeTargets": {
  3896. "2": {
  3897. "queries": [
  3898. {
  3899. "filters": [
  3900. ],
  3901. "orderBys": [
  3902. ],
  3903. "path": "collection"
  3904. }
  3905. ],
  3906. "resumeToken": "resume-token-1000"
  3907. }
  3908. }
  3909. }
  3910. },
  3911. {
  3912. "watchAck": [
  3913. 2
  3914. ]
  3915. },
  3916. {
  3917. "watchEntity": {
  3918. "docs": [
  3919. {
  3920. "key": "collection/key2",
  3921. "options": {
  3922. "hasCommittedMutations": false,
  3923. "hasLocalMutations": false
  3924. },
  3925. "value": {
  3926. "foo": "b"
  3927. },
  3928. "version": 2000
  3929. }
  3930. ],
  3931. "targets": [
  3932. 2
  3933. ]
  3934. }
  3935. },
  3936. {
  3937. "watchCurrent": [
  3938. [
  3939. 2
  3940. ],
  3941. "resume-token-2000"
  3942. ]
  3943. },
  3944. {
  3945. "watchSnapshot": {
  3946. "targetIds": [
  3947. ],
  3948. "version": 2000
  3949. },
  3950. "expectedSnapshotEvents": [
  3951. {
  3952. "added": [
  3953. {
  3954. "key": "collection/key2",
  3955. "options": {
  3956. "hasCommittedMutations": false,
  3957. "hasLocalMutations": false
  3958. },
  3959. "value": {
  3960. "foo": "b"
  3961. },
  3962. "version": 2000
  3963. }
  3964. ],
  3965. "errorCode": 0,
  3966. "fromCache": false,
  3967. "hasPendingWrites": false,
  3968. "query": {
  3969. "filters": [
  3970. ],
  3971. "orderBys": [
  3972. ],
  3973. "path": "collection"
  3974. }
  3975. }
  3976. ]
  3977. }
  3978. ]
  3979. },
  3980. "Recovers when write acknowledgment cannot be persisted": {
  3981. "describeName": "Persistence Recovery",
  3982. "itName": "Recovers when write acknowledgment cannot be persisted",
  3983. "tags": [
  3984. "no-ios",
  3985. "no-android"
  3986. ],
  3987. "config": {
  3988. "numClients": 1,
  3989. "useGarbageCollection": true
  3990. },
  3991. "steps": [
  3992. {
  3993. "userSet": [
  3994. "collection/a",
  3995. {
  3996. "v": 1
  3997. }
  3998. ]
  3999. },
  4000. {
  4001. "userSet": [
  4002. "collection/b",
  4003. {
  4004. "v": 2
  4005. }
  4006. ]
  4007. },
  4008. {
  4009. "userSet": [
  4010. "collection/c",
  4011. {
  4012. "v": 3
  4013. }
  4014. ]
  4015. },
  4016. {
  4017. "writeAck": {
  4018. "version": 1
  4019. },
  4020. "expectedState": {
  4021. "userCallbacks": {
  4022. "acknowledgedDocs": [
  4023. "collection/a"
  4024. ],
  4025. "rejectedDocs": [
  4026. ]
  4027. }
  4028. }
  4029. },
  4030. {
  4031. "failDatabase": [
  4032. "Acknowledge batch"
  4033. ]
  4034. },
  4035. {
  4036. "writeAck": {
  4037. "version": 2
  4038. }
  4039. },
  4040. {
  4041. "failDatabase": false
  4042. },
  4043. {
  4044. "runTimer": "async_queue_retry",
  4045. "expectedState": {
  4046. "userCallbacks": {
  4047. "acknowledgedDocs": [
  4048. "collection/b"
  4049. ],
  4050. "rejectedDocs": [
  4051. ]
  4052. }
  4053. }
  4054. },
  4055. {
  4056. "writeAck": {
  4057. "version": 1
  4058. },
  4059. "expectedState": {
  4060. "userCallbacks": {
  4061. "acknowledgedDocs": [
  4062. "collection/c"
  4063. ],
  4064. "rejectedDocs": [
  4065. ]
  4066. }
  4067. }
  4068. }
  4069. ]
  4070. },
  4071. "Recovers when write acknowledgment cannot be persisted (with restart)": {
  4072. "describeName": "Persistence Recovery",
  4073. "itName": "Recovers when write acknowledgment cannot be persisted (with restart)",
  4074. "tags": [
  4075. "durable-persistence",
  4076. "no-ios",
  4077. "no-android"
  4078. ],
  4079. "config": {
  4080. "numClients": 1,
  4081. "useGarbageCollection": true
  4082. },
  4083. "steps": [
  4084. {
  4085. "userSet": [
  4086. "collection/a",
  4087. {
  4088. "v": 1
  4089. }
  4090. ]
  4091. },
  4092. {
  4093. "userSet": [
  4094. "collection/b",
  4095. {
  4096. "v": 2
  4097. }
  4098. ]
  4099. },
  4100. {
  4101. "userSet": [
  4102. "collection/c",
  4103. {
  4104. "v": 3
  4105. }
  4106. ]
  4107. },
  4108. {
  4109. "writeAck": {
  4110. "version": 1
  4111. },
  4112. "expectedState": {
  4113. "userCallbacks": {
  4114. "acknowledgedDocs": [
  4115. "collection/a"
  4116. ],
  4117. "rejectedDocs": [
  4118. ]
  4119. }
  4120. }
  4121. },
  4122. {
  4123. "failDatabase": [
  4124. "Acknowledge batch"
  4125. ]
  4126. },
  4127. {
  4128. "writeAck": {
  4129. "keepInQueue": true,
  4130. "version": 2
  4131. }
  4132. },
  4133. {
  4134. "restart": true,
  4135. "expectedState": {
  4136. "activeLimboDocs": [
  4137. ],
  4138. "activeTargets": {
  4139. },
  4140. "enqueuedLimboDocs": [
  4141. ],
  4142. "numOutstandingWrites": 2
  4143. }
  4144. },
  4145. {
  4146. "writeAck": {
  4147. "version": 2
  4148. }
  4149. },
  4150. {
  4151. "writeAck": {
  4152. "version": 3
  4153. }
  4154. }
  4155. ]
  4156. },
  4157. "Recovers when write cannot be persisted": {
  4158. "describeName": "Persistence Recovery",
  4159. "itName": "Recovers when write cannot be persisted",
  4160. "tags": [
  4161. "no-ios",
  4162. "no-android"
  4163. ],
  4164. "config": {
  4165. "numClients": 1,
  4166. "useGarbageCollection": true
  4167. },
  4168. "steps": [
  4169. {
  4170. "userSet": [
  4171. "collection/key1",
  4172. {
  4173. "foo": "a"
  4174. }
  4175. ],
  4176. "expectedState": {
  4177. "numOutstandingWrites": 1
  4178. }
  4179. },
  4180. {
  4181. "failDatabase": [
  4182. "Locally write mutations"
  4183. ]
  4184. },
  4185. {
  4186. "userSet": [
  4187. "collection/key2",
  4188. {
  4189. "bar": "b"
  4190. }
  4191. ],
  4192. "expectedState": {
  4193. "userCallbacks": {
  4194. "acknowledgedDocs": [
  4195. ],
  4196. "rejectedDocs": [
  4197. "collection/key2"
  4198. ]
  4199. }
  4200. }
  4201. },
  4202. {
  4203. "failDatabase": [
  4204. "notifyLocalViewChanges"
  4205. ]
  4206. },
  4207. {
  4208. "userSet": [
  4209. "collection/key3",
  4210. {
  4211. "bar": "b"
  4212. }
  4213. ]
  4214. },
  4215. {
  4216. "failDatabase": false,
  4217. "expectedState": {
  4218. "numOutstandingWrites": 2
  4219. }
  4220. },
  4221. {
  4222. "userSet": [
  4223. "collection/key4",
  4224. {
  4225. "baz": "c"
  4226. }
  4227. ],
  4228. "expectedState": {
  4229. "numOutstandingWrites": 3
  4230. }
  4231. },
  4232. {
  4233. "writeAck": {
  4234. "version": 1
  4235. },
  4236. "expectedState": {
  4237. "userCallbacks": {
  4238. "acknowledgedDocs": [
  4239. "collection/key1"
  4240. ],
  4241. "rejectedDocs": [
  4242. ]
  4243. }
  4244. }
  4245. },
  4246. {
  4247. "writeAck": {
  4248. "version": 2
  4249. },
  4250. "expectedState": {
  4251. "userCallbacks": {
  4252. "acknowledgedDocs": [
  4253. "collection/key3"
  4254. ],
  4255. "rejectedDocs": [
  4256. ]
  4257. }
  4258. }
  4259. },
  4260. {
  4261. "writeAck": {
  4262. "version": 3
  4263. },
  4264. "expectedState": {
  4265. "numOutstandingWrites": 0,
  4266. "userCallbacks": {
  4267. "acknowledgedDocs": [
  4268. "collection/key4"
  4269. ],
  4270. "rejectedDocs": [
  4271. ]
  4272. }
  4273. }
  4274. }
  4275. ]
  4276. },
  4277. "Recovers when write rejection cannot be persisted": {
  4278. "describeName": "Persistence Recovery",
  4279. "itName": "Recovers when write rejection cannot be persisted",
  4280. "tags": [
  4281. "no-ios",
  4282. "no-android"
  4283. ],
  4284. "config": {
  4285. "numClients": 1,
  4286. "useGarbageCollection": true
  4287. },
  4288. "steps": [
  4289. {
  4290. "userPatch": [
  4291. "collection/a",
  4292. {
  4293. "v": 1
  4294. }
  4295. ]
  4296. },
  4297. {
  4298. "userPatch": [
  4299. "collection/a",
  4300. {
  4301. "v": 2
  4302. }
  4303. ]
  4304. },
  4305. {
  4306. "userPatch": [
  4307. "collection/c",
  4308. {
  4309. "v": 3
  4310. }
  4311. ]
  4312. },
  4313. {
  4314. "failWrite": {
  4315. "error": {
  4316. "code": 9
  4317. }
  4318. },
  4319. "expectedState": {
  4320. "userCallbacks": {
  4321. "acknowledgedDocs": [
  4322. ],
  4323. "rejectedDocs": [
  4324. "collection/a"
  4325. ]
  4326. }
  4327. }
  4328. },
  4329. {
  4330. "failDatabase": [
  4331. "Reject batch"
  4332. ]
  4333. },
  4334. {
  4335. "failWrite": {
  4336. "error": {
  4337. "code": 9
  4338. }
  4339. }
  4340. },
  4341. {
  4342. "failDatabase": false
  4343. },
  4344. {
  4345. "runTimer": "async_queue_retry",
  4346. "expectedState": {
  4347. "userCallbacks": {
  4348. "acknowledgedDocs": [
  4349. ],
  4350. "rejectedDocs": [
  4351. "collection/a"
  4352. ]
  4353. }
  4354. }
  4355. },
  4356. {
  4357. "failWrite": {
  4358. "error": {
  4359. "code": 9
  4360. }
  4361. },
  4362. "expectedState": {
  4363. "userCallbacks": {
  4364. "acknowledgedDocs": [
  4365. ],
  4366. "rejectedDocs": [
  4367. "collection/c"
  4368. ]
  4369. }
  4370. }
  4371. }
  4372. ]
  4373. },
  4374. "Surfaces local documents if notifyLocalViewChanges fails": {
  4375. "describeName": "Persistence Recovery",
  4376. "itName": "Surfaces local documents if notifyLocalViewChanges fails",
  4377. "tags": [
  4378. "no-ios",
  4379. "no-android"
  4380. ],
  4381. "config": {
  4382. "numClients": 1,
  4383. "useGarbageCollection": true
  4384. },
  4385. "steps": [
  4386. {
  4387. "userListen": {
  4388. "query": {
  4389. "filters": [
  4390. ],
  4391. "orderBys": [
  4392. ],
  4393. "path": "collection"
  4394. },
  4395. "targetId": 2
  4396. },
  4397. "expectedState": {
  4398. "activeTargets": {
  4399. "2": {
  4400. "queries": [
  4401. {
  4402. "filters": [
  4403. ],
  4404. "orderBys": [
  4405. ],
  4406. "path": "collection"
  4407. }
  4408. ],
  4409. "resumeToken": ""
  4410. }
  4411. }
  4412. }
  4413. },
  4414. {
  4415. "failDatabase": [
  4416. "notifyLocalViewChanges"
  4417. ]
  4418. },
  4419. {
  4420. "userSet": [
  4421. "collection/key1",
  4422. {
  4423. "foo": "a"
  4424. }
  4425. ],
  4426. "expectedSnapshotEvents": [
  4427. {
  4428. "added": [
  4429. {
  4430. "key": "collection/key1",
  4431. "options": {
  4432. "hasCommittedMutations": false,
  4433. "hasLocalMutations": true
  4434. },
  4435. "value": {
  4436. "foo": "a"
  4437. },
  4438. "version": 0
  4439. }
  4440. ],
  4441. "errorCode": 0,
  4442. "fromCache": true,
  4443. "hasPendingWrites": true,
  4444. "query": {
  4445. "filters": [
  4446. ],
  4447. "orderBys": [
  4448. ],
  4449. "path": "collection"
  4450. }
  4451. }
  4452. ]
  4453. },
  4454. {
  4455. "failDatabase": false
  4456. },
  4457. {
  4458. "runTimer": "async_queue_retry"
  4459. },
  4460. {
  4461. "writeAck": {
  4462. "version": 1
  4463. },
  4464. "expectedState": {
  4465. "userCallbacks": {
  4466. "acknowledgedDocs": [
  4467. "collection/key1"
  4468. ],
  4469. "rejectedDocs": [
  4470. ]
  4471. }
  4472. }
  4473. },
  4474. {
  4475. "failDatabase": [
  4476. "notifyLocalViewChanges"
  4477. ]
  4478. },
  4479. {
  4480. "watchAck": [
  4481. 2
  4482. ]
  4483. },
  4484. {
  4485. "watchEntity": {
  4486. "docs": [
  4487. {
  4488. "key": "collection/key1",
  4489. "options": {
  4490. "hasCommittedMutations": false,
  4491. "hasLocalMutations": false
  4492. },
  4493. "value": {
  4494. "foo": "a"
  4495. },
  4496. "version": 1
  4497. },
  4498. {
  4499. "key": "collection/key2",
  4500. "options": {
  4501. "hasCommittedMutations": false,
  4502. "hasLocalMutations": false
  4503. },
  4504. "value": {
  4505. "foo": "b"
  4506. },
  4507. "version": 2
  4508. }
  4509. ],
  4510. "targets": [
  4511. 2
  4512. ]
  4513. }
  4514. },
  4515. {
  4516. "watchCurrent": [
  4517. [
  4518. 2
  4519. ],
  4520. "resume-token-1000"
  4521. ]
  4522. },
  4523. {
  4524. "watchSnapshot": {
  4525. "targetIds": [
  4526. ],
  4527. "version": 1000
  4528. },
  4529. "expectedSnapshotEvents": [
  4530. {
  4531. "added": [
  4532. {
  4533. "key": "collection/key2",
  4534. "options": {
  4535. "hasCommittedMutations": false,
  4536. "hasLocalMutations": false
  4537. },
  4538. "value": {
  4539. "foo": "b"
  4540. },
  4541. "version": 2
  4542. }
  4543. ],
  4544. "errorCode": 0,
  4545. "fromCache": false,
  4546. "hasPendingWrites": false,
  4547. "metadata": [
  4548. {
  4549. "key": "collection/key1",
  4550. "options": {
  4551. "hasCommittedMutations": false,
  4552. "hasLocalMutations": false
  4553. },
  4554. "value": {
  4555. "foo": "a"
  4556. },
  4557. "version": 1
  4558. }
  4559. ],
  4560. "query": {
  4561. "filters": [
  4562. ],
  4563. "orderBys": [
  4564. ],
  4565. "path": "collection"
  4566. }
  4567. }
  4568. ]
  4569. }
  4570. ]
  4571. },
  4572. "Unlisten succeeds when target release fails": {
  4573. "describeName": "Persistence Recovery",
  4574. "itName": "Unlisten succeeds when target release fails",
  4575. "tags": [
  4576. "no-ios",
  4577. "no-android"
  4578. ],
  4579. "config": {
  4580. "numClients": 1,
  4581. "useGarbageCollection": true
  4582. },
  4583. "steps": [
  4584. {
  4585. "userListen": {
  4586. "query": {
  4587. "filters": [
  4588. ],
  4589. "orderBys": [
  4590. ],
  4591. "path": "collection"
  4592. },
  4593. "targetId": 2
  4594. },
  4595. "expectedState": {
  4596. "activeTargets": {
  4597. "2": {
  4598. "queries": [
  4599. {
  4600. "filters": [
  4601. ],
  4602. "orderBys": [
  4603. ],
  4604. "path": "collection"
  4605. }
  4606. ],
  4607. "resumeToken": ""
  4608. }
  4609. }
  4610. }
  4611. },
  4612. {
  4613. "watchAck": [
  4614. 2
  4615. ]
  4616. },
  4617. {
  4618. "watchEntity": {
  4619. "docs": [
  4620. {
  4621. "key": "collection/key1",
  4622. "options": {
  4623. "hasCommittedMutations": false,
  4624. "hasLocalMutations": false
  4625. },
  4626. "value": {
  4627. "foo": "a"
  4628. },
  4629. "version": 1
  4630. }
  4631. ],
  4632. "targets": [
  4633. 2
  4634. ]
  4635. }
  4636. },
  4637. {
  4638. "watchCurrent": [
  4639. [
  4640. 2
  4641. ],
  4642. "resume-token-1000"
  4643. ]
  4644. },
  4645. {
  4646. "watchSnapshot": {
  4647. "targetIds": [
  4648. ],
  4649. "version": 1000
  4650. },
  4651. "expectedSnapshotEvents": [
  4652. {
  4653. "added": [
  4654. {
  4655. "key": "collection/key1",
  4656. "options": {
  4657. "hasCommittedMutations": false,
  4658. "hasLocalMutations": false
  4659. },
  4660. "value": {
  4661. "foo": "a"
  4662. },
  4663. "version": 1
  4664. }
  4665. ],
  4666. "errorCode": 0,
  4667. "fromCache": false,
  4668. "hasPendingWrites": false,
  4669. "query": {
  4670. "filters": [
  4671. ],
  4672. "orderBys": [
  4673. ],
  4674. "path": "collection"
  4675. }
  4676. }
  4677. ]
  4678. },
  4679. {
  4680. "failDatabase": [
  4681. "Release target"
  4682. ]
  4683. },
  4684. {
  4685. "userUnlisten": [
  4686. 2,
  4687. {
  4688. "filters": [
  4689. ],
  4690. "orderBys": [
  4691. ],
  4692. "path": "collection"
  4693. }
  4694. ],
  4695. "expectedState": {
  4696. "activeTargets": {
  4697. }
  4698. }
  4699. }
  4700. ]
  4701. },
  4702. "User change handles transaction failures (with recovery)": {
  4703. "describeName": "Persistence Recovery",
  4704. "itName": "User change handles transaction failures (with recovery)",
  4705. "tags": [
  4706. "durable-persistence",
  4707. "no-ios",
  4708. "no-android"
  4709. ],
  4710. "config": {
  4711. "numClients": 1,
  4712. "useGarbageCollection": true
  4713. },
  4714. "steps": [
  4715. {
  4716. "changeUser": "user1"
  4717. },
  4718. {
  4719. "userSet": [
  4720. "collection/key1",
  4721. {
  4722. "foo": "a"
  4723. }
  4724. ]
  4725. },
  4726. {
  4727. "userListen": {
  4728. "query": {
  4729. "filters": [
  4730. ],
  4731. "orderBys": [
  4732. ],
  4733. "path": "collection"
  4734. },
  4735. "targetId": 2
  4736. },
  4737. "expectedSnapshotEvents": [
  4738. {
  4739. "added": [
  4740. {
  4741. "key": "collection/key1",
  4742. "options": {
  4743. "hasCommittedMutations": false,
  4744. "hasLocalMutations": true
  4745. },
  4746. "value": {
  4747. "foo": "a"
  4748. },
  4749. "version": 0
  4750. }
  4751. ],
  4752. "errorCode": 0,
  4753. "fromCache": true,
  4754. "hasPendingWrites": true,
  4755. "query": {
  4756. "filters": [
  4757. ],
  4758. "orderBys": [
  4759. ],
  4760. "path": "collection"
  4761. }
  4762. }
  4763. ],
  4764. "expectedState": {
  4765. "activeTargets": {
  4766. "2": {
  4767. "queries": [
  4768. {
  4769. "filters": [
  4770. ],
  4771. "orderBys": [
  4772. ],
  4773. "path": "collection"
  4774. }
  4775. ],
  4776. "resumeToken": ""
  4777. }
  4778. }
  4779. }
  4780. },
  4781. {
  4782. "failDatabase": [
  4783. "Handle user change"
  4784. ]
  4785. },
  4786. {
  4787. "changeUser": "user2",
  4788. "expectedState": {
  4789. "activeTargets": {
  4790. }
  4791. }
  4792. },
  4793. {
  4794. "failDatabase": false
  4795. },
  4796. {
  4797. "runTimer": "async_queue_retry",
  4798. "expectedSnapshotEvents": [
  4799. {
  4800. "errorCode": 0,
  4801. "fromCache": true,
  4802. "hasPendingWrites": false,
  4803. "query": {
  4804. "filters": [
  4805. ],
  4806. "orderBys": [
  4807. ],
  4808. "path": "collection"
  4809. },
  4810. "removed": [
  4811. {
  4812. "key": "collection/key1",
  4813. "options": {
  4814. "hasCommittedMutations": false,
  4815. "hasLocalMutations": true
  4816. },
  4817. "value": {
  4818. "foo": "a"
  4819. },
  4820. "version": 0
  4821. }
  4822. ]
  4823. }
  4824. ],
  4825. "expectedState": {
  4826. "activeTargets": {
  4827. "2": {
  4828. "queries": [
  4829. {
  4830. "filters": [
  4831. ],
  4832. "orderBys": [
  4833. ],
  4834. "path": "collection"
  4835. }
  4836. ],
  4837. "resumeToken": ""
  4838. }
  4839. }
  4840. }
  4841. },
  4842. {
  4843. "failDatabase": [
  4844. "Handle user change"
  4845. ]
  4846. },
  4847. {
  4848. "changeUser": "user1",
  4849. "expectedState": {
  4850. "activeTargets": {
  4851. }
  4852. }
  4853. },
  4854. {
  4855. "failDatabase": false
  4856. },
  4857. {
  4858. "runTimer": "async_queue_retry",
  4859. "expectedSnapshotEvents": [
  4860. {
  4861. "added": [
  4862. {
  4863. "key": "collection/key1",
  4864. "options": {
  4865. "hasCommittedMutations": false,
  4866. "hasLocalMutations": true
  4867. },
  4868. "value": {
  4869. "foo": "a"
  4870. },
  4871. "version": 0
  4872. }
  4873. ],
  4874. "errorCode": 0,
  4875. "fromCache": true,
  4876. "hasPendingWrites": true,
  4877. "query": {
  4878. "filters": [
  4879. ],
  4880. "orderBys": [
  4881. ],
  4882. "path": "collection"
  4883. }
  4884. }
  4885. ],
  4886. "expectedState": {
  4887. "activeTargets": {
  4888. "2": {
  4889. "queries": [
  4890. {
  4891. "filters": [
  4892. ],
  4893. "orderBys": [
  4894. ],
  4895. "path": "collection"
  4896. }
  4897. ],
  4898. "resumeToken": ""
  4899. }
  4900. }
  4901. }
  4902. }
  4903. ]
  4904. },
  4905. "Write is acknowledged by primary client (with recovery)": {
  4906. "describeName": "Persistence Recovery",
  4907. "itName": "Write is acknowledged by primary client (with recovery)",
  4908. "tags": [
  4909. "multi-client",
  4910. "no-ios",
  4911. "no-android"
  4912. ],
  4913. "config": {
  4914. "numClients": 2,
  4915. "useGarbageCollection": false
  4916. },
  4917. "steps": [
  4918. {
  4919. "clientIndex": 0,
  4920. "drainQueue": true,
  4921. "expectedState": {
  4922. "isPrimary": true
  4923. }
  4924. },
  4925. {
  4926. "clientIndex": 1,
  4927. "drainQueue": true,
  4928. "expectedState": {
  4929. "isPrimary": false
  4930. }
  4931. },
  4932. {
  4933. "clientIndex": 1,
  4934. "userSet": [
  4935. "collection/a",
  4936. {
  4937. "v": 1
  4938. }
  4939. ]
  4940. },
  4941. {
  4942. "clientIndex": 1,
  4943. "failDatabase": [
  4944. "Lookup mutation documents"
  4945. ]
  4946. },
  4947. {
  4948. "clientIndex": 0,
  4949. "drainQueue": true
  4950. },
  4951. {
  4952. "clientIndex": 0,
  4953. "writeAck": {
  4954. "version": 1
  4955. }
  4956. },
  4957. {
  4958. "clientIndex": 1,
  4959. "drainQueue": true
  4960. },
  4961. {
  4962. "clientIndex": 1,
  4963. "runTimer": "async_queue_retry"
  4964. },
  4965. {
  4966. "clientIndex": 1,
  4967. "failDatabase": false
  4968. },
  4969. {
  4970. "clientIndex": 1,
  4971. "runTimer": "async_queue_retry",
  4972. "expectedState": {
  4973. "userCallbacks": {
  4974. "acknowledgedDocs": [
  4975. "collection/a"
  4976. ],
  4977. "rejectedDocs": [
  4978. ]
  4979. }
  4980. }
  4981. }
  4982. ]
  4983. },
  4984. "Writes are pending until acknowledgement is persisted": {
  4985. "describeName": "Persistence Recovery",
  4986. "itName": "Writes are pending until acknowledgement is persisted",
  4987. "tags": [
  4988. "no-ios",
  4989. "no-android"
  4990. ],
  4991. "config": {
  4992. "numClients": 1,
  4993. "useGarbageCollection": true
  4994. },
  4995. "steps": [
  4996. {
  4997. "userListen": {
  4998. "query": {
  4999. "filters": [
  5000. ],
  5001. "orderBys": [
  5002. ],
  5003. "path": "collection"
  5004. },
  5005. "targetId": 2
  5006. },
  5007. "expectedState": {
  5008. "activeTargets": {
  5009. "2": {
  5010. "queries": [
  5011. {
  5012. "filters": [
  5013. ],
  5014. "orderBys": [
  5015. ],
  5016. "path": "collection"
  5017. }
  5018. ],
  5019. "resumeToken": ""
  5020. }
  5021. }
  5022. }
  5023. },
  5024. {
  5025. "watchAck": [
  5026. 2
  5027. ]
  5028. },
  5029. {
  5030. "watchEntity": {
  5031. "docs": [
  5032. ],
  5033. "targets": [
  5034. 2
  5035. ]
  5036. }
  5037. },
  5038. {
  5039. "watchCurrent": [
  5040. [
  5041. 2
  5042. ],
  5043. "resume-token-1000"
  5044. ]
  5045. },
  5046. {
  5047. "watchSnapshot": {
  5048. "targetIds": [
  5049. ],
  5050. "version": 1000
  5051. },
  5052. "expectedSnapshotEvents": [
  5053. {
  5054. "errorCode": 0,
  5055. "fromCache": false,
  5056. "hasPendingWrites": false,
  5057. "query": {
  5058. "filters": [
  5059. ],
  5060. "orderBys": [
  5061. ],
  5062. "path": "collection"
  5063. }
  5064. }
  5065. ]
  5066. },
  5067. {
  5068. "userSet": [
  5069. "collection/a",
  5070. {
  5071. "v": 1
  5072. }
  5073. ],
  5074. "expectedSnapshotEvents": [
  5075. {
  5076. "added": [
  5077. {
  5078. "key": "collection/a",
  5079. "options": {
  5080. "hasCommittedMutations": false,
  5081. "hasLocalMutations": true
  5082. },
  5083. "value": {
  5084. "v": 1
  5085. },
  5086. "version": 0
  5087. }
  5088. ],
  5089. "errorCode": 0,
  5090. "fromCache": false,
  5091. "hasPendingWrites": true,
  5092. "query": {
  5093. "filters": [
  5094. ],
  5095. "orderBys": [
  5096. ],
  5097. "path": "collection"
  5098. }
  5099. }
  5100. ]
  5101. },
  5102. {
  5103. "userSet": [
  5104. "collection/b",
  5105. {
  5106. "v": 2
  5107. }
  5108. ],
  5109. "expectedSnapshotEvents": [
  5110. {
  5111. "added": [
  5112. {
  5113. "key": "collection/b",
  5114. "options": {
  5115. "hasCommittedMutations": false,
  5116. "hasLocalMutations": true
  5117. },
  5118. "value": {
  5119. "v": 2
  5120. },
  5121. "version": 0
  5122. }
  5123. ],
  5124. "errorCode": 0,
  5125. "fromCache": false,
  5126. "hasPendingWrites": true,
  5127. "query": {
  5128. "filters": [
  5129. ],
  5130. "orderBys": [
  5131. ],
  5132. "path": "collection"
  5133. }
  5134. }
  5135. ]
  5136. },
  5137. {
  5138. "failDatabase": [
  5139. "Acknowledge batch"
  5140. ]
  5141. },
  5142. {
  5143. "writeAck": {
  5144. "version": 1
  5145. },
  5146. "expectedSnapshotEvents": [
  5147. {
  5148. "errorCode": 0,
  5149. "fromCache": true,
  5150. "hasPendingWrites": true,
  5151. "query": {
  5152. "filters": [
  5153. ],
  5154. "orderBys": [
  5155. ],
  5156. "path": "collection"
  5157. }
  5158. }
  5159. ],
  5160. "expectedState": {
  5161. "activeTargets": {
  5162. }
  5163. }
  5164. },
  5165. {
  5166. "failDatabase": false
  5167. },
  5168. {
  5169. "runTimer": "async_queue_retry",
  5170. "expectedState": {
  5171. "activeTargets": {
  5172. "2": {
  5173. "queries": [
  5174. {
  5175. "filters": [
  5176. ],
  5177. "orderBys": [
  5178. ],
  5179. "path": "collection"
  5180. }
  5181. ],
  5182. "resumeToken": "resume-token-1000"
  5183. }
  5184. },
  5185. "userCallbacks": {
  5186. "acknowledgedDocs": [
  5187. "collection/a"
  5188. ],
  5189. "rejectedDocs": [
  5190. ]
  5191. }
  5192. }
  5193. },
  5194. {
  5195. "watchAck": [
  5196. 2
  5197. ]
  5198. },
  5199. {
  5200. "watchEntity": {
  5201. "docs": [
  5202. {
  5203. "key": "collection/a",
  5204. "options": {
  5205. "hasCommittedMutations": false,
  5206. "hasLocalMutations": false
  5207. },
  5208. "value": {
  5209. "v": 1
  5210. },
  5211. "version": 1001
  5212. }
  5213. ],
  5214. "targets": [
  5215. 2
  5216. ]
  5217. }
  5218. },
  5219. {
  5220. "watchCurrent": [
  5221. [
  5222. 2
  5223. ],
  5224. "resume-token-1001"
  5225. ]
  5226. },
  5227. {
  5228. "watchSnapshot": {
  5229. "targetIds": [
  5230. ],
  5231. "version": 1001
  5232. },
  5233. "expectedSnapshotEvents": [
  5234. {
  5235. "errorCode": 0,
  5236. "fromCache": false,
  5237. "hasPendingWrites": true,
  5238. "metadata": [
  5239. {
  5240. "key": "collection/a",
  5241. "options": {
  5242. "hasCommittedMutations": false,
  5243. "hasLocalMutations": false
  5244. },
  5245. "value": {
  5246. "v": 1
  5247. },
  5248. "version": 1001
  5249. }
  5250. ],
  5251. "query": {
  5252. "filters": [
  5253. ],
  5254. "orderBys": [
  5255. ],
  5256. "path": "collection"
  5257. }
  5258. }
  5259. ]
  5260. },
  5261. {
  5262. "writeAck": {
  5263. "version": 2
  5264. },
  5265. "expectedState": {
  5266. "userCallbacks": {
  5267. "acknowledgedDocs": [
  5268. "collection/b"
  5269. ],
  5270. "rejectedDocs": [
  5271. ]
  5272. }
  5273. }
  5274. },
  5275. {
  5276. "watchEntity": {
  5277. "docs": [
  5278. {
  5279. "key": "collection/b",
  5280. "options": {
  5281. "hasCommittedMutations": false,
  5282. "hasLocalMutations": false
  5283. },
  5284. "value": {
  5285. "v": 2
  5286. },
  5287. "version": 1002
  5288. }
  5289. ],
  5290. "targets": [
  5291. 2
  5292. ]
  5293. }
  5294. },
  5295. {
  5296. "watchSnapshot": {
  5297. "targetIds": [
  5298. ],
  5299. "version": 1002
  5300. },
  5301. "expectedSnapshotEvents": [
  5302. {
  5303. "errorCode": 0,
  5304. "fromCache": false,
  5305. "hasPendingWrites": false,
  5306. "metadata": [
  5307. {
  5308. "key": "collection/b",
  5309. "options": {
  5310. "hasCommittedMutations": false,
  5311. "hasLocalMutations": false
  5312. },
  5313. "value": {
  5314. "v": 2
  5315. },
  5316. "version": 1002
  5317. }
  5318. ],
  5319. "query": {
  5320. "filters": [
  5321. ],
  5322. "orderBys": [
  5323. ],
  5324. "path": "collection"
  5325. }
  5326. }
  5327. ]
  5328. }
  5329. ]
  5330. }
  5331. }