recovery_spec_test.json 113 KB

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