write_spec_test.json 237 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824
  1. {
  2. "Two sequential writes to different documents smoke test.": {
  3. "describeName": "Writes:",
  4. "itName": "Two sequential writes to different documents smoke test.",
  5. "tags": [],
  6. "config": {
  7. "useGarbageCollection": true,
  8. "numClients": 1
  9. },
  10. "steps": [
  11. {
  12. "userListen": [
  13. 2,
  14. {
  15. "path": "collection",
  16. "filters": [],
  17. "orderBys": []
  18. }
  19. ],
  20. "expectedState": {
  21. "activeTargets": {
  22. "2": {
  23. "queries": [
  24. {
  25. "path": "collection",
  26. "filters": [],
  27. "orderBys": []
  28. }
  29. ],
  30. "resumeToken": ""
  31. }
  32. }
  33. }
  34. },
  35. {
  36. "watchAck": [
  37. 2
  38. ]
  39. },
  40. {
  41. "watchEntity": {
  42. "docs": [
  43. {
  44. "key": "collection/a",
  45. "version": 1000,
  46. "value": {
  47. "v": 1
  48. },
  49. "options": {
  50. "hasLocalMutations": false,
  51. "hasCommittedMutations": false
  52. }
  53. },
  54. {
  55. "key": "collection/b",
  56. "version": 500,
  57. "value": {
  58. "v": 1
  59. },
  60. "options": {
  61. "hasLocalMutations": false,
  62. "hasCommittedMutations": false
  63. }
  64. }
  65. ],
  66. "targets": [
  67. 2
  68. ]
  69. }
  70. },
  71. {
  72. "watchCurrent": [
  73. [
  74. 2
  75. ],
  76. "resume-token-1000"
  77. ]
  78. },
  79. {
  80. "watchSnapshot": {
  81. "version": 1000,
  82. "targetIds": []
  83. },
  84. "expectedSnapshotEvents": [
  85. {
  86. "query": {
  87. "path": "collection",
  88. "filters": [],
  89. "orderBys": []
  90. },
  91. "added": [
  92. {
  93. "key": "collection/a",
  94. "version": 1000,
  95. "value": {
  96. "v": 1
  97. },
  98. "options": {
  99. "hasLocalMutations": false,
  100. "hasCommittedMutations": false
  101. }
  102. },
  103. {
  104. "key": "collection/b",
  105. "version": 500,
  106. "value": {
  107. "v": 1
  108. },
  109. "options": {
  110. "hasLocalMutations": false,
  111. "hasCommittedMutations": false
  112. }
  113. }
  114. ],
  115. "errorCode": 0,
  116. "fromCache": false,
  117. "hasPendingWrites": false
  118. }
  119. ]
  120. },
  121. {
  122. "userSet": [
  123. "collection/a",
  124. {
  125. "v": 2
  126. }
  127. ],
  128. "expectedSnapshotEvents": [
  129. {
  130. "query": {
  131. "path": "collection",
  132. "filters": [],
  133. "orderBys": []
  134. },
  135. "modified": [
  136. {
  137. "key": "collection/a",
  138. "version": 1000,
  139. "value": {
  140. "v": 2
  141. },
  142. "options": {
  143. "hasLocalMutations": true,
  144. "hasCommittedMutations": false
  145. }
  146. }
  147. ],
  148. "errorCode": 0,
  149. "fromCache": false,
  150. "hasPendingWrites": true
  151. }
  152. ]
  153. },
  154. {
  155. "watchEntity": {
  156. "docs": [
  157. {
  158. "key": "collection/a",
  159. "version": 2000,
  160. "value": {
  161. "v": 2
  162. },
  163. "options": {
  164. "hasLocalMutations": false,
  165. "hasCommittedMutations": false
  166. }
  167. }
  168. ],
  169. "targets": [
  170. 2
  171. ]
  172. }
  173. },
  174. {
  175. "watchSnapshot": {
  176. "version": 2000,
  177. "targetIds": []
  178. }
  179. },
  180. {
  181. "writeAck": {
  182. "version": 2000
  183. },
  184. "expectedState": {
  185. "userCallbacks": {
  186. "acknowledgedDocs": [
  187. "collection/a"
  188. ],
  189. "rejectedDocs": []
  190. }
  191. },
  192. "expectedSnapshotEvents": [
  193. {
  194. "query": {
  195. "path": "collection",
  196. "filters": [],
  197. "orderBys": []
  198. },
  199. "metadata": [
  200. {
  201. "key": "collection/a",
  202. "version": 2000,
  203. "value": {
  204. "v": 2
  205. },
  206. "options": {
  207. "hasLocalMutations": false,
  208. "hasCommittedMutations": false
  209. }
  210. }
  211. ],
  212. "errorCode": 0,
  213. "fromCache": false,
  214. "hasPendingWrites": false
  215. }
  216. ]
  217. },
  218. {
  219. "userSet": [
  220. "collection/b",
  221. {
  222. "v": 2
  223. }
  224. ],
  225. "expectedSnapshotEvents": [
  226. {
  227. "query": {
  228. "path": "collection",
  229. "filters": [],
  230. "orderBys": []
  231. },
  232. "modified": [
  233. {
  234. "key": "collection/b",
  235. "version": 500,
  236. "value": {
  237. "v": 2
  238. },
  239. "options": {
  240. "hasLocalMutations": true,
  241. "hasCommittedMutations": false
  242. }
  243. }
  244. ],
  245. "errorCode": 0,
  246. "fromCache": false,
  247. "hasPendingWrites": true
  248. }
  249. ]
  250. },
  251. {
  252. "watchEntity": {
  253. "docs": [
  254. {
  255. "key": "collection/b",
  256. "version": 2500,
  257. "value": {
  258. "v": 2
  259. },
  260. "options": {
  261. "hasLocalMutations": false,
  262. "hasCommittedMutations": false
  263. }
  264. }
  265. ],
  266. "targets": [
  267. 2
  268. ]
  269. }
  270. },
  271. {
  272. "watchSnapshot": {
  273. "version": 3000,
  274. "targetIds": []
  275. }
  276. },
  277. {
  278. "writeAck": {
  279. "version": 2500
  280. },
  281. "expectedState": {
  282. "userCallbacks": {
  283. "acknowledgedDocs": [
  284. "collection/b"
  285. ],
  286. "rejectedDocs": []
  287. }
  288. },
  289. "expectedSnapshotEvents": [
  290. {
  291. "query": {
  292. "path": "collection",
  293. "filters": [],
  294. "orderBys": []
  295. },
  296. "metadata": [
  297. {
  298. "key": "collection/b",
  299. "version": 2500,
  300. "value": {
  301. "v": 2
  302. },
  303. "options": {
  304. "hasLocalMutations": false,
  305. "hasCommittedMutations": false
  306. }
  307. }
  308. ],
  309. "errorCode": 0,
  310. "fromCache": false,
  311. "hasPendingWrites": false
  312. }
  313. ]
  314. }
  315. ]
  316. },
  317. "Event is raised for a local set before and after the write ack": {
  318. "describeName": "Writes:",
  319. "itName": "Event is raised for a local set before and after the write ack",
  320. "tags": [],
  321. "config": {
  322. "useGarbageCollection": true,
  323. "numClients": 1
  324. },
  325. "steps": [
  326. {
  327. "userListen": [
  328. 2,
  329. {
  330. "path": "collection/key",
  331. "filters": [],
  332. "orderBys": []
  333. }
  334. ],
  335. "expectedState": {
  336. "activeTargets": {
  337. "2": {
  338. "queries": [
  339. {
  340. "path": "collection/key",
  341. "filters": [],
  342. "orderBys": []
  343. }
  344. ],
  345. "resumeToken": ""
  346. }
  347. }
  348. }
  349. },
  350. {
  351. "watchAck": [
  352. 2
  353. ]
  354. },
  355. {
  356. "watchEntity": {
  357. "docs": [
  358. {
  359. "key": "collection/key",
  360. "version": 1000,
  361. "value": {
  362. "v": 1
  363. },
  364. "options": {
  365. "hasLocalMutations": false,
  366. "hasCommittedMutations": false
  367. }
  368. }
  369. ],
  370. "targets": [
  371. 2
  372. ]
  373. }
  374. },
  375. {
  376. "watchCurrent": [
  377. [
  378. 2
  379. ],
  380. "resume-token-1000"
  381. ]
  382. },
  383. {
  384. "watchSnapshot": {
  385. "version": 1000,
  386. "targetIds": []
  387. },
  388. "expectedSnapshotEvents": [
  389. {
  390. "query": {
  391. "path": "collection/key",
  392. "filters": [],
  393. "orderBys": []
  394. },
  395. "added": [
  396. {
  397. "key": "collection/key",
  398. "version": 1000,
  399. "value": {
  400. "v": 1
  401. },
  402. "options": {
  403. "hasLocalMutations": false,
  404. "hasCommittedMutations": false
  405. }
  406. }
  407. ],
  408. "errorCode": 0,
  409. "fromCache": false,
  410. "hasPendingWrites": false
  411. }
  412. ]
  413. },
  414. {
  415. "userSet": [
  416. "collection/key",
  417. {
  418. "v": 2
  419. }
  420. ],
  421. "expectedSnapshotEvents": [
  422. {
  423. "query": {
  424. "path": "collection/key",
  425. "filters": [],
  426. "orderBys": []
  427. },
  428. "modified": [
  429. {
  430. "key": "collection/key",
  431. "version": 1000,
  432. "value": {
  433. "v": 2
  434. },
  435. "options": {
  436. "hasLocalMutations": true,
  437. "hasCommittedMutations": false
  438. }
  439. }
  440. ],
  441. "errorCode": 0,
  442. "fromCache": false,
  443. "hasPendingWrites": true
  444. }
  445. ]
  446. },
  447. {
  448. "watchEntity": {
  449. "docs": [
  450. {
  451. "key": "collection/key",
  452. "version": 2000,
  453. "value": {
  454. "v": 2
  455. },
  456. "options": {
  457. "hasLocalMutations": false,
  458. "hasCommittedMutations": false
  459. }
  460. }
  461. ],
  462. "targets": [
  463. 2
  464. ]
  465. }
  466. },
  467. {
  468. "watchSnapshot": {
  469. "version": 2000,
  470. "targetIds": []
  471. }
  472. },
  473. {
  474. "writeAck": {
  475. "version": 2000
  476. },
  477. "expectedState": {
  478. "userCallbacks": {
  479. "acknowledgedDocs": [
  480. "collection/key"
  481. ],
  482. "rejectedDocs": []
  483. }
  484. },
  485. "expectedSnapshotEvents": [
  486. {
  487. "query": {
  488. "path": "collection/key",
  489. "filters": [],
  490. "orderBys": []
  491. },
  492. "metadata": [
  493. {
  494. "key": "collection/key",
  495. "version": 2000,
  496. "value": {
  497. "v": 2
  498. },
  499. "options": {
  500. "hasLocalMutations": false,
  501. "hasCommittedMutations": false
  502. }
  503. }
  504. ],
  505. "errorCode": 0,
  506. "fromCache": false,
  507. "hasPendingWrites": false
  508. }
  509. ]
  510. }
  511. ]
  512. },
  513. "Raises snapshot with 'hasPendingWrites' for unacknowledged write": {
  514. "describeName": "Writes:",
  515. "itName": "Raises snapshot with 'hasPendingWrites' for unacknowledged write",
  516. "tags": [],
  517. "config": {
  518. "useGarbageCollection": false,
  519. "numClients": 1
  520. },
  521. "steps": [
  522. {
  523. "userSet": [
  524. "collection/doc",
  525. {
  526. "v": 1
  527. }
  528. ]
  529. },
  530. {
  531. "userListen": [
  532. 2,
  533. {
  534. "path": "collection",
  535. "filters": [],
  536. "orderBys": []
  537. }
  538. ],
  539. "expectedState": {
  540. "activeTargets": {
  541. "2": {
  542. "queries": [
  543. {
  544. "path": "collection",
  545. "filters": [],
  546. "orderBys": []
  547. }
  548. ],
  549. "resumeToken": ""
  550. }
  551. }
  552. },
  553. "expectedSnapshotEvents": [
  554. {
  555. "query": {
  556. "path": "collection",
  557. "filters": [],
  558. "orderBys": []
  559. },
  560. "added": [
  561. {
  562. "key": "collection/doc",
  563. "version": 0,
  564. "value": {
  565. "v": 1
  566. },
  567. "options": {
  568. "hasLocalMutations": true,
  569. "hasCommittedMutations": false
  570. }
  571. }
  572. ],
  573. "errorCode": 0,
  574. "fromCache": true,
  575. "hasPendingWrites": true
  576. }
  577. ]
  578. }
  579. ]
  580. },
  581. "Doesn't raise 'hasPendingWrites' for committed write and new listen": {
  582. "describeName": "Writes:",
  583. "itName": "Doesn't raise 'hasPendingWrites' for committed write and new listen",
  584. "tags": [],
  585. "config": {
  586. "useGarbageCollection": false,
  587. "numClients": 1
  588. },
  589. "steps": [
  590. {
  591. "userSet": [
  592. "collection/doc",
  593. {
  594. "v": 1
  595. }
  596. ]
  597. },
  598. {
  599. "writeAck": {
  600. "version": 1000
  601. },
  602. "expectedState": {
  603. "userCallbacks": {
  604. "acknowledgedDocs": [
  605. "collection/doc"
  606. ],
  607. "rejectedDocs": []
  608. }
  609. }
  610. },
  611. {
  612. "userListen": [
  613. 2,
  614. {
  615. "path": "collection",
  616. "filters": [],
  617. "orderBys": []
  618. }
  619. ],
  620. "expectedState": {
  621. "activeTargets": {
  622. "2": {
  623. "queries": [
  624. {
  625. "path": "collection",
  626. "filters": [],
  627. "orderBys": []
  628. }
  629. ],
  630. "resumeToken": ""
  631. }
  632. }
  633. },
  634. "expectedSnapshotEvents": [
  635. {
  636. "query": {
  637. "path": "collection",
  638. "filters": [],
  639. "orderBys": []
  640. },
  641. "added": [
  642. {
  643. "key": "collection/doc",
  644. "version": 1000,
  645. "value": {
  646. "v": 1
  647. },
  648. "options": {
  649. "hasLocalMutations": false,
  650. "hasCommittedMutations": true
  651. }
  652. }
  653. ],
  654. "errorCode": 0,
  655. "fromCache": true,
  656. "hasPendingWrites": false
  657. }
  658. ]
  659. }
  660. ]
  661. },
  662. "Doesn't raise event for document with pending patch": {
  663. "describeName": "Writes:",
  664. "itName": "Doesn't raise event for document with pending patch",
  665. "tags": [],
  666. "config": {
  667. "useGarbageCollection": false,
  668. "numClients": 1
  669. },
  670. "steps": [
  671. {
  672. "userListen": [
  673. 2,
  674. {
  675. "path": "collection",
  676. "filters": [],
  677. "orderBys": []
  678. }
  679. ],
  680. "expectedState": {
  681. "activeTargets": {
  682. "2": {
  683. "queries": [
  684. {
  685. "path": "collection",
  686. "filters": [],
  687. "orderBys": []
  688. }
  689. ],
  690. "resumeToken": ""
  691. }
  692. }
  693. }
  694. },
  695. {
  696. "watchAck": [
  697. 2
  698. ]
  699. },
  700. {
  701. "watchEntity": {
  702. "docs": [],
  703. "targets": [
  704. 2
  705. ]
  706. }
  707. },
  708. {
  709. "watchCurrent": [
  710. [
  711. 2
  712. ],
  713. "resume-token-250"
  714. ]
  715. },
  716. {
  717. "watchSnapshot": {
  718. "version": 250,
  719. "targetIds": []
  720. },
  721. "expectedSnapshotEvents": [
  722. {
  723. "query": {
  724. "path": "collection",
  725. "filters": [],
  726. "orderBys": []
  727. },
  728. "errorCode": 0,
  729. "fromCache": false,
  730. "hasPendingWrites": false
  731. }
  732. ]
  733. },
  734. {
  735. "userPatch": [
  736. "collection/doc",
  737. {
  738. "v": 2
  739. }
  740. ]
  741. },
  742. {
  743. "writeAck": {
  744. "version": 1000
  745. },
  746. "expectedState": {
  747. "userCallbacks": {
  748. "acknowledgedDocs": [
  749. "collection/doc"
  750. ],
  751. "rejectedDocs": []
  752. }
  753. }
  754. },
  755. {
  756. "watchEntity": {
  757. "docs": [
  758. {
  759. "key": "collection/doc",
  760. "version": 500,
  761. "value": {
  762. "v": 1
  763. },
  764. "options": {
  765. "hasLocalMutations": false,
  766. "hasCommittedMutations": false
  767. }
  768. }
  769. ],
  770. "targets": [
  771. 2
  772. ]
  773. }
  774. },
  775. {
  776. "watchSnapshot": {
  777. "version": 500,
  778. "targetIds": []
  779. }
  780. },
  781. {
  782. "watchEntity": {
  783. "docs": [
  784. {
  785. "key": "collection/doc",
  786. "version": 1000,
  787. "value": {
  788. "v": 2
  789. },
  790. "options": {
  791. "hasLocalMutations": false,
  792. "hasCommittedMutations": false
  793. }
  794. }
  795. ],
  796. "targets": [
  797. 2
  798. ]
  799. }
  800. },
  801. {
  802. "watchSnapshot": {
  803. "version": 1000,
  804. "targetIds": []
  805. },
  806. "expectedSnapshotEvents": [
  807. {
  808. "query": {
  809. "path": "collection",
  810. "filters": [],
  811. "orderBys": []
  812. },
  813. "added": [
  814. {
  815. "key": "collection/doc",
  816. "version": 1000,
  817. "value": {
  818. "v": 2
  819. },
  820. "options": {
  821. "hasLocalMutations": false,
  822. "hasCommittedMutations": false
  823. }
  824. }
  825. ],
  826. "errorCode": 0,
  827. "fromCache": false,
  828. "hasPendingWrites": false
  829. }
  830. ]
  831. }
  832. ]
  833. },
  834. "Cache will not keep data for an outdated write ack": {
  835. "describeName": "Writes:",
  836. "itName": "Cache will not keep data for an outdated write ack",
  837. "tags": [],
  838. "config": {
  839. "useGarbageCollection": true,
  840. "numClients": 1
  841. },
  842. "steps": [
  843. {
  844. "userListen": [
  845. 2,
  846. {
  847. "path": "collection/key",
  848. "filters": [],
  849. "orderBys": []
  850. }
  851. ],
  852. "expectedState": {
  853. "activeTargets": {
  854. "2": {
  855. "queries": [
  856. {
  857. "path": "collection/key",
  858. "filters": [],
  859. "orderBys": []
  860. }
  861. ],
  862. "resumeToken": ""
  863. }
  864. }
  865. }
  866. },
  867. {
  868. "watchAck": [
  869. 2
  870. ]
  871. },
  872. {
  873. "watchEntity": {
  874. "docs": [
  875. {
  876. "key": "collection/key",
  877. "version": 1000,
  878. "value": {
  879. "v": 1
  880. },
  881. "options": {
  882. "hasLocalMutations": false,
  883. "hasCommittedMutations": false
  884. }
  885. }
  886. ],
  887. "targets": [
  888. 2
  889. ]
  890. }
  891. },
  892. {
  893. "watchCurrent": [
  894. [
  895. 2
  896. ],
  897. "resume-token-1000"
  898. ]
  899. },
  900. {
  901. "watchSnapshot": {
  902. "version": 1000,
  903. "targetIds": []
  904. },
  905. "expectedSnapshotEvents": [
  906. {
  907. "query": {
  908. "path": "collection/key",
  909. "filters": [],
  910. "orderBys": []
  911. },
  912. "added": [
  913. {
  914. "key": "collection/key",
  915. "version": 1000,
  916. "value": {
  917. "v": 1
  918. },
  919. "options": {
  920. "hasLocalMutations": false,
  921. "hasCommittedMutations": false
  922. }
  923. }
  924. ],
  925. "errorCode": 0,
  926. "fromCache": false,
  927. "hasPendingWrites": false
  928. }
  929. ]
  930. },
  931. {
  932. "userSet": [
  933. "collection/key",
  934. {
  935. "v": 2
  936. }
  937. ],
  938. "expectedSnapshotEvents": [
  939. {
  940. "query": {
  941. "path": "collection/key",
  942. "filters": [],
  943. "orderBys": []
  944. },
  945. "modified": [
  946. {
  947. "key": "collection/key",
  948. "version": 1000,
  949. "value": {
  950. "v": 2
  951. },
  952. "options": {
  953. "hasLocalMutations": true,
  954. "hasCommittedMutations": false
  955. }
  956. }
  957. ],
  958. "errorCode": 0,
  959. "fromCache": false,
  960. "hasPendingWrites": true
  961. }
  962. ]
  963. },
  964. {
  965. "watchEntity": {
  966. "docs": [
  967. {
  968. "key": "collection/key",
  969. "version": 10000,
  970. "value": {
  971. "v": 3
  972. },
  973. "options": {
  974. "hasLocalMutations": false,
  975. "hasCommittedMutations": false
  976. }
  977. }
  978. ],
  979. "targets": [
  980. 2
  981. ]
  982. }
  983. },
  984. {
  985. "watchSnapshot": {
  986. "version": 10000,
  987. "targetIds": []
  988. }
  989. },
  990. {
  991. "writeAck": {
  992. "version": 2000
  993. },
  994. "expectedState": {
  995. "userCallbacks": {
  996. "acknowledgedDocs": [
  997. "collection/key"
  998. ],
  999. "rejectedDocs": []
  1000. }
  1001. },
  1002. "expectedSnapshotEvents": [
  1003. {
  1004. "query": {
  1005. "path": "collection/key",
  1006. "filters": [],
  1007. "orderBys": []
  1008. },
  1009. "modified": [
  1010. {
  1011. "key": "collection/key",
  1012. "version": 10000,
  1013. "value": {
  1014. "v": 3
  1015. },
  1016. "options": {
  1017. "hasLocalMutations": false,
  1018. "hasCommittedMutations": false
  1019. }
  1020. }
  1021. ],
  1022. "errorCode": 0,
  1023. "fromCache": false,
  1024. "hasPendingWrites": false
  1025. }
  1026. ]
  1027. }
  1028. ]
  1029. },
  1030. "Cache raises correct event if write is acked before watch delivers it": {
  1031. "describeName": "Writes:",
  1032. "itName": "Cache raises correct event if write is acked before watch delivers it",
  1033. "tags": [],
  1034. "config": {
  1035. "useGarbageCollection": true,
  1036. "numClients": 1
  1037. },
  1038. "steps": [
  1039. {
  1040. "userListen": [
  1041. 2,
  1042. {
  1043. "path": "collection/key",
  1044. "filters": [],
  1045. "orderBys": []
  1046. }
  1047. ],
  1048. "expectedState": {
  1049. "activeTargets": {
  1050. "2": {
  1051. "queries": [
  1052. {
  1053. "path": "collection/key",
  1054. "filters": [],
  1055. "orderBys": []
  1056. }
  1057. ],
  1058. "resumeToken": ""
  1059. }
  1060. }
  1061. }
  1062. },
  1063. {
  1064. "watchAck": [
  1065. 2
  1066. ]
  1067. },
  1068. {
  1069. "watchEntity": {
  1070. "docs": [
  1071. {
  1072. "key": "collection/key",
  1073. "version": 1000,
  1074. "value": {
  1075. "v": 1
  1076. },
  1077. "options": {
  1078. "hasLocalMutations": false,
  1079. "hasCommittedMutations": false
  1080. }
  1081. }
  1082. ],
  1083. "targets": [
  1084. 2
  1085. ]
  1086. }
  1087. },
  1088. {
  1089. "watchCurrent": [
  1090. [
  1091. 2
  1092. ],
  1093. "resume-token-1000"
  1094. ]
  1095. },
  1096. {
  1097. "watchSnapshot": {
  1098. "version": 1000,
  1099. "targetIds": []
  1100. },
  1101. "expectedSnapshotEvents": [
  1102. {
  1103. "query": {
  1104. "path": "collection/key",
  1105. "filters": [],
  1106. "orderBys": []
  1107. },
  1108. "added": [
  1109. {
  1110. "key": "collection/key",
  1111. "version": 1000,
  1112. "value": {
  1113. "v": 1
  1114. },
  1115. "options": {
  1116. "hasLocalMutations": false,
  1117. "hasCommittedMutations": false
  1118. }
  1119. }
  1120. ],
  1121. "errorCode": 0,
  1122. "fromCache": false,
  1123. "hasPendingWrites": false
  1124. }
  1125. ]
  1126. },
  1127. {
  1128. "userSet": [
  1129. "collection/key",
  1130. {
  1131. "v": 2
  1132. }
  1133. ],
  1134. "expectedSnapshotEvents": [
  1135. {
  1136. "query": {
  1137. "path": "collection/key",
  1138. "filters": [],
  1139. "orderBys": []
  1140. },
  1141. "modified": [
  1142. {
  1143. "key": "collection/key",
  1144. "version": 1000,
  1145. "value": {
  1146. "v": 2
  1147. },
  1148. "options": {
  1149. "hasLocalMutations": true,
  1150. "hasCommittedMutations": false
  1151. }
  1152. }
  1153. ],
  1154. "errorCode": 0,
  1155. "fromCache": false,
  1156. "hasPendingWrites": true
  1157. }
  1158. ]
  1159. },
  1160. {
  1161. "writeAck": {
  1162. "version": 2000
  1163. },
  1164. "expectedState": {
  1165. "userCallbacks": {
  1166. "acknowledgedDocs": [
  1167. "collection/key"
  1168. ],
  1169. "rejectedDocs": []
  1170. }
  1171. }
  1172. },
  1173. {
  1174. "watchEntity": {
  1175. "docs": [
  1176. {
  1177. "key": "collection/key",
  1178. "version": 2000,
  1179. "value": {
  1180. "v": 2
  1181. },
  1182. "options": {
  1183. "hasLocalMutations": false,
  1184. "hasCommittedMutations": false
  1185. }
  1186. }
  1187. ],
  1188. "targets": [
  1189. 2
  1190. ]
  1191. }
  1192. },
  1193. {
  1194. "watchSnapshot": {
  1195. "version": 2000,
  1196. "targetIds": []
  1197. },
  1198. "expectedSnapshotEvents": [
  1199. {
  1200. "query": {
  1201. "path": "collection/key",
  1202. "filters": [],
  1203. "orderBys": []
  1204. },
  1205. "metadata": [
  1206. {
  1207. "key": "collection/key",
  1208. "version": 2000,
  1209. "value": {
  1210. "v": 2
  1211. },
  1212. "options": {
  1213. "hasLocalMutations": false,
  1214. "hasCommittedMutations": false
  1215. }
  1216. }
  1217. ],
  1218. "errorCode": 0,
  1219. "fromCache": false,
  1220. "hasPendingWrites": false
  1221. }
  1222. ]
  1223. }
  1224. ]
  1225. },
  1226. "Cache will hold local write until watch catches up": {
  1227. "describeName": "Writes:",
  1228. "itName": "Cache will hold local write until watch catches up",
  1229. "tags": [],
  1230. "config": {
  1231. "useGarbageCollection": true,
  1232. "numClients": 1
  1233. },
  1234. "steps": [
  1235. {
  1236. "userListen": [
  1237. 2,
  1238. {
  1239. "path": "collection",
  1240. "filters": [],
  1241. "orderBys": []
  1242. }
  1243. ],
  1244. "expectedState": {
  1245. "activeTargets": {
  1246. "2": {
  1247. "queries": [
  1248. {
  1249. "path": "collection",
  1250. "filters": [],
  1251. "orderBys": []
  1252. }
  1253. ],
  1254. "resumeToken": ""
  1255. }
  1256. }
  1257. }
  1258. },
  1259. {
  1260. "watchAck": [
  1261. 2
  1262. ]
  1263. },
  1264. {
  1265. "watchEntity": {
  1266. "docs": [
  1267. {
  1268. "key": "collection/key",
  1269. "version": 1000,
  1270. "value": {
  1271. "v": 1
  1272. },
  1273. "options": {
  1274. "hasLocalMutations": false,
  1275. "hasCommittedMutations": false
  1276. }
  1277. }
  1278. ],
  1279. "targets": [
  1280. 2
  1281. ]
  1282. }
  1283. },
  1284. {
  1285. "watchCurrent": [
  1286. [
  1287. 2
  1288. ],
  1289. "resume-token-1000"
  1290. ]
  1291. },
  1292. {
  1293. "watchSnapshot": {
  1294. "version": 1000,
  1295. "targetIds": []
  1296. },
  1297. "expectedSnapshotEvents": [
  1298. {
  1299. "query": {
  1300. "path": "collection",
  1301. "filters": [],
  1302. "orderBys": []
  1303. },
  1304. "added": [
  1305. {
  1306. "key": "collection/key",
  1307. "version": 1000,
  1308. "value": {
  1309. "v": 1
  1310. },
  1311. "options": {
  1312. "hasLocalMutations": false,
  1313. "hasCommittedMutations": false
  1314. }
  1315. }
  1316. ],
  1317. "errorCode": 0,
  1318. "fromCache": false,
  1319. "hasPendingWrites": false
  1320. }
  1321. ]
  1322. },
  1323. {
  1324. "userSet": [
  1325. "collection/key",
  1326. {
  1327. "v": 3
  1328. }
  1329. ],
  1330. "expectedSnapshotEvents": [
  1331. {
  1332. "query": {
  1333. "path": "collection",
  1334. "filters": [],
  1335. "orderBys": []
  1336. },
  1337. "modified": [
  1338. {
  1339. "key": "collection/key",
  1340. "version": 1000,
  1341. "value": {
  1342. "v": 3
  1343. },
  1344. "options": {
  1345. "hasLocalMutations": true,
  1346. "hasCommittedMutations": false
  1347. }
  1348. }
  1349. ],
  1350. "errorCode": 0,
  1351. "fromCache": false,
  1352. "hasPendingWrites": true
  1353. }
  1354. ]
  1355. },
  1356. {
  1357. "writeAck": {
  1358. "version": 3000
  1359. },
  1360. "expectedState": {
  1361. "userCallbacks": {
  1362. "acknowledgedDocs": [
  1363. "collection/key"
  1364. ],
  1365. "rejectedDocs": []
  1366. }
  1367. }
  1368. },
  1369. {
  1370. "watchEntity": {
  1371. "docs": [
  1372. {
  1373. "key": "collection/key",
  1374. "version": 2000,
  1375. "value": {
  1376. "v": 2
  1377. },
  1378. "options": {
  1379. "hasLocalMutations": false,
  1380. "hasCommittedMutations": false
  1381. }
  1382. }
  1383. ],
  1384. "targets": [
  1385. 2
  1386. ]
  1387. }
  1388. },
  1389. {
  1390. "watchSnapshot": {
  1391. "version": 2000,
  1392. "targetIds": []
  1393. }
  1394. },
  1395. {
  1396. "watchEntity": {
  1397. "docs": [
  1398. {
  1399. "key": "collection/b",
  1400. "version": 3000,
  1401. "value": {
  1402. "doc": "b"
  1403. },
  1404. "options": {
  1405. "hasLocalMutations": false,
  1406. "hasCommittedMutations": false
  1407. }
  1408. },
  1409. {
  1410. "key": "collection/key",
  1411. "version": 3000,
  1412. "value": {
  1413. "v": 3
  1414. },
  1415. "options": {
  1416. "hasLocalMutations": false,
  1417. "hasCommittedMutations": false
  1418. }
  1419. }
  1420. ],
  1421. "targets": [
  1422. 2
  1423. ]
  1424. }
  1425. },
  1426. {
  1427. "watchSnapshot": {
  1428. "version": 3000,
  1429. "targetIds": []
  1430. },
  1431. "expectedSnapshotEvents": [
  1432. {
  1433. "query": {
  1434. "path": "collection",
  1435. "filters": [],
  1436. "orderBys": []
  1437. },
  1438. "added": [
  1439. {
  1440. "key": "collection/b",
  1441. "version": 3000,
  1442. "value": {
  1443. "doc": "b"
  1444. },
  1445. "options": {
  1446. "hasLocalMutations": false,
  1447. "hasCommittedMutations": false
  1448. }
  1449. }
  1450. ],
  1451. "metadata": [
  1452. {
  1453. "key": "collection/key",
  1454. "version": 3000,
  1455. "value": {
  1456. "v": 3
  1457. },
  1458. "options": {
  1459. "hasLocalMutations": false,
  1460. "hasCommittedMutations": false
  1461. }
  1462. }
  1463. ],
  1464. "errorCode": 0,
  1465. "fromCache": false,
  1466. "hasPendingWrites": false
  1467. }
  1468. ]
  1469. }
  1470. ]
  1471. },
  1472. "Local patch is applied to query until watch catches up": {
  1473. "describeName": "Writes:",
  1474. "itName": "Local patch is applied to query until watch catches up",
  1475. "tags": [],
  1476. "config": {
  1477. "useGarbageCollection": false,
  1478. "numClients": 1
  1479. },
  1480. "steps": [
  1481. {
  1482. "userSet": [
  1483. "collection/doc",
  1484. {
  1485. "local": 1
  1486. }
  1487. ]
  1488. },
  1489. {
  1490. "userListen": [
  1491. 2,
  1492. {
  1493. "path": "collection",
  1494. "filters": [],
  1495. "orderBys": []
  1496. }
  1497. ],
  1498. "expectedState": {
  1499. "activeTargets": {
  1500. "2": {
  1501. "queries": [
  1502. {
  1503. "path": "collection",
  1504. "filters": [],
  1505. "orderBys": []
  1506. }
  1507. ],
  1508. "resumeToken": ""
  1509. }
  1510. }
  1511. },
  1512. "expectedSnapshotEvents": [
  1513. {
  1514. "query": {
  1515. "path": "collection",
  1516. "filters": [],
  1517. "orderBys": []
  1518. },
  1519. "added": [
  1520. {
  1521. "key": "collection/doc",
  1522. "version": 0,
  1523. "value": {
  1524. "local": 1
  1525. },
  1526. "options": {
  1527. "hasLocalMutations": true,
  1528. "hasCommittedMutations": false
  1529. }
  1530. }
  1531. ],
  1532. "errorCode": 0,
  1533. "fromCache": true,
  1534. "hasPendingWrites": true
  1535. }
  1536. ]
  1537. },
  1538. {
  1539. "writeAck": {
  1540. "version": 1000
  1541. },
  1542. "expectedState": {
  1543. "userCallbacks": {
  1544. "acknowledgedDocs": [
  1545. "collection/doc"
  1546. ],
  1547. "rejectedDocs": []
  1548. }
  1549. }
  1550. },
  1551. {
  1552. "watchAck": [
  1553. 2
  1554. ]
  1555. },
  1556. {
  1557. "watchEntity": {
  1558. "docs": [
  1559. {
  1560. "key": "collection/doc",
  1561. "version": 2000,
  1562. "value": {
  1563. "local": 1,
  1564. "remote": 2
  1565. },
  1566. "options": {
  1567. "hasLocalMutations": false,
  1568. "hasCommittedMutations": false
  1569. }
  1570. }
  1571. ],
  1572. "targets": [
  1573. 2
  1574. ]
  1575. }
  1576. },
  1577. {
  1578. "watchCurrent": [
  1579. [
  1580. 2
  1581. ],
  1582. "resume-token-2000"
  1583. ]
  1584. },
  1585. {
  1586. "watchSnapshot": {
  1587. "version": 2000,
  1588. "targetIds": []
  1589. },
  1590. "expectedSnapshotEvents": [
  1591. {
  1592. "query": {
  1593. "path": "collection",
  1594. "filters": [],
  1595. "orderBys": []
  1596. },
  1597. "modified": [
  1598. {
  1599. "key": "collection/doc",
  1600. "version": 2000,
  1601. "value": {
  1602. "local": 1,
  1603. "remote": 2
  1604. },
  1605. "options": {
  1606. "hasLocalMutations": false,
  1607. "hasCommittedMutations": false
  1608. }
  1609. }
  1610. ],
  1611. "errorCode": 0,
  1612. "fromCache": false,
  1613. "hasPendingWrites": false
  1614. }
  1615. ]
  1616. },
  1617. {
  1618. "userPatch": [
  1619. "collection/doc",
  1620. {
  1621. "local": 5
  1622. }
  1623. ],
  1624. "expectedSnapshotEvents": [
  1625. {
  1626. "query": {
  1627. "path": "collection",
  1628. "filters": [],
  1629. "orderBys": []
  1630. },
  1631. "modified": [
  1632. {
  1633. "key": "collection/doc",
  1634. "version": 2000,
  1635. "value": {
  1636. "local": 5,
  1637. "remote": 2
  1638. },
  1639. "options": {
  1640. "hasLocalMutations": true,
  1641. "hasCommittedMutations": false
  1642. }
  1643. }
  1644. ],
  1645. "errorCode": 0,
  1646. "fromCache": false,
  1647. "hasPendingWrites": true
  1648. }
  1649. ]
  1650. },
  1651. {
  1652. "writeAck": {
  1653. "version": 5000
  1654. },
  1655. "expectedState": {
  1656. "userCallbacks": {
  1657. "acknowledgedDocs": [
  1658. "collection/doc"
  1659. ],
  1660. "rejectedDocs": []
  1661. }
  1662. }
  1663. },
  1664. {
  1665. "watchEntity": {
  1666. "docs": [
  1667. {
  1668. "key": "collection/doc",
  1669. "version": 3000,
  1670. "value": {
  1671. "local": 1,
  1672. "remote": 3
  1673. },
  1674. "options": {
  1675. "hasLocalMutations": false,
  1676. "hasCommittedMutations": true
  1677. }
  1678. }
  1679. ],
  1680. "targets": [
  1681. 2
  1682. ]
  1683. }
  1684. },
  1685. {
  1686. "watchSnapshot": {
  1687. "version": 3000,
  1688. "targetIds": []
  1689. }
  1690. },
  1691. {
  1692. "watchEntity": {
  1693. "docs": [
  1694. {
  1695. "key": "collection/doc",
  1696. "version": 4000,
  1697. "value": {
  1698. "local": 1,
  1699. "remote": 4
  1700. },
  1701. "options": {
  1702. "hasLocalMutations": false,
  1703. "hasCommittedMutations": true
  1704. }
  1705. }
  1706. ],
  1707. "targets": [
  1708. 2
  1709. ]
  1710. }
  1711. },
  1712. {
  1713. "watchSnapshot": {
  1714. "version": 4000,
  1715. "targetIds": []
  1716. }
  1717. },
  1718. {
  1719. "watchEntity": {
  1720. "docs": [
  1721. {
  1722. "key": "collection/doc",
  1723. "version": 5000,
  1724. "value": {
  1725. "local": 5,
  1726. "remote": 5
  1727. },
  1728. "options": {
  1729. "hasLocalMutations": false,
  1730. "hasCommittedMutations": false
  1731. }
  1732. }
  1733. ],
  1734. "targets": [
  1735. 2
  1736. ]
  1737. }
  1738. },
  1739. {
  1740. "watchSnapshot": {
  1741. "version": 5000,
  1742. "targetIds": []
  1743. },
  1744. "expectedSnapshotEvents": [
  1745. {
  1746. "query": {
  1747. "path": "collection",
  1748. "filters": [],
  1749. "orderBys": []
  1750. },
  1751. "modified": [
  1752. {
  1753. "key": "collection/doc",
  1754. "version": 5000,
  1755. "value": {
  1756. "local": 5,
  1757. "remote": 5
  1758. },
  1759. "options": {
  1760. "hasLocalMutations": false,
  1761. "hasCommittedMutations": false
  1762. }
  1763. }
  1764. ],
  1765. "errorCode": 0,
  1766. "fromCache": false,
  1767. "hasPendingWrites": false
  1768. }
  1769. ]
  1770. }
  1771. ]
  1772. },
  1773. "Writes are pipelined": {
  1774. "describeName": "Writes:",
  1775. "itName": "Writes are pipelined",
  1776. "tags": [],
  1777. "config": {
  1778. "useGarbageCollection": true,
  1779. "numClients": 1
  1780. },
  1781. "steps": [
  1782. {
  1783. "userListen": [
  1784. 2,
  1785. {
  1786. "path": "collection",
  1787. "filters": [],
  1788. "orderBys": []
  1789. }
  1790. ],
  1791. "expectedState": {
  1792. "activeTargets": {
  1793. "2": {
  1794. "queries": [
  1795. {
  1796. "path": "collection",
  1797. "filters": [],
  1798. "orderBys": []
  1799. }
  1800. ],
  1801. "resumeToken": ""
  1802. }
  1803. }
  1804. }
  1805. },
  1806. {
  1807. "watchAck": [
  1808. 2
  1809. ]
  1810. },
  1811. {
  1812. "watchCurrent": [
  1813. [
  1814. 2
  1815. ],
  1816. "resume-token"
  1817. ]
  1818. },
  1819. {
  1820. "userSet": [
  1821. "collection/a0",
  1822. {
  1823. "v": 1
  1824. }
  1825. ],
  1826. "expectedSnapshotEvents": [
  1827. {
  1828. "query": {
  1829. "path": "collection",
  1830. "filters": [],
  1831. "orderBys": []
  1832. },
  1833. "added": [
  1834. {
  1835. "key": "collection/a0",
  1836. "version": 0,
  1837. "value": {
  1838. "v": 1
  1839. },
  1840. "options": {
  1841. "hasLocalMutations": true,
  1842. "hasCommittedMutations": false
  1843. }
  1844. }
  1845. ],
  1846. "errorCode": 0,
  1847. "fromCache": true,
  1848. "hasPendingWrites": true
  1849. }
  1850. ]
  1851. },
  1852. {
  1853. "userSet": [
  1854. "collection/a1",
  1855. {
  1856. "v": 1
  1857. }
  1858. ],
  1859. "expectedSnapshotEvents": [
  1860. {
  1861. "query": {
  1862. "path": "collection",
  1863. "filters": [],
  1864. "orderBys": []
  1865. },
  1866. "added": [
  1867. {
  1868. "key": "collection/a1",
  1869. "version": 0,
  1870. "value": {
  1871. "v": 1
  1872. },
  1873. "options": {
  1874. "hasLocalMutations": true,
  1875. "hasCommittedMutations": false
  1876. }
  1877. }
  1878. ],
  1879. "errorCode": 0,
  1880. "fromCache": true,
  1881. "hasPendingWrites": true
  1882. }
  1883. ]
  1884. },
  1885. {
  1886. "userSet": [
  1887. "collection/a2",
  1888. {
  1889. "v": 1
  1890. }
  1891. ],
  1892. "expectedSnapshotEvents": [
  1893. {
  1894. "query": {
  1895. "path": "collection",
  1896. "filters": [],
  1897. "orderBys": []
  1898. },
  1899. "added": [
  1900. {
  1901. "key": "collection/a2",
  1902. "version": 0,
  1903. "value": {
  1904. "v": 1
  1905. },
  1906. "options": {
  1907. "hasLocalMutations": true,
  1908. "hasCommittedMutations": false
  1909. }
  1910. }
  1911. ],
  1912. "errorCode": 0,
  1913. "fromCache": true,
  1914. "hasPendingWrites": true
  1915. }
  1916. ]
  1917. },
  1918. {
  1919. "userSet": [
  1920. "collection/a3",
  1921. {
  1922. "v": 1
  1923. }
  1924. ],
  1925. "expectedSnapshotEvents": [
  1926. {
  1927. "query": {
  1928. "path": "collection",
  1929. "filters": [],
  1930. "orderBys": []
  1931. },
  1932. "added": [
  1933. {
  1934. "key": "collection/a3",
  1935. "version": 0,
  1936. "value": {
  1937. "v": 1
  1938. },
  1939. "options": {
  1940. "hasLocalMutations": true,
  1941. "hasCommittedMutations": false
  1942. }
  1943. }
  1944. ],
  1945. "errorCode": 0,
  1946. "fromCache": true,
  1947. "hasPendingWrites": true
  1948. }
  1949. ]
  1950. },
  1951. {
  1952. "userSet": [
  1953. "collection/a4",
  1954. {
  1955. "v": 1
  1956. }
  1957. ],
  1958. "expectedSnapshotEvents": [
  1959. {
  1960. "query": {
  1961. "path": "collection",
  1962. "filters": [],
  1963. "orderBys": []
  1964. },
  1965. "added": [
  1966. {
  1967. "key": "collection/a4",
  1968. "version": 0,
  1969. "value": {
  1970. "v": 1
  1971. },
  1972. "options": {
  1973. "hasLocalMutations": true,
  1974. "hasCommittedMutations": false
  1975. }
  1976. }
  1977. ],
  1978. "errorCode": 0,
  1979. "fromCache": true,
  1980. "hasPendingWrites": true
  1981. }
  1982. ]
  1983. },
  1984. {
  1985. "userSet": [
  1986. "collection/a5",
  1987. {
  1988. "v": 1
  1989. }
  1990. ],
  1991. "expectedSnapshotEvents": [
  1992. {
  1993. "query": {
  1994. "path": "collection",
  1995. "filters": [],
  1996. "orderBys": []
  1997. },
  1998. "added": [
  1999. {
  2000. "key": "collection/a5",
  2001. "version": 0,
  2002. "value": {
  2003. "v": 1
  2004. },
  2005. "options": {
  2006. "hasLocalMutations": true,
  2007. "hasCommittedMutations": false
  2008. }
  2009. }
  2010. ],
  2011. "errorCode": 0,
  2012. "fromCache": true,
  2013. "hasPendingWrites": true
  2014. }
  2015. ]
  2016. },
  2017. {
  2018. "userSet": [
  2019. "collection/a6",
  2020. {
  2021. "v": 1
  2022. }
  2023. ],
  2024. "expectedSnapshotEvents": [
  2025. {
  2026. "query": {
  2027. "path": "collection",
  2028. "filters": [],
  2029. "orderBys": []
  2030. },
  2031. "added": [
  2032. {
  2033. "key": "collection/a6",
  2034. "version": 0,
  2035. "value": {
  2036. "v": 1
  2037. },
  2038. "options": {
  2039. "hasLocalMutations": true,
  2040. "hasCommittedMutations": false
  2041. }
  2042. }
  2043. ],
  2044. "errorCode": 0,
  2045. "fromCache": true,
  2046. "hasPendingWrites": true
  2047. }
  2048. ]
  2049. },
  2050. {
  2051. "userSet": [
  2052. "collection/a7",
  2053. {
  2054. "v": 1
  2055. }
  2056. ],
  2057. "expectedSnapshotEvents": [
  2058. {
  2059. "query": {
  2060. "path": "collection",
  2061. "filters": [],
  2062. "orderBys": []
  2063. },
  2064. "added": [
  2065. {
  2066. "key": "collection/a7",
  2067. "version": 0,
  2068. "value": {
  2069. "v": 1
  2070. },
  2071. "options": {
  2072. "hasLocalMutations": true,
  2073. "hasCommittedMutations": false
  2074. }
  2075. }
  2076. ],
  2077. "errorCode": 0,
  2078. "fromCache": true,
  2079. "hasPendingWrites": true
  2080. }
  2081. ]
  2082. },
  2083. {
  2084. "userSet": [
  2085. "collection/a8",
  2086. {
  2087. "v": 1
  2088. }
  2089. ],
  2090. "expectedSnapshotEvents": [
  2091. {
  2092. "query": {
  2093. "path": "collection",
  2094. "filters": [],
  2095. "orderBys": []
  2096. },
  2097. "added": [
  2098. {
  2099. "key": "collection/a8",
  2100. "version": 0,
  2101. "value": {
  2102. "v": 1
  2103. },
  2104. "options": {
  2105. "hasLocalMutations": true,
  2106. "hasCommittedMutations": false
  2107. }
  2108. }
  2109. ],
  2110. "errorCode": 0,
  2111. "fromCache": true,
  2112. "hasPendingWrites": true
  2113. }
  2114. ]
  2115. },
  2116. {
  2117. "userSet": [
  2118. "collection/a9",
  2119. {
  2120. "v": 1
  2121. }
  2122. ],
  2123. "expectedSnapshotEvents": [
  2124. {
  2125. "query": {
  2126. "path": "collection",
  2127. "filters": [],
  2128. "orderBys": []
  2129. },
  2130. "added": [
  2131. {
  2132. "key": "collection/a9",
  2133. "version": 0,
  2134. "value": {
  2135. "v": 1
  2136. },
  2137. "options": {
  2138. "hasLocalMutations": true,
  2139. "hasCommittedMutations": false
  2140. }
  2141. }
  2142. ],
  2143. "errorCode": 0,
  2144. "fromCache": true,
  2145. "hasPendingWrites": true
  2146. }
  2147. ]
  2148. },
  2149. {
  2150. "userSet": [
  2151. "collection/a10",
  2152. {
  2153. "v": 1
  2154. }
  2155. ],
  2156. "expectedSnapshotEvents": [
  2157. {
  2158. "query": {
  2159. "path": "collection",
  2160. "filters": [],
  2161. "orderBys": []
  2162. },
  2163. "added": [
  2164. {
  2165. "key": "collection/a10",
  2166. "version": 0,
  2167. "value": {
  2168. "v": 1
  2169. },
  2170. "options": {
  2171. "hasLocalMutations": true,
  2172. "hasCommittedMutations": false
  2173. }
  2174. }
  2175. ],
  2176. "errorCode": 0,
  2177. "fromCache": true,
  2178. "hasPendingWrites": true
  2179. }
  2180. ]
  2181. },
  2182. {
  2183. "userSet": [
  2184. "collection/a11",
  2185. {
  2186. "v": 1
  2187. }
  2188. ],
  2189. "expectedSnapshotEvents": [
  2190. {
  2191. "query": {
  2192. "path": "collection",
  2193. "filters": [],
  2194. "orderBys": []
  2195. },
  2196. "added": [
  2197. {
  2198. "key": "collection/a11",
  2199. "version": 0,
  2200. "value": {
  2201. "v": 1
  2202. },
  2203. "options": {
  2204. "hasLocalMutations": true,
  2205. "hasCommittedMutations": false
  2206. }
  2207. }
  2208. ],
  2209. "errorCode": 0,
  2210. "fromCache": true,
  2211. "hasPendingWrites": true
  2212. }
  2213. ]
  2214. },
  2215. {
  2216. "userSet": [
  2217. "collection/a12",
  2218. {
  2219. "v": 1
  2220. }
  2221. ],
  2222. "expectedSnapshotEvents": [
  2223. {
  2224. "query": {
  2225. "path": "collection",
  2226. "filters": [],
  2227. "orderBys": []
  2228. },
  2229. "added": [
  2230. {
  2231. "key": "collection/a12",
  2232. "version": 0,
  2233. "value": {
  2234. "v": 1
  2235. },
  2236. "options": {
  2237. "hasLocalMutations": true,
  2238. "hasCommittedMutations": false
  2239. }
  2240. }
  2241. ],
  2242. "errorCode": 0,
  2243. "fromCache": true,
  2244. "hasPendingWrites": true
  2245. }
  2246. ]
  2247. },
  2248. {
  2249. "userSet": [
  2250. "collection/a13",
  2251. {
  2252. "v": 1
  2253. }
  2254. ],
  2255. "expectedSnapshotEvents": [
  2256. {
  2257. "query": {
  2258. "path": "collection",
  2259. "filters": [],
  2260. "orderBys": []
  2261. },
  2262. "added": [
  2263. {
  2264. "key": "collection/a13",
  2265. "version": 0,
  2266. "value": {
  2267. "v": 1
  2268. },
  2269. "options": {
  2270. "hasLocalMutations": true,
  2271. "hasCommittedMutations": false
  2272. }
  2273. }
  2274. ],
  2275. "errorCode": 0,
  2276. "fromCache": true,
  2277. "hasPendingWrites": true
  2278. }
  2279. ]
  2280. },
  2281. {
  2282. "userSet": [
  2283. "collection/a14",
  2284. {
  2285. "v": 1
  2286. }
  2287. ],
  2288. "expectedSnapshotEvents": [
  2289. {
  2290. "query": {
  2291. "path": "collection",
  2292. "filters": [],
  2293. "orderBys": []
  2294. },
  2295. "added": [
  2296. {
  2297. "key": "collection/a14",
  2298. "version": 0,
  2299. "value": {
  2300. "v": 1
  2301. },
  2302. "options": {
  2303. "hasLocalMutations": true,
  2304. "hasCommittedMutations": false
  2305. }
  2306. }
  2307. ],
  2308. "errorCode": 0,
  2309. "fromCache": true,
  2310. "hasPendingWrites": true
  2311. }
  2312. ],
  2313. "expectedState": {
  2314. "numOutstandingWrites": 10
  2315. }
  2316. },
  2317. {
  2318. "writeAck": {
  2319. "version": 1000
  2320. },
  2321. "expectedState": {
  2322. "userCallbacks": {
  2323. "acknowledgedDocs": [
  2324. "collection/a0"
  2325. ],
  2326. "rejectedDocs": []
  2327. }
  2328. }
  2329. },
  2330. {
  2331. "watchEntity": {
  2332. "docs": [
  2333. {
  2334. "key": "collection/a0",
  2335. "version": 1000,
  2336. "value": {
  2337. "v": 1
  2338. },
  2339. "options": {
  2340. "hasLocalMutations": false,
  2341. "hasCommittedMutations": false
  2342. }
  2343. }
  2344. ],
  2345. "targets": [
  2346. 2
  2347. ]
  2348. }
  2349. },
  2350. {
  2351. "watchSnapshot": {
  2352. "version": 1000,
  2353. "targetIds": []
  2354. },
  2355. "expectedSnapshotEvents": [
  2356. {
  2357. "query": {
  2358. "path": "collection",
  2359. "filters": [],
  2360. "orderBys": []
  2361. },
  2362. "metadata": [
  2363. {
  2364. "key": "collection/a0",
  2365. "version": 1000,
  2366. "value": {
  2367. "v": 1
  2368. },
  2369. "options": {
  2370. "hasLocalMutations": false,
  2371. "hasCommittedMutations": false
  2372. }
  2373. }
  2374. ],
  2375. "errorCode": 0,
  2376. "fromCache": false,
  2377. "hasPendingWrites": true
  2378. }
  2379. ]
  2380. },
  2381. {
  2382. "writeAck": {
  2383. "version": 2000
  2384. },
  2385. "expectedState": {
  2386. "userCallbacks": {
  2387. "acknowledgedDocs": [
  2388. "collection/a1"
  2389. ],
  2390. "rejectedDocs": []
  2391. }
  2392. }
  2393. },
  2394. {
  2395. "watchEntity": {
  2396. "docs": [
  2397. {
  2398. "key": "collection/a1",
  2399. "version": 2000,
  2400. "value": {
  2401. "v": 1
  2402. },
  2403. "options": {
  2404. "hasLocalMutations": false,
  2405. "hasCommittedMutations": false
  2406. }
  2407. }
  2408. ],
  2409. "targets": [
  2410. 2
  2411. ]
  2412. }
  2413. },
  2414. {
  2415. "watchSnapshot": {
  2416. "version": 2000,
  2417. "targetIds": []
  2418. },
  2419. "expectedSnapshotEvents": [
  2420. {
  2421. "query": {
  2422. "path": "collection",
  2423. "filters": [],
  2424. "orderBys": []
  2425. },
  2426. "metadata": [
  2427. {
  2428. "key": "collection/a1",
  2429. "version": 2000,
  2430. "value": {
  2431. "v": 1
  2432. },
  2433. "options": {
  2434. "hasLocalMutations": false,
  2435. "hasCommittedMutations": false
  2436. }
  2437. }
  2438. ],
  2439. "errorCode": 0,
  2440. "fromCache": false,
  2441. "hasPendingWrites": true
  2442. }
  2443. ]
  2444. },
  2445. {
  2446. "writeAck": {
  2447. "version": 3000
  2448. },
  2449. "expectedState": {
  2450. "userCallbacks": {
  2451. "acknowledgedDocs": [
  2452. "collection/a2"
  2453. ],
  2454. "rejectedDocs": []
  2455. }
  2456. }
  2457. },
  2458. {
  2459. "watchEntity": {
  2460. "docs": [
  2461. {
  2462. "key": "collection/a2",
  2463. "version": 3000,
  2464. "value": {
  2465. "v": 1
  2466. },
  2467. "options": {
  2468. "hasLocalMutations": false,
  2469. "hasCommittedMutations": false
  2470. }
  2471. }
  2472. ],
  2473. "targets": [
  2474. 2
  2475. ]
  2476. }
  2477. },
  2478. {
  2479. "watchSnapshot": {
  2480. "version": 3000,
  2481. "targetIds": []
  2482. },
  2483. "expectedSnapshotEvents": [
  2484. {
  2485. "query": {
  2486. "path": "collection",
  2487. "filters": [],
  2488. "orderBys": []
  2489. },
  2490. "metadata": [
  2491. {
  2492. "key": "collection/a2",
  2493. "version": 3000,
  2494. "value": {
  2495. "v": 1
  2496. },
  2497. "options": {
  2498. "hasLocalMutations": false,
  2499. "hasCommittedMutations": false
  2500. }
  2501. }
  2502. ],
  2503. "errorCode": 0,
  2504. "fromCache": false,
  2505. "hasPendingWrites": true
  2506. }
  2507. ]
  2508. },
  2509. {
  2510. "writeAck": {
  2511. "version": 4000
  2512. },
  2513. "expectedState": {
  2514. "userCallbacks": {
  2515. "acknowledgedDocs": [
  2516. "collection/a3"
  2517. ],
  2518. "rejectedDocs": []
  2519. }
  2520. }
  2521. },
  2522. {
  2523. "watchEntity": {
  2524. "docs": [
  2525. {
  2526. "key": "collection/a3",
  2527. "version": 4000,
  2528. "value": {
  2529. "v": 1
  2530. },
  2531. "options": {
  2532. "hasLocalMutations": false,
  2533. "hasCommittedMutations": false
  2534. }
  2535. }
  2536. ],
  2537. "targets": [
  2538. 2
  2539. ]
  2540. }
  2541. },
  2542. {
  2543. "watchSnapshot": {
  2544. "version": 4000,
  2545. "targetIds": []
  2546. },
  2547. "expectedSnapshotEvents": [
  2548. {
  2549. "query": {
  2550. "path": "collection",
  2551. "filters": [],
  2552. "orderBys": []
  2553. },
  2554. "metadata": [
  2555. {
  2556. "key": "collection/a3",
  2557. "version": 4000,
  2558. "value": {
  2559. "v": 1
  2560. },
  2561. "options": {
  2562. "hasLocalMutations": false,
  2563. "hasCommittedMutations": false
  2564. }
  2565. }
  2566. ],
  2567. "errorCode": 0,
  2568. "fromCache": false,
  2569. "hasPendingWrites": true
  2570. }
  2571. ]
  2572. },
  2573. {
  2574. "writeAck": {
  2575. "version": 5000
  2576. },
  2577. "expectedState": {
  2578. "userCallbacks": {
  2579. "acknowledgedDocs": [
  2580. "collection/a4"
  2581. ],
  2582. "rejectedDocs": []
  2583. }
  2584. }
  2585. },
  2586. {
  2587. "watchEntity": {
  2588. "docs": [
  2589. {
  2590. "key": "collection/a4",
  2591. "version": 5000,
  2592. "value": {
  2593. "v": 1
  2594. },
  2595. "options": {
  2596. "hasLocalMutations": false,
  2597. "hasCommittedMutations": false
  2598. }
  2599. }
  2600. ],
  2601. "targets": [
  2602. 2
  2603. ]
  2604. }
  2605. },
  2606. {
  2607. "watchSnapshot": {
  2608. "version": 5000,
  2609. "targetIds": []
  2610. },
  2611. "expectedSnapshotEvents": [
  2612. {
  2613. "query": {
  2614. "path": "collection",
  2615. "filters": [],
  2616. "orderBys": []
  2617. },
  2618. "metadata": [
  2619. {
  2620. "key": "collection/a4",
  2621. "version": 5000,
  2622. "value": {
  2623. "v": 1
  2624. },
  2625. "options": {
  2626. "hasLocalMutations": false,
  2627. "hasCommittedMutations": false
  2628. }
  2629. }
  2630. ],
  2631. "errorCode": 0,
  2632. "fromCache": false,
  2633. "hasPendingWrites": true
  2634. }
  2635. ]
  2636. },
  2637. {
  2638. "writeAck": {
  2639. "version": 6000
  2640. },
  2641. "expectedState": {
  2642. "userCallbacks": {
  2643. "acknowledgedDocs": [
  2644. "collection/a5"
  2645. ],
  2646. "rejectedDocs": []
  2647. }
  2648. }
  2649. },
  2650. {
  2651. "watchEntity": {
  2652. "docs": [
  2653. {
  2654. "key": "collection/a5",
  2655. "version": 6000,
  2656. "value": {
  2657. "v": 1
  2658. },
  2659. "options": {
  2660. "hasLocalMutations": false,
  2661. "hasCommittedMutations": false
  2662. }
  2663. }
  2664. ],
  2665. "targets": [
  2666. 2
  2667. ]
  2668. }
  2669. },
  2670. {
  2671. "watchSnapshot": {
  2672. "version": 6000,
  2673. "targetIds": []
  2674. },
  2675. "expectedSnapshotEvents": [
  2676. {
  2677. "query": {
  2678. "path": "collection",
  2679. "filters": [],
  2680. "orderBys": []
  2681. },
  2682. "metadata": [
  2683. {
  2684. "key": "collection/a5",
  2685. "version": 6000,
  2686. "value": {
  2687. "v": 1
  2688. },
  2689. "options": {
  2690. "hasLocalMutations": false,
  2691. "hasCommittedMutations": false
  2692. }
  2693. }
  2694. ],
  2695. "errorCode": 0,
  2696. "fromCache": false,
  2697. "hasPendingWrites": true
  2698. }
  2699. ]
  2700. },
  2701. {
  2702. "writeAck": {
  2703. "version": 7000
  2704. },
  2705. "expectedState": {
  2706. "userCallbacks": {
  2707. "acknowledgedDocs": [
  2708. "collection/a6"
  2709. ],
  2710. "rejectedDocs": []
  2711. }
  2712. }
  2713. },
  2714. {
  2715. "watchEntity": {
  2716. "docs": [
  2717. {
  2718. "key": "collection/a6",
  2719. "version": 7000,
  2720. "value": {
  2721. "v": 1
  2722. },
  2723. "options": {
  2724. "hasLocalMutations": false,
  2725. "hasCommittedMutations": false
  2726. }
  2727. }
  2728. ],
  2729. "targets": [
  2730. 2
  2731. ]
  2732. }
  2733. },
  2734. {
  2735. "watchSnapshot": {
  2736. "version": 7000,
  2737. "targetIds": []
  2738. },
  2739. "expectedSnapshotEvents": [
  2740. {
  2741. "query": {
  2742. "path": "collection",
  2743. "filters": [],
  2744. "orderBys": []
  2745. },
  2746. "metadata": [
  2747. {
  2748. "key": "collection/a6",
  2749. "version": 7000,
  2750. "value": {
  2751. "v": 1
  2752. },
  2753. "options": {
  2754. "hasLocalMutations": false,
  2755. "hasCommittedMutations": false
  2756. }
  2757. }
  2758. ],
  2759. "errorCode": 0,
  2760. "fromCache": false,
  2761. "hasPendingWrites": true
  2762. }
  2763. ]
  2764. },
  2765. {
  2766. "writeAck": {
  2767. "version": 8000
  2768. },
  2769. "expectedState": {
  2770. "userCallbacks": {
  2771. "acknowledgedDocs": [
  2772. "collection/a7"
  2773. ],
  2774. "rejectedDocs": []
  2775. }
  2776. }
  2777. },
  2778. {
  2779. "watchEntity": {
  2780. "docs": [
  2781. {
  2782. "key": "collection/a7",
  2783. "version": 8000,
  2784. "value": {
  2785. "v": 1
  2786. },
  2787. "options": {
  2788. "hasLocalMutations": false,
  2789. "hasCommittedMutations": false
  2790. }
  2791. }
  2792. ],
  2793. "targets": [
  2794. 2
  2795. ]
  2796. }
  2797. },
  2798. {
  2799. "watchSnapshot": {
  2800. "version": 8000,
  2801. "targetIds": []
  2802. },
  2803. "expectedSnapshotEvents": [
  2804. {
  2805. "query": {
  2806. "path": "collection",
  2807. "filters": [],
  2808. "orderBys": []
  2809. },
  2810. "metadata": [
  2811. {
  2812. "key": "collection/a7",
  2813. "version": 8000,
  2814. "value": {
  2815. "v": 1
  2816. },
  2817. "options": {
  2818. "hasLocalMutations": false,
  2819. "hasCommittedMutations": false
  2820. }
  2821. }
  2822. ],
  2823. "errorCode": 0,
  2824. "fromCache": false,
  2825. "hasPendingWrites": true
  2826. }
  2827. ]
  2828. },
  2829. {
  2830. "writeAck": {
  2831. "version": 9000
  2832. },
  2833. "expectedState": {
  2834. "userCallbacks": {
  2835. "acknowledgedDocs": [
  2836. "collection/a8"
  2837. ],
  2838. "rejectedDocs": []
  2839. }
  2840. }
  2841. },
  2842. {
  2843. "watchEntity": {
  2844. "docs": [
  2845. {
  2846. "key": "collection/a8",
  2847. "version": 9000,
  2848. "value": {
  2849. "v": 1
  2850. },
  2851. "options": {
  2852. "hasLocalMutations": false,
  2853. "hasCommittedMutations": false
  2854. }
  2855. }
  2856. ],
  2857. "targets": [
  2858. 2
  2859. ]
  2860. }
  2861. },
  2862. {
  2863. "watchSnapshot": {
  2864. "version": 9000,
  2865. "targetIds": []
  2866. },
  2867. "expectedSnapshotEvents": [
  2868. {
  2869. "query": {
  2870. "path": "collection",
  2871. "filters": [],
  2872. "orderBys": []
  2873. },
  2874. "metadata": [
  2875. {
  2876. "key": "collection/a8",
  2877. "version": 9000,
  2878. "value": {
  2879. "v": 1
  2880. },
  2881. "options": {
  2882. "hasLocalMutations": false,
  2883. "hasCommittedMutations": false
  2884. }
  2885. }
  2886. ],
  2887. "errorCode": 0,
  2888. "fromCache": false,
  2889. "hasPendingWrites": true
  2890. }
  2891. ]
  2892. },
  2893. {
  2894. "writeAck": {
  2895. "version": 10000
  2896. },
  2897. "expectedState": {
  2898. "userCallbacks": {
  2899. "acknowledgedDocs": [
  2900. "collection/a9"
  2901. ],
  2902. "rejectedDocs": []
  2903. }
  2904. }
  2905. },
  2906. {
  2907. "watchEntity": {
  2908. "docs": [
  2909. {
  2910. "key": "collection/a9",
  2911. "version": 10000,
  2912. "value": {
  2913. "v": 1
  2914. },
  2915. "options": {
  2916. "hasLocalMutations": false,
  2917. "hasCommittedMutations": false
  2918. }
  2919. }
  2920. ],
  2921. "targets": [
  2922. 2
  2923. ]
  2924. }
  2925. },
  2926. {
  2927. "watchSnapshot": {
  2928. "version": 10000,
  2929. "targetIds": []
  2930. },
  2931. "expectedSnapshotEvents": [
  2932. {
  2933. "query": {
  2934. "path": "collection",
  2935. "filters": [],
  2936. "orderBys": []
  2937. },
  2938. "metadata": [
  2939. {
  2940. "key": "collection/a9",
  2941. "version": 10000,
  2942. "value": {
  2943. "v": 1
  2944. },
  2945. "options": {
  2946. "hasLocalMutations": false,
  2947. "hasCommittedMutations": false
  2948. }
  2949. }
  2950. ],
  2951. "errorCode": 0,
  2952. "fromCache": false,
  2953. "hasPendingWrites": true
  2954. }
  2955. ]
  2956. },
  2957. {
  2958. "writeAck": {
  2959. "version": 11000
  2960. },
  2961. "expectedState": {
  2962. "userCallbacks": {
  2963. "acknowledgedDocs": [
  2964. "collection/a10"
  2965. ],
  2966. "rejectedDocs": []
  2967. }
  2968. }
  2969. },
  2970. {
  2971. "watchEntity": {
  2972. "docs": [
  2973. {
  2974. "key": "collection/a10",
  2975. "version": 11000,
  2976. "value": {
  2977. "v": 1
  2978. },
  2979. "options": {
  2980. "hasLocalMutations": false,
  2981. "hasCommittedMutations": false
  2982. }
  2983. }
  2984. ],
  2985. "targets": [
  2986. 2
  2987. ]
  2988. }
  2989. },
  2990. {
  2991. "watchSnapshot": {
  2992. "version": 11000,
  2993. "targetIds": []
  2994. },
  2995. "expectedSnapshotEvents": [
  2996. {
  2997. "query": {
  2998. "path": "collection",
  2999. "filters": [],
  3000. "orderBys": []
  3001. },
  3002. "metadata": [
  3003. {
  3004. "key": "collection/a10",
  3005. "version": 11000,
  3006. "value": {
  3007. "v": 1
  3008. },
  3009. "options": {
  3010. "hasLocalMutations": false,
  3011. "hasCommittedMutations": false
  3012. }
  3013. }
  3014. ],
  3015. "errorCode": 0,
  3016. "fromCache": false,
  3017. "hasPendingWrites": true
  3018. }
  3019. ]
  3020. },
  3021. {
  3022. "writeAck": {
  3023. "version": 12000
  3024. },
  3025. "expectedState": {
  3026. "userCallbacks": {
  3027. "acknowledgedDocs": [
  3028. "collection/a11"
  3029. ],
  3030. "rejectedDocs": []
  3031. }
  3032. }
  3033. },
  3034. {
  3035. "watchEntity": {
  3036. "docs": [
  3037. {
  3038. "key": "collection/a11",
  3039. "version": 12000,
  3040. "value": {
  3041. "v": 1
  3042. },
  3043. "options": {
  3044. "hasLocalMutations": false,
  3045. "hasCommittedMutations": false
  3046. }
  3047. }
  3048. ],
  3049. "targets": [
  3050. 2
  3051. ]
  3052. }
  3053. },
  3054. {
  3055. "watchSnapshot": {
  3056. "version": 12000,
  3057. "targetIds": []
  3058. },
  3059. "expectedSnapshotEvents": [
  3060. {
  3061. "query": {
  3062. "path": "collection",
  3063. "filters": [],
  3064. "orderBys": []
  3065. },
  3066. "metadata": [
  3067. {
  3068. "key": "collection/a11",
  3069. "version": 12000,
  3070. "value": {
  3071. "v": 1
  3072. },
  3073. "options": {
  3074. "hasLocalMutations": false,
  3075. "hasCommittedMutations": false
  3076. }
  3077. }
  3078. ],
  3079. "errorCode": 0,
  3080. "fromCache": false,
  3081. "hasPendingWrites": true
  3082. }
  3083. ]
  3084. },
  3085. {
  3086. "writeAck": {
  3087. "version": 13000
  3088. },
  3089. "expectedState": {
  3090. "userCallbacks": {
  3091. "acknowledgedDocs": [
  3092. "collection/a12"
  3093. ],
  3094. "rejectedDocs": []
  3095. }
  3096. }
  3097. },
  3098. {
  3099. "watchEntity": {
  3100. "docs": [
  3101. {
  3102. "key": "collection/a12",
  3103. "version": 13000,
  3104. "value": {
  3105. "v": 1
  3106. },
  3107. "options": {
  3108. "hasLocalMutations": false,
  3109. "hasCommittedMutations": false
  3110. }
  3111. }
  3112. ],
  3113. "targets": [
  3114. 2
  3115. ]
  3116. }
  3117. },
  3118. {
  3119. "watchSnapshot": {
  3120. "version": 13000,
  3121. "targetIds": []
  3122. },
  3123. "expectedSnapshotEvents": [
  3124. {
  3125. "query": {
  3126. "path": "collection",
  3127. "filters": [],
  3128. "orderBys": []
  3129. },
  3130. "metadata": [
  3131. {
  3132. "key": "collection/a12",
  3133. "version": 13000,
  3134. "value": {
  3135. "v": 1
  3136. },
  3137. "options": {
  3138. "hasLocalMutations": false,
  3139. "hasCommittedMutations": false
  3140. }
  3141. }
  3142. ],
  3143. "errorCode": 0,
  3144. "fromCache": false,
  3145. "hasPendingWrites": true
  3146. }
  3147. ]
  3148. },
  3149. {
  3150. "writeAck": {
  3151. "version": 14000
  3152. },
  3153. "expectedState": {
  3154. "userCallbacks": {
  3155. "acknowledgedDocs": [
  3156. "collection/a13"
  3157. ],
  3158. "rejectedDocs": []
  3159. }
  3160. }
  3161. },
  3162. {
  3163. "watchEntity": {
  3164. "docs": [
  3165. {
  3166. "key": "collection/a13",
  3167. "version": 14000,
  3168. "value": {
  3169. "v": 1
  3170. },
  3171. "options": {
  3172. "hasLocalMutations": false,
  3173. "hasCommittedMutations": false
  3174. }
  3175. }
  3176. ],
  3177. "targets": [
  3178. 2
  3179. ]
  3180. }
  3181. },
  3182. {
  3183. "watchSnapshot": {
  3184. "version": 14000,
  3185. "targetIds": []
  3186. },
  3187. "expectedSnapshotEvents": [
  3188. {
  3189. "query": {
  3190. "path": "collection",
  3191. "filters": [],
  3192. "orderBys": []
  3193. },
  3194. "metadata": [
  3195. {
  3196. "key": "collection/a13",
  3197. "version": 14000,
  3198. "value": {
  3199. "v": 1
  3200. },
  3201. "options": {
  3202. "hasLocalMutations": false,
  3203. "hasCommittedMutations": false
  3204. }
  3205. }
  3206. ],
  3207. "errorCode": 0,
  3208. "fromCache": false,
  3209. "hasPendingWrites": true
  3210. }
  3211. ]
  3212. },
  3213. {
  3214. "writeAck": {
  3215. "version": 15000
  3216. },
  3217. "expectedState": {
  3218. "userCallbacks": {
  3219. "acknowledgedDocs": [
  3220. "collection/a14"
  3221. ],
  3222. "rejectedDocs": []
  3223. }
  3224. }
  3225. },
  3226. {
  3227. "watchEntity": {
  3228. "docs": [
  3229. {
  3230. "key": "collection/a14",
  3231. "version": 15000,
  3232. "value": {
  3233. "v": 1
  3234. },
  3235. "options": {
  3236. "hasLocalMutations": false,
  3237. "hasCommittedMutations": false
  3238. }
  3239. }
  3240. ],
  3241. "targets": [
  3242. 2
  3243. ]
  3244. }
  3245. },
  3246. {
  3247. "watchSnapshot": {
  3248. "version": 15000,
  3249. "targetIds": []
  3250. },
  3251. "expectedSnapshotEvents": [
  3252. {
  3253. "query": {
  3254. "path": "collection",
  3255. "filters": [],
  3256. "orderBys": []
  3257. },
  3258. "metadata": [
  3259. {
  3260. "key": "collection/a14",
  3261. "version": 15000,
  3262. "value": {
  3263. "v": 1
  3264. },
  3265. "options": {
  3266. "hasLocalMutations": false,
  3267. "hasCommittedMutations": false
  3268. }
  3269. }
  3270. ],
  3271. "errorCode": 0,
  3272. "fromCache": false,
  3273. "hasPendingWrites": false
  3274. }
  3275. ]
  3276. }
  3277. ]
  3278. },
  3279. "Pipelined writes can fail": {
  3280. "describeName": "Writes:",
  3281. "itName": "Pipelined writes can fail",
  3282. "tags": [],
  3283. "config": {
  3284. "useGarbageCollection": true,
  3285. "numClients": 1
  3286. },
  3287. "steps": [
  3288. {
  3289. "userListen": [
  3290. 2,
  3291. {
  3292. "path": "collection",
  3293. "filters": [],
  3294. "orderBys": []
  3295. }
  3296. ],
  3297. "expectedState": {
  3298. "activeTargets": {
  3299. "2": {
  3300. "queries": [
  3301. {
  3302. "path": "collection",
  3303. "filters": [],
  3304. "orderBys": []
  3305. }
  3306. ],
  3307. "resumeToken": ""
  3308. }
  3309. }
  3310. }
  3311. },
  3312. {
  3313. "userSet": [
  3314. "collection/a0",
  3315. {
  3316. "v": 1
  3317. }
  3318. ],
  3319. "expectedSnapshotEvents": [
  3320. {
  3321. "query": {
  3322. "path": "collection",
  3323. "filters": [],
  3324. "orderBys": []
  3325. },
  3326. "added": [
  3327. {
  3328. "key": "collection/a0",
  3329. "version": 0,
  3330. "value": {
  3331. "v": 1
  3332. },
  3333. "options": {
  3334. "hasLocalMutations": true,
  3335. "hasCommittedMutations": false
  3336. }
  3337. }
  3338. ],
  3339. "errorCode": 0,
  3340. "fromCache": true,
  3341. "hasPendingWrites": true
  3342. }
  3343. ]
  3344. },
  3345. {
  3346. "userSet": [
  3347. "collection/a1",
  3348. {
  3349. "v": 1
  3350. }
  3351. ],
  3352. "expectedSnapshotEvents": [
  3353. {
  3354. "query": {
  3355. "path": "collection",
  3356. "filters": [],
  3357. "orderBys": []
  3358. },
  3359. "added": [
  3360. {
  3361. "key": "collection/a1",
  3362. "version": 0,
  3363. "value": {
  3364. "v": 1
  3365. },
  3366. "options": {
  3367. "hasLocalMutations": true,
  3368. "hasCommittedMutations": false
  3369. }
  3370. }
  3371. ],
  3372. "errorCode": 0,
  3373. "fromCache": true,
  3374. "hasPendingWrites": true
  3375. }
  3376. ]
  3377. },
  3378. {
  3379. "userSet": [
  3380. "collection/a2",
  3381. {
  3382. "v": 1
  3383. }
  3384. ],
  3385. "expectedSnapshotEvents": [
  3386. {
  3387. "query": {
  3388. "path": "collection",
  3389. "filters": [],
  3390. "orderBys": []
  3391. },
  3392. "added": [
  3393. {
  3394. "key": "collection/a2",
  3395. "version": 0,
  3396. "value": {
  3397. "v": 1
  3398. },
  3399. "options": {
  3400. "hasLocalMutations": true,
  3401. "hasCommittedMutations": false
  3402. }
  3403. }
  3404. ],
  3405. "errorCode": 0,
  3406. "fromCache": true,
  3407. "hasPendingWrites": true
  3408. }
  3409. ]
  3410. },
  3411. {
  3412. "userSet": [
  3413. "collection/a3",
  3414. {
  3415. "v": 1
  3416. }
  3417. ],
  3418. "expectedSnapshotEvents": [
  3419. {
  3420. "query": {
  3421. "path": "collection",
  3422. "filters": [],
  3423. "orderBys": []
  3424. },
  3425. "added": [
  3426. {
  3427. "key": "collection/a3",
  3428. "version": 0,
  3429. "value": {
  3430. "v": 1
  3431. },
  3432. "options": {
  3433. "hasLocalMutations": true,
  3434. "hasCommittedMutations": false
  3435. }
  3436. }
  3437. ],
  3438. "errorCode": 0,
  3439. "fromCache": true,
  3440. "hasPendingWrites": true
  3441. }
  3442. ]
  3443. },
  3444. {
  3445. "userSet": [
  3446. "collection/a4",
  3447. {
  3448. "v": 1
  3449. }
  3450. ],
  3451. "expectedSnapshotEvents": [
  3452. {
  3453. "query": {
  3454. "path": "collection",
  3455. "filters": [],
  3456. "orderBys": []
  3457. },
  3458. "added": [
  3459. {
  3460. "key": "collection/a4",
  3461. "version": 0,
  3462. "value": {
  3463. "v": 1
  3464. },
  3465. "options": {
  3466. "hasLocalMutations": true,
  3467. "hasCommittedMutations": false
  3468. }
  3469. }
  3470. ],
  3471. "errorCode": 0,
  3472. "fromCache": true,
  3473. "hasPendingWrites": true
  3474. }
  3475. ]
  3476. },
  3477. {
  3478. "userSet": [
  3479. "collection/a5",
  3480. {
  3481. "v": 1
  3482. }
  3483. ],
  3484. "expectedSnapshotEvents": [
  3485. {
  3486. "query": {
  3487. "path": "collection",
  3488. "filters": [],
  3489. "orderBys": []
  3490. },
  3491. "added": [
  3492. {
  3493. "key": "collection/a5",
  3494. "version": 0,
  3495. "value": {
  3496. "v": 1
  3497. },
  3498. "options": {
  3499. "hasLocalMutations": true,
  3500. "hasCommittedMutations": false
  3501. }
  3502. }
  3503. ],
  3504. "errorCode": 0,
  3505. "fromCache": true,
  3506. "hasPendingWrites": true
  3507. }
  3508. ]
  3509. },
  3510. {
  3511. "userSet": [
  3512. "collection/a6",
  3513. {
  3514. "v": 1
  3515. }
  3516. ],
  3517. "expectedSnapshotEvents": [
  3518. {
  3519. "query": {
  3520. "path": "collection",
  3521. "filters": [],
  3522. "orderBys": []
  3523. },
  3524. "added": [
  3525. {
  3526. "key": "collection/a6",
  3527. "version": 0,
  3528. "value": {
  3529. "v": 1
  3530. },
  3531. "options": {
  3532. "hasLocalMutations": true,
  3533. "hasCommittedMutations": false
  3534. }
  3535. }
  3536. ],
  3537. "errorCode": 0,
  3538. "fromCache": true,
  3539. "hasPendingWrites": true
  3540. }
  3541. ]
  3542. },
  3543. {
  3544. "userSet": [
  3545. "collection/a7",
  3546. {
  3547. "v": 1
  3548. }
  3549. ],
  3550. "expectedSnapshotEvents": [
  3551. {
  3552. "query": {
  3553. "path": "collection",
  3554. "filters": [],
  3555. "orderBys": []
  3556. },
  3557. "added": [
  3558. {
  3559. "key": "collection/a7",
  3560. "version": 0,
  3561. "value": {
  3562. "v": 1
  3563. },
  3564. "options": {
  3565. "hasLocalMutations": true,
  3566. "hasCommittedMutations": false
  3567. }
  3568. }
  3569. ],
  3570. "errorCode": 0,
  3571. "fromCache": true,
  3572. "hasPendingWrites": true
  3573. }
  3574. ]
  3575. },
  3576. {
  3577. "userSet": [
  3578. "collection/a8",
  3579. {
  3580. "v": 1
  3581. }
  3582. ],
  3583. "expectedSnapshotEvents": [
  3584. {
  3585. "query": {
  3586. "path": "collection",
  3587. "filters": [],
  3588. "orderBys": []
  3589. },
  3590. "added": [
  3591. {
  3592. "key": "collection/a8",
  3593. "version": 0,
  3594. "value": {
  3595. "v": 1
  3596. },
  3597. "options": {
  3598. "hasLocalMutations": true,
  3599. "hasCommittedMutations": false
  3600. }
  3601. }
  3602. ],
  3603. "errorCode": 0,
  3604. "fromCache": true,
  3605. "hasPendingWrites": true
  3606. }
  3607. ]
  3608. },
  3609. {
  3610. "userSet": [
  3611. "collection/a9",
  3612. {
  3613. "v": 1
  3614. }
  3615. ],
  3616. "expectedSnapshotEvents": [
  3617. {
  3618. "query": {
  3619. "path": "collection",
  3620. "filters": [],
  3621. "orderBys": []
  3622. },
  3623. "added": [
  3624. {
  3625. "key": "collection/a9",
  3626. "version": 0,
  3627. "value": {
  3628. "v": 1
  3629. },
  3630. "options": {
  3631. "hasLocalMutations": true,
  3632. "hasCommittedMutations": false
  3633. }
  3634. }
  3635. ],
  3636. "errorCode": 0,
  3637. "fromCache": true,
  3638. "hasPendingWrites": true
  3639. }
  3640. ]
  3641. },
  3642. {
  3643. "userSet": [
  3644. "collection/a10",
  3645. {
  3646. "v": 1
  3647. }
  3648. ],
  3649. "expectedSnapshotEvents": [
  3650. {
  3651. "query": {
  3652. "path": "collection",
  3653. "filters": [],
  3654. "orderBys": []
  3655. },
  3656. "added": [
  3657. {
  3658. "key": "collection/a10",
  3659. "version": 0,
  3660. "value": {
  3661. "v": 1
  3662. },
  3663. "options": {
  3664. "hasLocalMutations": true,
  3665. "hasCommittedMutations": false
  3666. }
  3667. }
  3668. ],
  3669. "errorCode": 0,
  3670. "fromCache": true,
  3671. "hasPendingWrites": true
  3672. }
  3673. ]
  3674. },
  3675. {
  3676. "userSet": [
  3677. "collection/a11",
  3678. {
  3679. "v": 1
  3680. }
  3681. ],
  3682. "expectedSnapshotEvents": [
  3683. {
  3684. "query": {
  3685. "path": "collection",
  3686. "filters": [],
  3687. "orderBys": []
  3688. },
  3689. "added": [
  3690. {
  3691. "key": "collection/a11",
  3692. "version": 0,
  3693. "value": {
  3694. "v": 1
  3695. },
  3696. "options": {
  3697. "hasLocalMutations": true,
  3698. "hasCommittedMutations": false
  3699. }
  3700. }
  3701. ],
  3702. "errorCode": 0,
  3703. "fromCache": true,
  3704. "hasPendingWrites": true
  3705. }
  3706. ]
  3707. },
  3708. {
  3709. "userSet": [
  3710. "collection/a12",
  3711. {
  3712. "v": 1
  3713. }
  3714. ],
  3715. "expectedSnapshotEvents": [
  3716. {
  3717. "query": {
  3718. "path": "collection",
  3719. "filters": [],
  3720. "orderBys": []
  3721. },
  3722. "added": [
  3723. {
  3724. "key": "collection/a12",
  3725. "version": 0,
  3726. "value": {
  3727. "v": 1
  3728. },
  3729. "options": {
  3730. "hasLocalMutations": true,
  3731. "hasCommittedMutations": false
  3732. }
  3733. }
  3734. ],
  3735. "errorCode": 0,
  3736. "fromCache": true,
  3737. "hasPendingWrites": true
  3738. }
  3739. ]
  3740. },
  3741. {
  3742. "userSet": [
  3743. "collection/a13",
  3744. {
  3745. "v": 1
  3746. }
  3747. ],
  3748. "expectedSnapshotEvents": [
  3749. {
  3750. "query": {
  3751. "path": "collection",
  3752. "filters": [],
  3753. "orderBys": []
  3754. },
  3755. "added": [
  3756. {
  3757. "key": "collection/a13",
  3758. "version": 0,
  3759. "value": {
  3760. "v": 1
  3761. },
  3762. "options": {
  3763. "hasLocalMutations": true,
  3764. "hasCommittedMutations": false
  3765. }
  3766. }
  3767. ],
  3768. "errorCode": 0,
  3769. "fromCache": true,
  3770. "hasPendingWrites": true
  3771. }
  3772. ]
  3773. },
  3774. {
  3775. "userSet": [
  3776. "collection/a14",
  3777. {
  3778. "v": 1
  3779. }
  3780. ],
  3781. "expectedSnapshotEvents": [
  3782. {
  3783. "query": {
  3784. "path": "collection",
  3785. "filters": [],
  3786. "orderBys": []
  3787. },
  3788. "added": [
  3789. {
  3790. "key": "collection/a14",
  3791. "version": 0,
  3792. "value": {
  3793. "v": 1
  3794. },
  3795. "options": {
  3796. "hasLocalMutations": true,
  3797. "hasCommittedMutations": false
  3798. }
  3799. }
  3800. ],
  3801. "errorCode": 0,
  3802. "fromCache": true,
  3803. "hasPendingWrites": true
  3804. }
  3805. ],
  3806. "expectedState": {
  3807. "numOutstandingWrites": 10
  3808. }
  3809. },
  3810. {
  3811. "failWrite": {
  3812. "error": {
  3813. "code": 7
  3814. }
  3815. },
  3816. "expectedState": {
  3817. "userCallbacks": {
  3818. "acknowledgedDocs": [],
  3819. "rejectedDocs": [
  3820. "collection/a0"
  3821. ]
  3822. }
  3823. },
  3824. "expectedSnapshotEvents": [
  3825. {
  3826. "query": {
  3827. "path": "collection",
  3828. "filters": [],
  3829. "orderBys": []
  3830. },
  3831. "removed": [
  3832. {
  3833. "key": "collection/a0",
  3834. "version": 0,
  3835. "value": {
  3836. "v": 1
  3837. },
  3838. "options": {
  3839. "hasLocalMutations": true,
  3840. "hasCommittedMutations": false
  3841. }
  3842. }
  3843. ],
  3844. "errorCode": 0,
  3845. "fromCache": true,
  3846. "hasPendingWrites": true
  3847. }
  3848. ]
  3849. },
  3850. {
  3851. "failWrite": {
  3852. "error": {
  3853. "code": 7
  3854. }
  3855. },
  3856. "expectedState": {
  3857. "userCallbacks": {
  3858. "acknowledgedDocs": [],
  3859. "rejectedDocs": [
  3860. "collection/a1"
  3861. ]
  3862. }
  3863. },
  3864. "expectedSnapshotEvents": [
  3865. {
  3866. "query": {
  3867. "path": "collection",
  3868. "filters": [],
  3869. "orderBys": []
  3870. },
  3871. "removed": [
  3872. {
  3873. "key": "collection/a1",
  3874. "version": 0,
  3875. "value": {
  3876. "v": 1
  3877. },
  3878. "options": {
  3879. "hasLocalMutations": true,
  3880. "hasCommittedMutations": false
  3881. }
  3882. }
  3883. ],
  3884. "errorCode": 0,
  3885. "fromCache": true,
  3886. "hasPendingWrites": true
  3887. }
  3888. ]
  3889. },
  3890. {
  3891. "failWrite": {
  3892. "error": {
  3893. "code": 7
  3894. }
  3895. },
  3896. "expectedState": {
  3897. "userCallbacks": {
  3898. "acknowledgedDocs": [],
  3899. "rejectedDocs": [
  3900. "collection/a2"
  3901. ]
  3902. }
  3903. },
  3904. "expectedSnapshotEvents": [
  3905. {
  3906. "query": {
  3907. "path": "collection",
  3908. "filters": [],
  3909. "orderBys": []
  3910. },
  3911. "removed": [
  3912. {
  3913. "key": "collection/a2",
  3914. "version": 0,
  3915. "value": {
  3916. "v": 1
  3917. },
  3918. "options": {
  3919. "hasLocalMutations": true,
  3920. "hasCommittedMutations": false
  3921. }
  3922. }
  3923. ],
  3924. "errorCode": 0,
  3925. "fromCache": true,
  3926. "hasPendingWrites": true
  3927. }
  3928. ]
  3929. },
  3930. {
  3931. "failWrite": {
  3932. "error": {
  3933. "code": 7
  3934. }
  3935. },
  3936. "expectedState": {
  3937. "userCallbacks": {
  3938. "acknowledgedDocs": [],
  3939. "rejectedDocs": [
  3940. "collection/a3"
  3941. ]
  3942. }
  3943. },
  3944. "expectedSnapshotEvents": [
  3945. {
  3946. "query": {
  3947. "path": "collection",
  3948. "filters": [],
  3949. "orderBys": []
  3950. },
  3951. "removed": [
  3952. {
  3953. "key": "collection/a3",
  3954. "version": 0,
  3955. "value": {
  3956. "v": 1
  3957. },
  3958. "options": {
  3959. "hasLocalMutations": true,
  3960. "hasCommittedMutations": false
  3961. }
  3962. }
  3963. ],
  3964. "errorCode": 0,
  3965. "fromCache": true,
  3966. "hasPendingWrites": true
  3967. }
  3968. ]
  3969. },
  3970. {
  3971. "failWrite": {
  3972. "error": {
  3973. "code": 7
  3974. }
  3975. },
  3976. "expectedState": {
  3977. "userCallbacks": {
  3978. "acknowledgedDocs": [],
  3979. "rejectedDocs": [
  3980. "collection/a4"
  3981. ]
  3982. }
  3983. },
  3984. "expectedSnapshotEvents": [
  3985. {
  3986. "query": {
  3987. "path": "collection",
  3988. "filters": [],
  3989. "orderBys": []
  3990. },
  3991. "removed": [
  3992. {
  3993. "key": "collection/a4",
  3994. "version": 0,
  3995. "value": {
  3996. "v": 1
  3997. },
  3998. "options": {
  3999. "hasLocalMutations": true,
  4000. "hasCommittedMutations": false
  4001. }
  4002. }
  4003. ],
  4004. "errorCode": 0,
  4005. "fromCache": true,
  4006. "hasPendingWrites": true
  4007. }
  4008. ]
  4009. },
  4010. {
  4011. "failWrite": {
  4012. "error": {
  4013. "code": 7
  4014. }
  4015. },
  4016. "expectedState": {
  4017. "userCallbacks": {
  4018. "acknowledgedDocs": [],
  4019. "rejectedDocs": [
  4020. "collection/a5"
  4021. ]
  4022. }
  4023. },
  4024. "expectedSnapshotEvents": [
  4025. {
  4026. "query": {
  4027. "path": "collection",
  4028. "filters": [],
  4029. "orderBys": []
  4030. },
  4031. "removed": [
  4032. {
  4033. "key": "collection/a5",
  4034. "version": 0,
  4035. "value": {
  4036. "v": 1
  4037. },
  4038. "options": {
  4039. "hasLocalMutations": true,
  4040. "hasCommittedMutations": false
  4041. }
  4042. }
  4043. ],
  4044. "errorCode": 0,
  4045. "fromCache": true,
  4046. "hasPendingWrites": true
  4047. }
  4048. ]
  4049. },
  4050. {
  4051. "failWrite": {
  4052. "error": {
  4053. "code": 7
  4054. }
  4055. },
  4056. "expectedState": {
  4057. "userCallbacks": {
  4058. "acknowledgedDocs": [],
  4059. "rejectedDocs": [
  4060. "collection/a6"
  4061. ]
  4062. }
  4063. },
  4064. "expectedSnapshotEvents": [
  4065. {
  4066. "query": {
  4067. "path": "collection",
  4068. "filters": [],
  4069. "orderBys": []
  4070. },
  4071. "removed": [
  4072. {
  4073. "key": "collection/a6",
  4074. "version": 0,
  4075. "value": {
  4076. "v": 1
  4077. },
  4078. "options": {
  4079. "hasLocalMutations": true,
  4080. "hasCommittedMutations": false
  4081. }
  4082. }
  4083. ],
  4084. "errorCode": 0,
  4085. "fromCache": true,
  4086. "hasPendingWrites": true
  4087. }
  4088. ]
  4089. },
  4090. {
  4091. "failWrite": {
  4092. "error": {
  4093. "code": 7
  4094. }
  4095. },
  4096. "expectedState": {
  4097. "userCallbacks": {
  4098. "acknowledgedDocs": [],
  4099. "rejectedDocs": [
  4100. "collection/a7"
  4101. ]
  4102. }
  4103. },
  4104. "expectedSnapshotEvents": [
  4105. {
  4106. "query": {
  4107. "path": "collection",
  4108. "filters": [],
  4109. "orderBys": []
  4110. },
  4111. "removed": [
  4112. {
  4113. "key": "collection/a7",
  4114. "version": 0,
  4115. "value": {
  4116. "v": 1
  4117. },
  4118. "options": {
  4119. "hasLocalMutations": true,
  4120. "hasCommittedMutations": false
  4121. }
  4122. }
  4123. ],
  4124. "errorCode": 0,
  4125. "fromCache": true,
  4126. "hasPendingWrites": true
  4127. }
  4128. ]
  4129. },
  4130. {
  4131. "failWrite": {
  4132. "error": {
  4133. "code": 7
  4134. }
  4135. },
  4136. "expectedState": {
  4137. "userCallbacks": {
  4138. "acknowledgedDocs": [],
  4139. "rejectedDocs": [
  4140. "collection/a8"
  4141. ]
  4142. }
  4143. },
  4144. "expectedSnapshotEvents": [
  4145. {
  4146. "query": {
  4147. "path": "collection",
  4148. "filters": [],
  4149. "orderBys": []
  4150. },
  4151. "removed": [
  4152. {
  4153. "key": "collection/a8",
  4154. "version": 0,
  4155. "value": {
  4156. "v": 1
  4157. },
  4158. "options": {
  4159. "hasLocalMutations": true,
  4160. "hasCommittedMutations": false
  4161. }
  4162. }
  4163. ],
  4164. "errorCode": 0,
  4165. "fromCache": true,
  4166. "hasPendingWrites": true
  4167. }
  4168. ]
  4169. },
  4170. {
  4171. "failWrite": {
  4172. "error": {
  4173. "code": 7
  4174. }
  4175. },
  4176. "expectedState": {
  4177. "userCallbacks": {
  4178. "acknowledgedDocs": [],
  4179. "rejectedDocs": [
  4180. "collection/a9"
  4181. ]
  4182. }
  4183. },
  4184. "expectedSnapshotEvents": [
  4185. {
  4186. "query": {
  4187. "path": "collection",
  4188. "filters": [],
  4189. "orderBys": []
  4190. },
  4191. "removed": [
  4192. {
  4193. "key": "collection/a9",
  4194. "version": 0,
  4195. "value": {
  4196. "v": 1
  4197. },
  4198. "options": {
  4199. "hasLocalMutations": true,
  4200. "hasCommittedMutations": false
  4201. }
  4202. }
  4203. ],
  4204. "errorCode": 0,
  4205. "fromCache": true,
  4206. "hasPendingWrites": true
  4207. }
  4208. ]
  4209. },
  4210. {
  4211. "failWrite": {
  4212. "error": {
  4213. "code": 7
  4214. }
  4215. },
  4216. "expectedState": {
  4217. "userCallbacks": {
  4218. "acknowledgedDocs": [],
  4219. "rejectedDocs": [
  4220. "collection/a10"
  4221. ]
  4222. }
  4223. },
  4224. "expectedSnapshotEvents": [
  4225. {
  4226. "query": {
  4227. "path": "collection",
  4228. "filters": [],
  4229. "orderBys": []
  4230. },
  4231. "removed": [
  4232. {
  4233. "key": "collection/a10",
  4234. "version": 0,
  4235. "value": {
  4236. "v": 1
  4237. },
  4238. "options": {
  4239. "hasLocalMutations": true,
  4240. "hasCommittedMutations": false
  4241. }
  4242. }
  4243. ],
  4244. "errorCode": 0,
  4245. "fromCache": true,
  4246. "hasPendingWrites": true
  4247. }
  4248. ]
  4249. },
  4250. {
  4251. "failWrite": {
  4252. "error": {
  4253. "code": 7
  4254. }
  4255. },
  4256. "expectedState": {
  4257. "userCallbacks": {
  4258. "acknowledgedDocs": [],
  4259. "rejectedDocs": [
  4260. "collection/a11"
  4261. ]
  4262. }
  4263. },
  4264. "expectedSnapshotEvents": [
  4265. {
  4266. "query": {
  4267. "path": "collection",
  4268. "filters": [],
  4269. "orderBys": []
  4270. },
  4271. "removed": [
  4272. {
  4273. "key": "collection/a11",
  4274. "version": 0,
  4275. "value": {
  4276. "v": 1
  4277. },
  4278. "options": {
  4279. "hasLocalMutations": true,
  4280. "hasCommittedMutations": false
  4281. }
  4282. }
  4283. ],
  4284. "errorCode": 0,
  4285. "fromCache": true,
  4286. "hasPendingWrites": true
  4287. }
  4288. ]
  4289. },
  4290. {
  4291. "failWrite": {
  4292. "error": {
  4293. "code": 7
  4294. }
  4295. },
  4296. "expectedState": {
  4297. "userCallbacks": {
  4298. "acknowledgedDocs": [],
  4299. "rejectedDocs": [
  4300. "collection/a12"
  4301. ]
  4302. }
  4303. },
  4304. "expectedSnapshotEvents": [
  4305. {
  4306. "query": {
  4307. "path": "collection",
  4308. "filters": [],
  4309. "orderBys": []
  4310. },
  4311. "removed": [
  4312. {
  4313. "key": "collection/a12",
  4314. "version": 0,
  4315. "value": {
  4316. "v": 1
  4317. },
  4318. "options": {
  4319. "hasLocalMutations": true,
  4320. "hasCommittedMutations": false
  4321. }
  4322. }
  4323. ],
  4324. "errorCode": 0,
  4325. "fromCache": true,
  4326. "hasPendingWrites": true
  4327. }
  4328. ]
  4329. },
  4330. {
  4331. "failWrite": {
  4332. "error": {
  4333. "code": 7
  4334. }
  4335. },
  4336. "expectedState": {
  4337. "userCallbacks": {
  4338. "acknowledgedDocs": [],
  4339. "rejectedDocs": [
  4340. "collection/a13"
  4341. ]
  4342. }
  4343. },
  4344. "expectedSnapshotEvents": [
  4345. {
  4346. "query": {
  4347. "path": "collection",
  4348. "filters": [],
  4349. "orderBys": []
  4350. },
  4351. "removed": [
  4352. {
  4353. "key": "collection/a13",
  4354. "version": 0,
  4355. "value": {
  4356. "v": 1
  4357. },
  4358. "options": {
  4359. "hasLocalMutations": true,
  4360. "hasCommittedMutations": false
  4361. }
  4362. }
  4363. ],
  4364. "errorCode": 0,
  4365. "fromCache": true,
  4366. "hasPendingWrites": true
  4367. }
  4368. ]
  4369. },
  4370. {
  4371. "failWrite": {
  4372. "error": {
  4373. "code": 7
  4374. }
  4375. },
  4376. "expectedState": {
  4377. "userCallbacks": {
  4378. "acknowledgedDocs": [],
  4379. "rejectedDocs": [
  4380. "collection/a14"
  4381. ]
  4382. },
  4383. "numOutstandingWrites": 0
  4384. },
  4385. "expectedSnapshotEvents": [
  4386. {
  4387. "query": {
  4388. "path": "collection",
  4389. "filters": [],
  4390. "orderBys": []
  4391. },
  4392. "removed": [
  4393. {
  4394. "key": "collection/a14",
  4395. "version": 0,
  4396. "value": {
  4397. "v": 1
  4398. },
  4399. "options": {
  4400. "hasLocalMutations": true,
  4401. "hasCommittedMutations": false
  4402. }
  4403. }
  4404. ],
  4405. "errorCode": 0,
  4406. "fromCache": true,
  4407. "hasPendingWrites": false
  4408. }
  4409. ]
  4410. }
  4411. ]
  4412. },
  4413. "Failed writes are released immediately.": {
  4414. "describeName": "Writes:",
  4415. "itName": "Failed writes are released immediately.",
  4416. "tags": [],
  4417. "config": {
  4418. "useGarbageCollection": true,
  4419. "numClients": 1
  4420. },
  4421. "steps": [
  4422. {
  4423. "userListen": [
  4424. 2,
  4425. {
  4426. "path": "collection",
  4427. "filters": [],
  4428. "orderBys": []
  4429. }
  4430. ],
  4431. "expectedState": {
  4432. "activeTargets": {
  4433. "2": {
  4434. "queries": [
  4435. {
  4436. "path": "collection",
  4437. "filters": [],
  4438. "orderBys": []
  4439. }
  4440. ],
  4441. "resumeToken": ""
  4442. }
  4443. }
  4444. }
  4445. },
  4446. {
  4447. "watchAck": [
  4448. 2
  4449. ]
  4450. },
  4451. {
  4452. "watchEntity": {
  4453. "docs": [
  4454. {
  4455. "key": "collection/a",
  4456. "version": 1000,
  4457. "value": {
  4458. "v": 1
  4459. },
  4460. "options": {
  4461. "hasLocalMutations": false,
  4462. "hasCommittedMutations": false
  4463. }
  4464. }
  4465. ],
  4466. "targets": [
  4467. 2
  4468. ]
  4469. }
  4470. },
  4471. {
  4472. "watchCurrent": [
  4473. [
  4474. 2
  4475. ],
  4476. "resume-token-1000"
  4477. ]
  4478. },
  4479. {
  4480. "watchSnapshot": {
  4481. "version": 1000,
  4482. "targetIds": []
  4483. },
  4484. "expectedSnapshotEvents": [
  4485. {
  4486. "query": {
  4487. "path": "collection",
  4488. "filters": [],
  4489. "orderBys": []
  4490. },
  4491. "added": [
  4492. {
  4493. "key": "collection/a",
  4494. "version": 1000,
  4495. "value": {
  4496. "v": 1
  4497. },
  4498. "options": {
  4499. "hasLocalMutations": false,
  4500. "hasCommittedMutations": false
  4501. }
  4502. }
  4503. ],
  4504. "errorCode": 0,
  4505. "fromCache": false,
  4506. "hasPendingWrites": false
  4507. }
  4508. ]
  4509. },
  4510. {
  4511. "userSet": [
  4512. "collection/b",
  4513. {
  4514. "v": 1
  4515. }
  4516. ],
  4517. "expectedSnapshotEvents": [
  4518. {
  4519. "query": {
  4520. "path": "collection",
  4521. "filters": [],
  4522. "orderBys": []
  4523. },
  4524. "added": [
  4525. {
  4526. "key": "collection/b",
  4527. "version": 0,
  4528. "value": {
  4529. "v": 1
  4530. },
  4531. "options": {
  4532. "hasLocalMutations": true,
  4533. "hasCommittedMutations": false
  4534. }
  4535. }
  4536. ],
  4537. "errorCode": 0,
  4538. "fromCache": false,
  4539. "hasPendingWrites": true
  4540. }
  4541. ]
  4542. },
  4543. {
  4544. "writeAck": {
  4545. "version": 2000
  4546. },
  4547. "expectedState": {
  4548. "userCallbacks": {
  4549. "acknowledgedDocs": [
  4550. "collection/b"
  4551. ],
  4552. "rejectedDocs": []
  4553. }
  4554. }
  4555. },
  4556. {
  4557. "userSet": [
  4558. "collection/a",
  4559. {
  4560. "v": 2
  4561. }
  4562. ],
  4563. "expectedSnapshotEvents": [
  4564. {
  4565. "query": {
  4566. "path": "collection",
  4567. "filters": [],
  4568. "orderBys": []
  4569. },
  4570. "modified": [
  4571. {
  4572. "key": "collection/a",
  4573. "version": 1000,
  4574. "value": {
  4575. "v": 2
  4576. },
  4577. "options": {
  4578. "hasLocalMutations": true,
  4579. "hasCommittedMutations": false
  4580. }
  4581. }
  4582. ],
  4583. "errorCode": 0,
  4584. "fromCache": false,
  4585. "hasPendingWrites": true
  4586. }
  4587. ]
  4588. },
  4589. {
  4590. "failWrite": {
  4591. "error": {
  4592. "code": 7
  4593. }
  4594. },
  4595. "expectedState": {
  4596. "userCallbacks": {
  4597. "acknowledgedDocs": [],
  4598. "rejectedDocs": [
  4599. "collection/a"
  4600. ]
  4601. }
  4602. },
  4603. "expectedSnapshotEvents": [
  4604. {
  4605. "query": {
  4606. "path": "collection",
  4607. "filters": [],
  4608. "orderBys": []
  4609. },
  4610. "modified": [
  4611. {
  4612. "key": "collection/a",
  4613. "version": 1000,
  4614. "value": {
  4615. "v": 1
  4616. },
  4617. "options": {
  4618. "hasLocalMutations": false,
  4619. "hasCommittedMutations": false
  4620. }
  4621. }
  4622. ],
  4623. "errorCode": 0,
  4624. "fromCache": false,
  4625. "hasPendingWrites": true
  4626. }
  4627. ]
  4628. },
  4629. {
  4630. "watchEntity": {
  4631. "docs": [
  4632. {
  4633. "key": "collection/b",
  4634. "version": 2000,
  4635. "value": {
  4636. "v": 1
  4637. },
  4638. "options": {
  4639. "hasLocalMutations": false,
  4640. "hasCommittedMutations": false
  4641. }
  4642. }
  4643. ],
  4644. "targets": [
  4645. 2
  4646. ]
  4647. }
  4648. },
  4649. {
  4650. "watchSnapshot": {
  4651. "version": 2000,
  4652. "targetIds": []
  4653. },
  4654. "expectedSnapshotEvents": [
  4655. {
  4656. "query": {
  4657. "path": "collection",
  4658. "filters": [],
  4659. "orderBys": []
  4660. },
  4661. "metadata": [
  4662. {
  4663. "key": "collection/b",
  4664. "version": 2000,
  4665. "value": {
  4666. "v": 1
  4667. },
  4668. "options": {
  4669. "hasLocalMutations": false,
  4670. "hasCommittedMutations": false
  4671. }
  4672. }
  4673. ],
  4674. "errorCode": 0,
  4675. "fromCache": false,
  4676. "hasPendingWrites": false
  4677. }
  4678. ]
  4679. }
  4680. ]
  4681. },
  4682. "Writes are not re-sent.": {
  4683. "describeName": "Writes:",
  4684. "itName": "Writes are not re-sent.",
  4685. "tags": [],
  4686. "config": {
  4687. "useGarbageCollection": true,
  4688. "numClients": 1
  4689. },
  4690. "steps": [
  4691. {
  4692. "userListen": [
  4693. 2,
  4694. {
  4695. "path": "collection",
  4696. "filters": [],
  4697. "orderBys": []
  4698. }
  4699. ],
  4700. "expectedState": {
  4701. "activeTargets": {
  4702. "2": {
  4703. "queries": [
  4704. {
  4705. "path": "collection",
  4706. "filters": [],
  4707. "orderBys": []
  4708. }
  4709. ],
  4710. "resumeToken": ""
  4711. }
  4712. }
  4713. }
  4714. },
  4715. {
  4716. "watchAck": [
  4717. 2
  4718. ]
  4719. },
  4720. {
  4721. "watchEntity": {
  4722. "docs": [],
  4723. "targets": [
  4724. 2
  4725. ]
  4726. }
  4727. },
  4728. {
  4729. "watchCurrent": [
  4730. [
  4731. 2
  4732. ],
  4733. "resume-token-500"
  4734. ]
  4735. },
  4736. {
  4737. "watchSnapshot": {
  4738. "version": 500,
  4739. "targetIds": []
  4740. },
  4741. "expectedSnapshotEvents": [
  4742. {
  4743. "query": {
  4744. "path": "collection",
  4745. "filters": [],
  4746. "orderBys": []
  4747. },
  4748. "errorCode": 0,
  4749. "fromCache": false,
  4750. "hasPendingWrites": false
  4751. }
  4752. ]
  4753. },
  4754. {
  4755. "userSet": [
  4756. "collection/a",
  4757. {
  4758. "v": 1
  4759. }
  4760. ],
  4761. "expectedSnapshotEvents": [
  4762. {
  4763. "query": {
  4764. "path": "collection",
  4765. "filters": [],
  4766. "orderBys": []
  4767. },
  4768. "added": [
  4769. {
  4770. "key": "collection/a",
  4771. "version": 0,
  4772. "value": {
  4773. "v": 1
  4774. },
  4775. "options": {
  4776. "hasLocalMutations": true,
  4777. "hasCommittedMutations": false
  4778. }
  4779. }
  4780. ],
  4781. "errorCode": 0,
  4782. "fromCache": false,
  4783. "hasPendingWrites": true
  4784. }
  4785. ]
  4786. },
  4787. {
  4788. "writeAck": {
  4789. "version": 1000
  4790. },
  4791. "expectedState": {
  4792. "userCallbacks": {
  4793. "acknowledgedDocs": [
  4794. "collection/a"
  4795. ],
  4796. "rejectedDocs": []
  4797. }
  4798. }
  4799. },
  4800. {
  4801. "userSet": [
  4802. "collection/b",
  4803. {
  4804. "v": 1
  4805. }
  4806. ],
  4807. "expectedSnapshotEvents": [
  4808. {
  4809. "query": {
  4810. "path": "collection",
  4811. "filters": [],
  4812. "orderBys": []
  4813. },
  4814. "added": [
  4815. {
  4816. "key": "collection/b",
  4817. "version": 0,
  4818. "value": {
  4819. "v": 1
  4820. },
  4821. "options": {
  4822. "hasLocalMutations": true,
  4823. "hasCommittedMutations": false
  4824. }
  4825. }
  4826. ],
  4827. "errorCode": 0,
  4828. "fromCache": false,
  4829. "hasPendingWrites": true
  4830. }
  4831. ]
  4832. },
  4833. {
  4834. "writeAck": {
  4835. "version": 2000
  4836. },
  4837. "expectedState": {
  4838. "userCallbacks": {
  4839. "acknowledgedDocs": [
  4840. "collection/b"
  4841. ],
  4842. "rejectedDocs": []
  4843. }
  4844. }
  4845. },
  4846. {
  4847. "watchEntity": {
  4848. "docs": [
  4849. {
  4850. "key": "collection/a",
  4851. "version": 1000,
  4852. "value": {
  4853. "v": 1
  4854. },
  4855. "options": {
  4856. "hasLocalMutations": false,
  4857. "hasCommittedMutations": false
  4858. }
  4859. },
  4860. {
  4861. "key": "collection/b",
  4862. "version": 2000,
  4863. "value": {
  4864. "v": 1
  4865. },
  4866. "options": {
  4867. "hasLocalMutations": false,
  4868. "hasCommittedMutations": false
  4869. }
  4870. }
  4871. ],
  4872. "targets": [
  4873. 2
  4874. ]
  4875. }
  4876. },
  4877. {
  4878. "watchSnapshot": {
  4879. "version": 2000,
  4880. "targetIds": []
  4881. },
  4882. "expectedSnapshotEvents": [
  4883. {
  4884. "query": {
  4885. "path": "collection",
  4886. "filters": [],
  4887. "orderBys": []
  4888. },
  4889. "metadata": [
  4890. {
  4891. "key": "collection/a",
  4892. "version": 1000,
  4893. "value": {
  4894. "v": 1
  4895. },
  4896. "options": {
  4897. "hasLocalMutations": false,
  4898. "hasCommittedMutations": false
  4899. }
  4900. },
  4901. {
  4902. "key": "collection/b",
  4903. "version": 2000,
  4904. "value": {
  4905. "v": 1
  4906. },
  4907. "options": {
  4908. "hasLocalMutations": false,
  4909. "hasCommittedMutations": false
  4910. }
  4911. }
  4912. ],
  4913. "errorCode": 0,
  4914. "fromCache": false,
  4915. "hasPendingWrites": false
  4916. }
  4917. ]
  4918. }
  4919. ]
  4920. },
  4921. "Writes are not re-sent after disable/enable network.": {
  4922. "describeName": "Writes:",
  4923. "itName": "Writes are not re-sent after disable/enable network.",
  4924. "tags": [],
  4925. "config": {
  4926. "useGarbageCollection": true,
  4927. "numClients": 1
  4928. },
  4929. "steps": [
  4930. {
  4931. "userListen": [
  4932. 2,
  4933. {
  4934. "path": "collection",
  4935. "filters": [],
  4936. "orderBys": []
  4937. }
  4938. ],
  4939. "expectedState": {
  4940. "activeTargets": {
  4941. "2": {
  4942. "queries": [
  4943. {
  4944. "path": "collection",
  4945. "filters": [],
  4946. "orderBys": []
  4947. }
  4948. ],
  4949. "resumeToken": ""
  4950. }
  4951. }
  4952. }
  4953. },
  4954. {
  4955. "watchAck": [
  4956. 2
  4957. ]
  4958. },
  4959. {
  4960. "watchEntity": {
  4961. "docs": [],
  4962. "targets": [
  4963. 2
  4964. ]
  4965. }
  4966. },
  4967. {
  4968. "watchCurrent": [
  4969. [
  4970. 2
  4971. ],
  4972. "resume-token-500"
  4973. ]
  4974. },
  4975. {
  4976. "watchSnapshot": {
  4977. "version": 500,
  4978. "targetIds": []
  4979. },
  4980. "expectedSnapshotEvents": [
  4981. {
  4982. "query": {
  4983. "path": "collection",
  4984. "filters": [],
  4985. "orderBys": []
  4986. },
  4987. "errorCode": 0,
  4988. "fromCache": false,
  4989. "hasPendingWrites": false
  4990. }
  4991. ]
  4992. },
  4993. {
  4994. "userSet": [
  4995. "collection/a",
  4996. {
  4997. "v": 1
  4998. }
  4999. ],
  5000. "expectedSnapshotEvents": [
  5001. {
  5002. "query": {
  5003. "path": "collection",
  5004. "filters": [],
  5005. "orderBys": []
  5006. },
  5007. "added": [
  5008. {
  5009. "key": "collection/a",
  5010. "version": 0,
  5011. "value": {
  5012. "v": 1
  5013. },
  5014. "options": {
  5015. "hasLocalMutations": true,
  5016. "hasCommittedMutations": false
  5017. }
  5018. }
  5019. ],
  5020. "errorCode": 0,
  5021. "fromCache": false,
  5022. "hasPendingWrites": true
  5023. }
  5024. ]
  5025. },
  5026. {
  5027. "writeAck": {
  5028. "version": 1000
  5029. },
  5030. "expectedState": {
  5031. "userCallbacks": {
  5032. "acknowledgedDocs": [
  5033. "collection/a"
  5034. ],
  5035. "rejectedDocs": []
  5036. },
  5037. "writeStreamRequestCount": 2
  5038. }
  5039. },
  5040. {
  5041. "enableNetwork": false,
  5042. "expectedState": {
  5043. "activeTargets": {},
  5044. "limboDocs": [],
  5045. "writeStreamRequestCount": 3
  5046. },
  5047. "expectedSnapshotEvents": [
  5048. {
  5049. "query": {
  5050. "path": "collection",
  5051. "filters": [],
  5052. "orderBys": []
  5053. },
  5054. "errorCode": 0,
  5055. "fromCache": true,
  5056. "hasPendingWrites": true
  5057. }
  5058. ]
  5059. },
  5060. {
  5061. "enableNetwork": true,
  5062. "expectedState": {
  5063. "activeTargets": {
  5064. "2": {
  5065. "queries": [
  5066. {
  5067. "path": "collection",
  5068. "filters": [],
  5069. "orderBys": []
  5070. }
  5071. ],
  5072. "resumeToken": "resume-token-500"
  5073. }
  5074. },
  5075. "writeStreamRequestCount": 3
  5076. }
  5077. },
  5078. {
  5079. "watchAck": [
  5080. 2
  5081. ]
  5082. },
  5083. {
  5084. "watchEntity": {
  5085. "docs": [
  5086. {
  5087. "key": "collection/a",
  5088. "version": 1000,
  5089. "value": {
  5090. "v": 1
  5091. },
  5092. "options": {
  5093. "hasLocalMutations": false,
  5094. "hasCommittedMutations": false
  5095. }
  5096. }
  5097. ],
  5098. "targets": [
  5099. 2
  5100. ]
  5101. }
  5102. },
  5103. {
  5104. "watchCurrent": [
  5105. [
  5106. 2
  5107. ],
  5108. "resume-token-2000"
  5109. ]
  5110. },
  5111. {
  5112. "watchSnapshot": {
  5113. "version": 2000,
  5114. "targetIds": []
  5115. },
  5116. "expectedSnapshotEvents": [
  5117. {
  5118. "query": {
  5119. "path": "collection",
  5120. "filters": [],
  5121. "orderBys": []
  5122. },
  5123. "metadata": [
  5124. {
  5125. "key": "collection/a",
  5126. "version": 1000,
  5127. "value": {
  5128. "v": 1
  5129. },
  5130. "options": {
  5131. "hasLocalMutations": false,
  5132. "hasCommittedMutations": false
  5133. }
  5134. }
  5135. ],
  5136. "errorCode": 0,
  5137. "fromCache": false,
  5138. "hasPendingWrites": false
  5139. }
  5140. ]
  5141. }
  5142. ]
  5143. },
  5144. "Writes are released when there are no queries left": {
  5145. "describeName": "Writes:",
  5146. "itName": "Writes are released when there are no queries left",
  5147. "tags": [
  5148. "eager-gc"
  5149. ],
  5150. "comment": "This test verifies that committed mutations are eligible for garbage collection on target removal",
  5151. "config": {
  5152. "useGarbageCollection": true,
  5153. "numClients": 1
  5154. },
  5155. "steps": [
  5156. {
  5157. "userListen": [
  5158. 2,
  5159. {
  5160. "path": "collection",
  5161. "filters": [],
  5162. "orderBys": []
  5163. }
  5164. ],
  5165. "expectedState": {
  5166. "activeTargets": {
  5167. "2": {
  5168. "queries": [
  5169. {
  5170. "path": "collection",
  5171. "filters": [],
  5172. "orderBys": []
  5173. }
  5174. ],
  5175. "resumeToken": ""
  5176. }
  5177. }
  5178. }
  5179. },
  5180. {
  5181. "watchAck": [
  5182. 2
  5183. ]
  5184. },
  5185. {
  5186. "watchEntity": {
  5187. "docs": [],
  5188. "targets": [
  5189. 2
  5190. ]
  5191. }
  5192. },
  5193. {
  5194. "watchCurrent": [
  5195. [
  5196. 2
  5197. ],
  5198. "resume-token-500"
  5199. ]
  5200. },
  5201. {
  5202. "watchSnapshot": {
  5203. "version": 500,
  5204. "targetIds": []
  5205. },
  5206. "expectedSnapshotEvents": [
  5207. {
  5208. "query": {
  5209. "path": "collection",
  5210. "filters": [],
  5211. "orderBys": []
  5212. },
  5213. "errorCode": 0,
  5214. "fromCache": false,
  5215. "hasPendingWrites": false
  5216. }
  5217. ]
  5218. },
  5219. {
  5220. "userSet": [
  5221. "collection/a",
  5222. {
  5223. "v": 1
  5224. }
  5225. ],
  5226. "expectedSnapshotEvents": [
  5227. {
  5228. "query": {
  5229. "path": "collection",
  5230. "filters": [],
  5231. "orderBys": []
  5232. },
  5233. "added": [
  5234. {
  5235. "key": "collection/a",
  5236. "version": 0,
  5237. "value": {
  5238. "v": 1
  5239. },
  5240. "options": {
  5241. "hasLocalMutations": true,
  5242. "hasCommittedMutations": false
  5243. }
  5244. }
  5245. ],
  5246. "errorCode": 0,
  5247. "fromCache": false,
  5248. "hasPendingWrites": true
  5249. }
  5250. ]
  5251. },
  5252. {
  5253. "writeAck": {
  5254. "version": 1000
  5255. },
  5256. "expectedState": {
  5257. "userCallbacks": {
  5258. "acknowledgedDocs": [
  5259. "collection/a"
  5260. ],
  5261. "rejectedDocs": []
  5262. }
  5263. }
  5264. },
  5265. {
  5266. "userUnlisten": [
  5267. 2,
  5268. {
  5269. "path": "collection",
  5270. "filters": [],
  5271. "orderBys": []
  5272. }
  5273. ],
  5274. "expectedState": {
  5275. "activeTargets": {}
  5276. }
  5277. },
  5278. {
  5279. "userListen": [
  5280. 4,
  5281. {
  5282. "path": "collection",
  5283. "filters": [],
  5284. "orderBys": []
  5285. }
  5286. ],
  5287. "expectedState": {
  5288. "activeTargets": {
  5289. "4": {
  5290. "queries": [
  5291. {
  5292. "path": "collection",
  5293. "filters": [],
  5294. "orderBys": []
  5295. }
  5296. ],
  5297. "resumeToken": ""
  5298. }
  5299. }
  5300. }
  5301. }
  5302. ]
  5303. },
  5304. "Writes that fail with code invalid-argument are rejected": {
  5305. "describeName": "Writes:",
  5306. "itName": "Writes that fail with code invalid-argument are rejected",
  5307. "tags": [],
  5308. "config": {
  5309. "useGarbageCollection": true,
  5310. "numClients": 1
  5311. },
  5312. "steps": [
  5313. {
  5314. "userListen": [
  5315. 2,
  5316. {
  5317. "path": "collection/key",
  5318. "filters": [],
  5319. "orderBys": []
  5320. }
  5321. ],
  5322. "expectedState": {
  5323. "activeTargets": {
  5324. "2": {
  5325. "queries": [
  5326. {
  5327. "path": "collection/key",
  5328. "filters": [],
  5329. "orderBys": []
  5330. }
  5331. ],
  5332. "resumeToken": ""
  5333. }
  5334. }
  5335. }
  5336. },
  5337. {
  5338. "userSet": [
  5339. "collection/key",
  5340. {
  5341. "foo": "bar"
  5342. }
  5343. ],
  5344. "expectedSnapshotEvents": [
  5345. {
  5346. "query": {
  5347. "path": "collection/key",
  5348. "filters": [],
  5349. "orderBys": []
  5350. },
  5351. "added": [
  5352. {
  5353. "key": "collection/key",
  5354. "version": 0,
  5355. "value": {
  5356. "foo": "bar"
  5357. },
  5358. "options": {
  5359. "hasLocalMutations": true,
  5360. "hasCommittedMutations": false
  5361. }
  5362. }
  5363. ],
  5364. "errorCode": 0,
  5365. "fromCache": true,
  5366. "hasPendingWrites": true
  5367. }
  5368. ]
  5369. },
  5370. {
  5371. "failWrite": {
  5372. "error": {
  5373. "code": 3
  5374. }
  5375. },
  5376. "expectedState": {
  5377. "userCallbacks": {
  5378. "acknowledgedDocs": [],
  5379. "rejectedDocs": [
  5380. "collection/key"
  5381. ]
  5382. }
  5383. },
  5384. "expectedSnapshotEvents": [
  5385. {
  5386. "query": {
  5387. "path": "collection/key",
  5388. "filters": [],
  5389. "orderBys": []
  5390. },
  5391. "removed": [
  5392. {
  5393. "key": "collection/key",
  5394. "version": 0,
  5395. "value": {
  5396. "foo": "bar"
  5397. },
  5398. "options": {
  5399. "hasLocalMutations": true,
  5400. "hasCommittedMutations": false
  5401. }
  5402. }
  5403. ],
  5404. "errorCode": 0,
  5405. "fromCache": true,
  5406. "hasPendingWrites": false
  5407. }
  5408. ]
  5409. }
  5410. ]
  5411. },
  5412. "Writes that fail with code not-found are rejected": {
  5413. "describeName": "Writes:",
  5414. "itName": "Writes that fail with code not-found are rejected",
  5415. "tags": [],
  5416. "config": {
  5417. "useGarbageCollection": true,
  5418. "numClients": 1
  5419. },
  5420. "steps": [
  5421. {
  5422. "userListen": [
  5423. 2,
  5424. {
  5425. "path": "collection/key",
  5426. "filters": [],
  5427. "orderBys": []
  5428. }
  5429. ],
  5430. "expectedState": {
  5431. "activeTargets": {
  5432. "2": {
  5433. "queries": [
  5434. {
  5435. "path": "collection/key",
  5436. "filters": [],
  5437. "orderBys": []
  5438. }
  5439. ],
  5440. "resumeToken": ""
  5441. }
  5442. }
  5443. }
  5444. },
  5445. {
  5446. "userSet": [
  5447. "collection/key",
  5448. {
  5449. "foo": "bar"
  5450. }
  5451. ],
  5452. "expectedSnapshotEvents": [
  5453. {
  5454. "query": {
  5455. "path": "collection/key",
  5456. "filters": [],
  5457. "orderBys": []
  5458. },
  5459. "added": [
  5460. {
  5461. "key": "collection/key",
  5462. "version": 0,
  5463. "value": {
  5464. "foo": "bar"
  5465. },
  5466. "options": {
  5467. "hasLocalMutations": true,
  5468. "hasCommittedMutations": false
  5469. }
  5470. }
  5471. ],
  5472. "errorCode": 0,
  5473. "fromCache": true,
  5474. "hasPendingWrites": true
  5475. }
  5476. ]
  5477. },
  5478. {
  5479. "failWrite": {
  5480. "error": {
  5481. "code": 5
  5482. }
  5483. },
  5484. "expectedState": {
  5485. "userCallbacks": {
  5486. "acknowledgedDocs": [],
  5487. "rejectedDocs": [
  5488. "collection/key"
  5489. ]
  5490. }
  5491. },
  5492. "expectedSnapshotEvents": [
  5493. {
  5494. "query": {
  5495. "path": "collection/key",
  5496. "filters": [],
  5497. "orderBys": []
  5498. },
  5499. "removed": [
  5500. {
  5501. "key": "collection/key",
  5502. "version": 0,
  5503. "value": {
  5504. "foo": "bar"
  5505. },
  5506. "options": {
  5507. "hasLocalMutations": true,
  5508. "hasCommittedMutations": false
  5509. }
  5510. }
  5511. ],
  5512. "errorCode": 0,
  5513. "fromCache": true,
  5514. "hasPendingWrites": false
  5515. }
  5516. ]
  5517. }
  5518. ]
  5519. },
  5520. "Writes that fail with code already-exists are rejected": {
  5521. "describeName": "Writes:",
  5522. "itName": "Writes that fail with code already-exists are rejected",
  5523. "tags": [],
  5524. "config": {
  5525. "useGarbageCollection": true,
  5526. "numClients": 1
  5527. },
  5528. "steps": [
  5529. {
  5530. "userListen": [
  5531. 2,
  5532. {
  5533. "path": "collection/key",
  5534. "filters": [],
  5535. "orderBys": []
  5536. }
  5537. ],
  5538. "expectedState": {
  5539. "activeTargets": {
  5540. "2": {
  5541. "queries": [
  5542. {
  5543. "path": "collection/key",
  5544. "filters": [],
  5545. "orderBys": []
  5546. }
  5547. ],
  5548. "resumeToken": ""
  5549. }
  5550. }
  5551. }
  5552. },
  5553. {
  5554. "userSet": [
  5555. "collection/key",
  5556. {
  5557. "foo": "bar"
  5558. }
  5559. ],
  5560. "expectedSnapshotEvents": [
  5561. {
  5562. "query": {
  5563. "path": "collection/key",
  5564. "filters": [],
  5565. "orderBys": []
  5566. },
  5567. "added": [
  5568. {
  5569. "key": "collection/key",
  5570. "version": 0,
  5571. "value": {
  5572. "foo": "bar"
  5573. },
  5574. "options": {
  5575. "hasLocalMutations": true,
  5576. "hasCommittedMutations": false
  5577. }
  5578. }
  5579. ],
  5580. "errorCode": 0,
  5581. "fromCache": true,
  5582. "hasPendingWrites": true
  5583. }
  5584. ]
  5585. },
  5586. {
  5587. "failWrite": {
  5588. "error": {
  5589. "code": 6
  5590. }
  5591. },
  5592. "expectedState": {
  5593. "userCallbacks": {
  5594. "acknowledgedDocs": [],
  5595. "rejectedDocs": [
  5596. "collection/key"
  5597. ]
  5598. }
  5599. },
  5600. "expectedSnapshotEvents": [
  5601. {
  5602. "query": {
  5603. "path": "collection/key",
  5604. "filters": [],
  5605. "orderBys": []
  5606. },
  5607. "removed": [
  5608. {
  5609. "key": "collection/key",
  5610. "version": 0,
  5611. "value": {
  5612. "foo": "bar"
  5613. },
  5614. "options": {
  5615. "hasLocalMutations": true,
  5616. "hasCommittedMutations": false
  5617. }
  5618. }
  5619. ],
  5620. "errorCode": 0,
  5621. "fromCache": true,
  5622. "hasPendingWrites": false
  5623. }
  5624. ]
  5625. }
  5626. ]
  5627. },
  5628. "Writes that fail with code permission-denied are rejected": {
  5629. "describeName": "Writes:",
  5630. "itName": "Writes that fail with code permission-denied are rejected",
  5631. "tags": [],
  5632. "config": {
  5633. "useGarbageCollection": true,
  5634. "numClients": 1
  5635. },
  5636. "steps": [
  5637. {
  5638. "userListen": [
  5639. 2,
  5640. {
  5641. "path": "collection/key",
  5642. "filters": [],
  5643. "orderBys": []
  5644. }
  5645. ],
  5646. "expectedState": {
  5647. "activeTargets": {
  5648. "2": {
  5649. "queries": [
  5650. {
  5651. "path": "collection/key",
  5652. "filters": [],
  5653. "orderBys": []
  5654. }
  5655. ],
  5656. "resumeToken": ""
  5657. }
  5658. }
  5659. }
  5660. },
  5661. {
  5662. "userSet": [
  5663. "collection/key",
  5664. {
  5665. "foo": "bar"
  5666. }
  5667. ],
  5668. "expectedSnapshotEvents": [
  5669. {
  5670. "query": {
  5671. "path": "collection/key",
  5672. "filters": [],
  5673. "orderBys": []
  5674. },
  5675. "added": [
  5676. {
  5677. "key": "collection/key",
  5678. "version": 0,
  5679. "value": {
  5680. "foo": "bar"
  5681. },
  5682. "options": {
  5683. "hasLocalMutations": true,
  5684. "hasCommittedMutations": false
  5685. }
  5686. }
  5687. ],
  5688. "errorCode": 0,
  5689. "fromCache": true,
  5690. "hasPendingWrites": true
  5691. }
  5692. ]
  5693. },
  5694. {
  5695. "failWrite": {
  5696. "error": {
  5697. "code": 7
  5698. }
  5699. },
  5700. "expectedState": {
  5701. "userCallbacks": {
  5702. "acknowledgedDocs": [],
  5703. "rejectedDocs": [
  5704. "collection/key"
  5705. ]
  5706. }
  5707. },
  5708. "expectedSnapshotEvents": [
  5709. {
  5710. "query": {
  5711. "path": "collection/key",
  5712. "filters": [],
  5713. "orderBys": []
  5714. },
  5715. "removed": [
  5716. {
  5717. "key": "collection/key",
  5718. "version": 0,
  5719. "value": {
  5720. "foo": "bar"
  5721. },
  5722. "options": {
  5723. "hasLocalMutations": true,
  5724. "hasCommittedMutations": false
  5725. }
  5726. }
  5727. ],
  5728. "errorCode": 0,
  5729. "fromCache": true,
  5730. "hasPendingWrites": false
  5731. }
  5732. ]
  5733. }
  5734. ]
  5735. },
  5736. "Writes that fail with code failed-precondition are rejected": {
  5737. "describeName": "Writes:",
  5738. "itName": "Writes that fail with code failed-precondition are rejected",
  5739. "tags": [],
  5740. "config": {
  5741. "useGarbageCollection": true,
  5742. "numClients": 1
  5743. },
  5744. "steps": [
  5745. {
  5746. "userListen": [
  5747. 2,
  5748. {
  5749. "path": "collection/key",
  5750. "filters": [],
  5751. "orderBys": []
  5752. }
  5753. ],
  5754. "expectedState": {
  5755. "activeTargets": {
  5756. "2": {
  5757. "queries": [
  5758. {
  5759. "path": "collection/key",
  5760. "filters": [],
  5761. "orderBys": []
  5762. }
  5763. ],
  5764. "resumeToken": ""
  5765. }
  5766. }
  5767. }
  5768. },
  5769. {
  5770. "userSet": [
  5771. "collection/key",
  5772. {
  5773. "foo": "bar"
  5774. }
  5775. ],
  5776. "expectedSnapshotEvents": [
  5777. {
  5778. "query": {
  5779. "path": "collection/key",
  5780. "filters": [],
  5781. "orderBys": []
  5782. },
  5783. "added": [
  5784. {
  5785. "key": "collection/key",
  5786. "version": 0,
  5787. "value": {
  5788. "foo": "bar"
  5789. },
  5790. "options": {
  5791. "hasLocalMutations": true,
  5792. "hasCommittedMutations": false
  5793. }
  5794. }
  5795. ],
  5796. "errorCode": 0,
  5797. "fromCache": true,
  5798. "hasPendingWrites": true
  5799. }
  5800. ]
  5801. },
  5802. {
  5803. "failWrite": {
  5804. "error": {
  5805. "code": 9
  5806. }
  5807. },
  5808. "expectedState": {
  5809. "userCallbacks": {
  5810. "acknowledgedDocs": [],
  5811. "rejectedDocs": [
  5812. "collection/key"
  5813. ]
  5814. }
  5815. },
  5816. "expectedSnapshotEvents": [
  5817. {
  5818. "query": {
  5819. "path": "collection/key",
  5820. "filters": [],
  5821. "orderBys": []
  5822. },
  5823. "removed": [
  5824. {
  5825. "key": "collection/key",
  5826. "version": 0,
  5827. "value": {
  5828. "foo": "bar"
  5829. },
  5830. "options": {
  5831. "hasLocalMutations": true,
  5832. "hasCommittedMutations": false
  5833. }
  5834. }
  5835. ],
  5836. "errorCode": 0,
  5837. "fromCache": true,
  5838. "hasPendingWrites": false
  5839. }
  5840. ]
  5841. }
  5842. ]
  5843. },
  5844. "Writes that fail with code out-of-range are rejected": {
  5845. "describeName": "Writes:",
  5846. "itName": "Writes that fail with code out-of-range are rejected",
  5847. "tags": [],
  5848. "config": {
  5849. "useGarbageCollection": true,
  5850. "numClients": 1
  5851. },
  5852. "steps": [
  5853. {
  5854. "userListen": [
  5855. 2,
  5856. {
  5857. "path": "collection/key",
  5858. "filters": [],
  5859. "orderBys": []
  5860. }
  5861. ],
  5862. "expectedState": {
  5863. "activeTargets": {
  5864. "2": {
  5865. "queries": [
  5866. {
  5867. "path": "collection/key",
  5868. "filters": [],
  5869. "orderBys": []
  5870. }
  5871. ],
  5872. "resumeToken": ""
  5873. }
  5874. }
  5875. }
  5876. },
  5877. {
  5878. "userSet": [
  5879. "collection/key",
  5880. {
  5881. "foo": "bar"
  5882. }
  5883. ],
  5884. "expectedSnapshotEvents": [
  5885. {
  5886. "query": {
  5887. "path": "collection/key",
  5888. "filters": [],
  5889. "orderBys": []
  5890. },
  5891. "added": [
  5892. {
  5893. "key": "collection/key",
  5894. "version": 0,
  5895. "value": {
  5896. "foo": "bar"
  5897. },
  5898. "options": {
  5899. "hasLocalMutations": true,
  5900. "hasCommittedMutations": false
  5901. }
  5902. }
  5903. ],
  5904. "errorCode": 0,
  5905. "fromCache": true,
  5906. "hasPendingWrites": true
  5907. }
  5908. ]
  5909. },
  5910. {
  5911. "failWrite": {
  5912. "error": {
  5913. "code": 11
  5914. }
  5915. },
  5916. "expectedState": {
  5917. "userCallbacks": {
  5918. "acknowledgedDocs": [],
  5919. "rejectedDocs": [
  5920. "collection/key"
  5921. ]
  5922. }
  5923. },
  5924. "expectedSnapshotEvents": [
  5925. {
  5926. "query": {
  5927. "path": "collection/key",
  5928. "filters": [],
  5929. "orderBys": []
  5930. },
  5931. "removed": [
  5932. {
  5933. "key": "collection/key",
  5934. "version": 0,
  5935. "value": {
  5936. "foo": "bar"
  5937. },
  5938. "options": {
  5939. "hasLocalMutations": true,
  5940. "hasCommittedMutations": false
  5941. }
  5942. }
  5943. ],
  5944. "errorCode": 0,
  5945. "fromCache": true,
  5946. "hasPendingWrites": false
  5947. }
  5948. ]
  5949. }
  5950. ]
  5951. },
  5952. "Writes that fail with code unimplemented are rejected": {
  5953. "describeName": "Writes:",
  5954. "itName": "Writes that fail with code unimplemented are rejected",
  5955. "tags": [],
  5956. "config": {
  5957. "useGarbageCollection": true,
  5958. "numClients": 1
  5959. },
  5960. "steps": [
  5961. {
  5962. "userListen": [
  5963. 2,
  5964. {
  5965. "path": "collection/key",
  5966. "filters": [],
  5967. "orderBys": []
  5968. }
  5969. ],
  5970. "expectedState": {
  5971. "activeTargets": {
  5972. "2": {
  5973. "queries": [
  5974. {
  5975. "path": "collection/key",
  5976. "filters": [],
  5977. "orderBys": []
  5978. }
  5979. ],
  5980. "resumeToken": ""
  5981. }
  5982. }
  5983. }
  5984. },
  5985. {
  5986. "userSet": [
  5987. "collection/key",
  5988. {
  5989. "foo": "bar"
  5990. }
  5991. ],
  5992. "expectedSnapshotEvents": [
  5993. {
  5994. "query": {
  5995. "path": "collection/key",
  5996. "filters": [],
  5997. "orderBys": []
  5998. },
  5999. "added": [
  6000. {
  6001. "key": "collection/key",
  6002. "version": 0,
  6003. "value": {
  6004. "foo": "bar"
  6005. },
  6006. "options": {
  6007. "hasLocalMutations": true,
  6008. "hasCommittedMutations": false
  6009. }
  6010. }
  6011. ],
  6012. "errorCode": 0,
  6013. "fromCache": true,
  6014. "hasPendingWrites": true
  6015. }
  6016. ]
  6017. },
  6018. {
  6019. "failWrite": {
  6020. "error": {
  6021. "code": 12
  6022. }
  6023. },
  6024. "expectedState": {
  6025. "userCallbacks": {
  6026. "acknowledgedDocs": [],
  6027. "rejectedDocs": [
  6028. "collection/key"
  6029. ]
  6030. }
  6031. },
  6032. "expectedSnapshotEvents": [
  6033. {
  6034. "query": {
  6035. "path": "collection/key",
  6036. "filters": [],
  6037. "orderBys": []
  6038. },
  6039. "removed": [
  6040. {
  6041. "key": "collection/key",
  6042. "version": 0,
  6043. "value": {
  6044. "foo": "bar"
  6045. },
  6046. "options": {
  6047. "hasLocalMutations": true,
  6048. "hasCommittedMutations": false
  6049. }
  6050. }
  6051. ],
  6052. "errorCode": 0,
  6053. "fromCache": true,
  6054. "hasPendingWrites": false
  6055. }
  6056. ]
  6057. }
  6058. ]
  6059. },
  6060. "Writes that fail with code data-loss are rejected": {
  6061. "describeName": "Writes:",
  6062. "itName": "Writes that fail with code data-loss are rejected",
  6063. "tags": [],
  6064. "config": {
  6065. "useGarbageCollection": true,
  6066. "numClients": 1
  6067. },
  6068. "steps": [
  6069. {
  6070. "userListen": [
  6071. 2,
  6072. {
  6073. "path": "collection/key",
  6074. "filters": [],
  6075. "orderBys": []
  6076. }
  6077. ],
  6078. "expectedState": {
  6079. "activeTargets": {
  6080. "2": {
  6081. "queries": [
  6082. {
  6083. "path": "collection/key",
  6084. "filters": [],
  6085. "orderBys": []
  6086. }
  6087. ],
  6088. "resumeToken": ""
  6089. }
  6090. }
  6091. }
  6092. },
  6093. {
  6094. "userSet": [
  6095. "collection/key",
  6096. {
  6097. "foo": "bar"
  6098. }
  6099. ],
  6100. "expectedSnapshotEvents": [
  6101. {
  6102. "query": {
  6103. "path": "collection/key",
  6104. "filters": [],
  6105. "orderBys": []
  6106. },
  6107. "added": [
  6108. {
  6109. "key": "collection/key",
  6110. "version": 0,
  6111. "value": {
  6112. "foo": "bar"
  6113. },
  6114. "options": {
  6115. "hasLocalMutations": true,
  6116. "hasCommittedMutations": false
  6117. }
  6118. }
  6119. ],
  6120. "errorCode": 0,
  6121. "fromCache": true,
  6122. "hasPendingWrites": true
  6123. }
  6124. ]
  6125. },
  6126. {
  6127. "failWrite": {
  6128. "error": {
  6129. "code": 15
  6130. }
  6131. },
  6132. "expectedState": {
  6133. "userCallbacks": {
  6134. "acknowledgedDocs": [],
  6135. "rejectedDocs": [
  6136. "collection/key"
  6137. ]
  6138. }
  6139. },
  6140. "expectedSnapshotEvents": [
  6141. {
  6142. "query": {
  6143. "path": "collection/key",
  6144. "filters": [],
  6145. "orderBys": []
  6146. },
  6147. "removed": [
  6148. {
  6149. "key": "collection/key",
  6150. "version": 0,
  6151. "value": {
  6152. "foo": "bar"
  6153. },
  6154. "options": {
  6155. "hasLocalMutations": true,
  6156. "hasCommittedMutations": false
  6157. }
  6158. }
  6159. ],
  6160. "errorCode": 0,
  6161. "fromCache": true,
  6162. "hasPendingWrites": false
  6163. }
  6164. ]
  6165. }
  6166. ]
  6167. },
  6168. "Writes that fail with code resource_exhausted are not rejected": {
  6169. "describeName": "Writes:",
  6170. "itName": "Writes that fail with code resource_exhausted are not rejected",
  6171. "tags": [],
  6172. "config": {
  6173. "useGarbageCollection": true,
  6174. "numClients": 1
  6175. },
  6176. "steps": [
  6177. {
  6178. "userListen": [
  6179. 2,
  6180. {
  6181. "path": "collection/key",
  6182. "filters": [],
  6183. "orderBys": []
  6184. }
  6185. ],
  6186. "expectedState": {
  6187. "activeTargets": {
  6188. "2": {
  6189. "queries": [
  6190. {
  6191. "path": "collection/key",
  6192. "filters": [],
  6193. "orderBys": []
  6194. }
  6195. ],
  6196. "resumeToken": ""
  6197. }
  6198. }
  6199. }
  6200. },
  6201. {
  6202. "userSet": [
  6203. "collection/key",
  6204. {
  6205. "foo": "bar"
  6206. }
  6207. ],
  6208. "expectedSnapshotEvents": [
  6209. {
  6210. "query": {
  6211. "path": "collection/key",
  6212. "filters": [],
  6213. "orderBys": []
  6214. },
  6215. "added": [
  6216. {
  6217. "key": "collection/key",
  6218. "version": 0,
  6219. "value": {
  6220. "foo": "bar"
  6221. },
  6222. "options": {
  6223. "hasLocalMutations": true,
  6224. "hasCommittedMutations": false
  6225. }
  6226. }
  6227. ],
  6228. "errorCode": 0,
  6229. "fromCache": true,
  6230. "hasPendingWrites": true
  6231. }
  6232. ]
  6233. },
  6234. {
  6235. "failWrite": {
  6236. "error": {
  6237. "code": 8
  6238. },
  6239. "keepInQueue": true
  6240. }
  6241. }
  6242. ]
  6243. },
  6244. "Writes that fail with code aborted are retried": {
  6245. "describeName": "Writes:",
  6246. "itName": "Writes that fail with code aborted are retried",
  6247. "tags": [],
  6248. "config": {
  6249. "useGarbageCollection": true,
  6250. "numClients": 1
  6251. },
  6252. "steps": [
  6253. {
  6254. "userListen": [
  6255. 2,
  6256. {
  6257. "path": "collection/key",
  6258. "filters": [],
  6259. "orderBys": []
  6260. }
  6261. ],
  6262. "expectedState": {
  6263. "activeTargets": {
  6264. "2": {
  6265. "queries": [
  6266. {
  6267. "path": "collection/key",
  6268. "filters": [],
  6269. "orderBys": []
  6270. }
  6271. ],
  6272. "resumeToken": ""
  6273. }
  6274. }
  6275. }
  6276. },
  6277. {
  6278. "userSet": [
  6279. "collection/key",
  6280. {
  6281. "foo": "bar"
  6282. }
  6283. ],
  6284. "expectedSnapshotEvents": [
  6285. {
  6286. "query": {
  6287. "path": "collection/key",
  6288. "filters": [],
  6289. "orderBys": []
  6290. },
  6291. "added": [
  6292. {
  6293. "key": "collection/key",
  6294. "version": 0,
  6295. "value": {
  6296. "foo": "bar"
  6297. },
  6298. "options": {
  6299. "hasLocalMutations": true,
  6300. "hasCommittedMutations": false
  6301. }
  6302. }
  6303. ],
  6304. "errorCode": 0,
  6305. "fromCache": true,
  6306. "hasPendingWrites": true
  6307. }
  6308. ]
  6309. },
  6310. {
  6311. "failWrite": {
  6312. "error": {
  6313. "code": 10
  6314. },
  6315. "keepInQueue": true
  6316. }
  6317. },
  6318. {
  6319. "writeAck": {
  6320. "version": 1000
  6321. },
  6322. "expectedState": {
  6323. "userCallbacks": {
  6324. "acknowledgedDocs": [
  6325. "collection/key"
  6326. ],
  6327. "rejectedDocs": []
  6328. }
  6329. }
  6330. },
  6331. {
  6332. "watchAck": [
  6333. 2
  6334. ]
  6335. },
  6336. {
  6337. "watchEntity": {
  6338. "docs": [
  6339. {
  6340. "key": "collection/key",
  6341. "version": 1000,
  6342. "value": {
  6343. "foo": "bar"
  6344. },
  6345. "options": {
  6346. "hasLocalMutations": false,
  6347. "hasCommittedMutations": false
  6348. }
  6349. }
  6350. ],
  6351. "targets": [
  6352. 2
  6353. ]
  6354. }
  6355. },
  6356. {
  6357. "watchCurrent": [
  6358. [
  6359. 2
  6360. ],
  6361. "resume-token-1000"
  6362. ]
  6363. },
  6364. {
  6365. "watchSnapshot": {
  6366. "version": 1000,
  6367. "targetIds": []
  6368. },
  6369. "expectedSnapshotEvents": [
  6370. {
  6371. "query": {
  6372. "path": "collection/key",
  6373. "filters": [],
  6374. "orderBys": []
  6375. },
  6376. "metadata": [
  6377. {
  6378. "key": "collection/key",
  6379. "version": 1000,
  6380. "value": {
  6381. "foo": "bar"
  6382. },
  6383. "options": {
  6384. "hasLocalMutations": false,
  6385. "hasCommittedMutations": false
  6386. }
  6387. }
  6388. ],
  6389. "errorCode": 0,
  6390. "fromCache": false,
  6391. "hasPendingWrites": false
  6392. }
  6393. ]
  6394. }
  6395. ]
  6396. },
  6397. "Writes that fail with code cancelled are retried": {
  6398. "describeName": "Writes:",
  6399. "itName": "Writes that fail with code cancelled are retried",
  6400. "tags": [],
  6401. "config": {
  6402. "useGarbageCollection": true,
  6403. "numClients": 1
  6404. },
  6405. "steps": [
  6406. {
  6407. "userListen": [
  6408. 2,
  6409. {
  6410. "path": "collection/key",
  6411. "filters": [],
  6412. "orderBys": []
  6413. }
  6414. ],
  6415. "expectedState": {
  6416. "activeTargets": {
  6417. "2": {
  6418. "queries": [
  6419. {
  6420. "path": "collection/key",
  6421. "filters": [],
  6422. "orderBys": []
  6423. }
  6424. ],
  6425. "resumeToken": ""
  6426. }
  6427. }
  6428. }
  6429. },
  6430. {
  6431. "userSet": [
  6432. "collection/key",
  6433. {
  6434. "foo": "bar"
  6435. }
  6436. ],
  6437. "expectedSnapshotEvents": [
  6438. {
  6439. "query": {
  6440. "path": "collection/key",
  6441. "filters": [],
  6442. "orderBys": []
  6443. },
  6444. "added": [
  6445. {
  6446. "key": "collection/key",
  6447. "version": 0,
  6448. "value": {
  6449. "foo": "bar"
  6450. },
  6451. "options": {
  6452. "hasLocalMutations": true,
  6453. "hasCommittedMutations": false
  6454. }
  6455. }
  6456. ],
  6457. "errorCode": 0,
  6458. "fromCache": true,
  6459. "hasPendingWrites": true
  6460. }
  6461. ]
  6462. },
  6463. {
  6464. "failWrite": {
  6465. "error": {
  6466. "code": 1
  6467. },
  6468. "keepInQueue": true
  6469. }
  6470. },
  6471. {
  6472. "writeAck": {
  6473. "version": 1000
  6474. },
  6475. "expectedState": {
  6476. "userCallbacks": {
  6477. "acknowledgedDocs": [
  6478. "collection/key"
  6479. ],
  6480. "rejectedDocs": []
  6481. }
  6482. }
  6483. },
  6484. {
  6485. "watchAck": [
  6486. 2
  6487. ]
  6488. },
  6489. {
  6490. "watchEntity": {
  6491. "docs": [
  6492. {
  6493. "key": "collection/key",
  6494. "version": 1000,
  6495. "value": {
  6496. "foo": "bar"
  6497. },
  6498. "options": {
  6499. "hasLocalMutations": false,
  6500. "hasCommittedMutations": false
  6501. }
  6502. }
  6503. ],
  6504. "targets": [
  6505. 2
  6506. ]
  6507. }
  6508. },
  6509. {
  6510. "watchCurrent": [
  6511. [
  6512. 2
  6513. ],
  6514. "resume-token-1000"
  6515. ]
  6516. },
  6517. {
  6518. "watchSnapshot": {
  6519. "version": 1000,
  6520. "targetIds": []
  6521. },
  6522. "expectedSnapshotEvents": [
  6523. {
  6524. "query": {
  6525. "path": "collection/key",
  6526. "filters": [],
  6527. "orderBys": []
  6528. },
  6529. "metadata": [
  6530. {
  6531. "key": "collection/key",
  6532. "version": 1000,
  6533. "value": {
  6534. "foo": "bar"
  6535. },
  6536. "options": {
  6537. "hasLocalMutations": false,
  6538. "hasCommittedMutations": false
  6539. }
  6540. }
  6541. ],
  6542. "errorCode": 0,
  6543. "fromCache": false,
  6544. "hasPendingWrites": false
  6545. }
  6546. ]
  6547. }
  6548. ]
  6549. },
  6550. "Writes that fail with code unknown are retried": {
  6551. "describeName": "Writes:",
  6552. "itName": "Writes that fail with code unknown are retried",
  6553. "tags": [],
  6554. "config": {
  6555. "useGarbageCollection": true,
  6556. "numClients": 1
  6557. },
  6558. "steps": [
  6559. {
  6560. "userListen": [
  6561. 2,
  6562. {
  6563. "path": "collection/key",
  6564. "filters": [],
  6565. "orderBys": []
  6566. }
  6567. ],
  6568. "expectedState": {
  6569. "activeTargets": {
  6570. "2": {
  6571. "queries": [
  6572. {
  6573. "path": "collection/key",
  6574. "filters": [],
  6575. "orderBys": []
  6576. }
  6577. ],
  6578. "resumeToken": ""
  6579. }
  6580. }
  6581. }
  6582. },
  6583. {
  6584. "userSet": [
  6585. "collection/key",
  6586. {
  6587. "foo": "bar"
  6588. }
  6589. ],
  6590. "expectedSnapshotEvents": [
  6591. {
  6592. "query": {
  6593. "path": "collection/key",
  6594. "filters": [],
  6595. "orderBys": []
  6596. },
  6597. "added": [
  6598. {
  6599. "key": "collection/key",
  6600. "version": 0,
  6601. "value": {
  6602. "foo": "bar"
  6603. },
  6604. "options": {
  6605. "hasLocalMutations": true,
  6606. "hasCommittedMutations": false
  6607. }
  6608. }
  6609. ],
  6610. "errorCode": 0,
  6611. "fromCache": true,
  6612. "hasPendingWrites": true
  6613. }
  6614. ]
  6615. },
  6616. {
  6617. "failWrite": {
  6618. "error": {
  6619. "code": 2
  6620. },
  6621. "keepInQueue": true
  6622. }
  6623. },
  6624. {
  6625. "writeAck": {
  6626. "version": 1000
  6627. },
  6628. "expectedState": {
  6629. "userCallbacks": {
  6630. "acknowledgedDocs": [
  6631. "collection/key"
  6632. ],
  6633. "rejectedDocs": []
  6634. }
  6635. }
  6636. },
  6637. {
  6638. "watchAck": [
  6639. 2
  6640. ]
  6641. },
  6642. {
  6643. "watchEntity": {
  6644. "docs": [
  6645. {
  6646. "key": "collection/key",
  6647. "version": 1000,
  6648. "value": {
  6649. "foo": "bar"
  6650. },
  6651. "options": {
  6652. "hasLocalMutations": false,
  6653. "hasCommittedMutations": false
  6654. }
  6655. }
  6656. ],
  6657. "targets": [
  6658. 2
  6659. ]
  6660. }
  6661. },
  6662. {
  6663. "watchCurrent": [
  6664. [
  6665. 2
  6666. ],
  6667. "resume-token-1000"
  6668. ]
  6669. },
  6670. {
  6671. "watchSnapshot": {
  6672. "version": 1000,
  6673. "targetIds": []
  6674. },
  6675. "expectedSnapshotEvents": [
  6676. {
  6677. "query": {
  6678. "path": "collection/key",
  6679. "filters": [],
  6680. "orderBys": []
  6681. },
  6682. "metadata": [
  6683. {
  6684. "key": "collection/key",
  6685. "version": 1000,
  6686. "value": {
  6687. "foo": "bar"
  6688. },
  6689. "options": {
  6690. "hasLocalMutations": false,
  6691. "hasCommittedMutations": false
  6692. }
  6693. }
  6694. ],
  6695. "errorCode": 0,
  6696. "fromCache": false,
  6697. "hasPendingWrites": false
  6698. }
  6699. ]
  6700. }
  6701. ]
  6702. },
  6703. "Writes that fail with code deadline-exceeded are retried": {
  6704. "describeName": "Writes:",
  6705. "itName": "Writes that fail with code deadline-exceeded are retried",
  6706. "tags": [],
  6707. "config": {
  6708. "useGarbageCollection": true,
  6709. "numClients": 1
  6710. },
  6711. "steps": [
  6712. {
  6713. "userListen": [
  6714. 2,
  6715. {
  6716. "path": "collection/key",
  6717. "filters": [],
  6718. "orderBys": []
  6719. }
  6720. ],
  6721. "expectedState": {
  6722. "activeTargets": {
  6723. "2": {
  6724. "queries": [
  6725. {
  6726. "path": "collection/key",
  6727. "filters": [],
  6728. "orderBys": []
  6729. }
  6730. ],
  6731. "resumeToken": ""
  6732. }
  6733. }
  6734. }
  6735. },
  6736. {
  6737. "userSet": [
  6738. "collection/key",
  6739. {
  6740. "foo": "bar"
  6741. }
  6742. ],
  6743. "expectedSnapshotEvents": [
  6744. {
  6745. "query": {
  6746. "path": "collection/key",
  6747. "filters": [],
  6748. "orderBys": []
  6749. },
  6750. "added": [
  6751. {
  6752. "key": "collection/key",
  6753. "version": 0,
  6754. "value": {
  6755. "foo": "bar"
  6756. },
  6757. "options": {
  6758. "hasLocalMutations": true,
  6759. "hasCommittedMutations": false
  6760. }
  6761. }
  6762. ],
  6763. "errorCode": 0,
  6764. "fromCache": true,
  6765. "hasPendingWrites": true
  6766. }
  6767. ]
  6768. },
  6769. {
  6770. "failWrite": {
  6771. "error": {
  6772. "code": 4
  6773. },
  6774. "keepInQueue": true
  6775. }
  6776. },
  6777. {
  6778. "writeAck": {
  6779. "version": 1000
  6780. },
  6781. "expectedState": {
  6782. "userCallbacks": {
  6783. "acknowledgedDocs": [
  6784. "collection/key"
  6785. ],
  6786. "rejectedDocs": []
  6787. }
  6788. }
  6789. },
  6790. {
  6791. "watchAck": [
  6792. 2
  6793. ]
  6794. },
  6795. {
  6796. "watchEntity": {
  6797. "docs": [
  6798. {
  6799. "key": "collection/key",
  6800. "version": 1000,
  6801. "value": {
  6802. "foo": "bar"
  6803. },
  6804. "options": {
  6805. "hasLocalMutations": false,
  6806. "hasCommittedMutations": false
  6807. }
  6808. }
  6809. ],
  6810. "targets": [
  6811. 2
  6812. ]
  6813. }
  6814. },
  6815. {
  6816. "watchCurrent": [
  6817. [
  6818. 2
  6819. ],
  6820. "resume-token-1000"
  6821. ]
  6822. },
  6823. {
  6824. "watchSnapshot": {
  6825. "version": 1000,
  6826. "targetIds": []
  6827. },
  6828. "expectedSnapshotEvents": [
  6829. {
  6830. "query": {
  6831. "path": "collection/key",
  6832. "filters": [],
  6833. "orderBys": []
  6834. },
  6835. "metadata": [
  6836. {
  6837. "key": "collection/key",
  6838. "version": 1000,
  6839. "value": {
  6840. "foo": "bar"
  6841. },
  6842. "options": {
  6843. "hasLocalMutations": false,
  6844. "hasCommittedMutations": false
  6845. }
  6846. }
  6847. ],
  6848. "errorCode": 0,
  6849. "fromCache": false,
  6850. "hasPendingWrites": false
  6851. }
  6852. ]
  6853. }
  6854. ]
  6855. },
  6856. "Writes that fail with code internal are retried": {
  6857. "describeName": "Writes:",
  6858. "itName": "Writes that fail with code internal are retried",
  6859. "tags": [],
  6860. "config": {
  6861. "useGarbageCollection": true,
  6862. "numClients": 1
  6863. },
  6864. "steps": [
  6865. {
  6866. "userListen": [
  6867. 2,
  6868. {
  6869. "path": "collection/key",
  6870. "filters": [],
  6871. "orderBys": []
  6872. }
  6873. ],
  6874. "expectedState": {
  6875. "activeTargets": {
  6876. "2": {
  6877. "queries": [
  6878. {
  6879. "path": "collection/key",
  6880. "filters": [],
  6881. "orderBys": []
  6882. }
  6883. ],
  6884. "resumeToken": ""
  6885. }
  6886. }
  6887. }
  6888. },
  6889. {
  6890. "userSet": [
  6891. "collection/key",
  6892. {
  6893. "foo": "bar"
  6894. }
  6895. ],
  6896. "expectedSnapshotEvents": [
  6897. {
  6898. "query": {
  6899. "path": "collection/key",
  6900. "filters": [],
  6901. "orderBys": []
  6902. },
  6903. "added": [
  6904. {
  6905. "key": "collection/key",
  6906. "version": 0,
  6907. "value": {
  6908. "foo": "bar"
  6909. },
  6910. "options": {
  6911. "hasLocalMutations": true,
  6912. "hasCommittedMutations": false
  6913. }
  6914. }
  6915. ],
  6916. "errorCode": 0,
  6917. "fromCache": true,
  6918. "hasPendingWrites": true
  6919. }
  6920. ]
  6921. },
  6922. {
  6923. "failWrite": {
  6924. "error": {
  6925. "code": 13
  6926. },
  6927. "keepInQueue": true
  6928. }
  6929. },
  6930. {
  6931. "writeAck": {
  6932. "version": 1000
  6933. },
  6934. "expectedState": {
  6935. "userCallbacks": {
  6936. "acknowledgedDocs": [
  6937. "collection/key"
  6938. ],
  6939. "rejectedDocs": []
  6940. }
  6941. }
  6942. },
  6943. {
  6944. "watchAck": [
  6945. 2
  6946. ]
  6947. },
  6948. {
  6949. "watchEntity": {
  6950. "docs": [
  6951. {
  6952. "key": "collection/key",
  6953. "version": 1000,
  6954. "value": {
  6955. "foo": "bar"
  6956. },
  6957. "options": {
  6958. "hasLocalMutations": false,
  6959. "hasCommittedMutations": false
  6960. }
  6961. }
  6962. ],
  6963. "targets": [
  6964. 2
  6965. ]
  6966. }
  6967. },
  6968. {
  6969. "watchCurrent": [
  6970. [
  6971. 2
  6972. ],
  6973. "resume-token-1000"
  6974. ]
  6975. },
  6976. {
  6977. "watchSnapshot": {
  6978. "version": 1000,
  6979. "targetIds": []
  6980. },
  6981. "expectedSnapshotEvents": [
  6982. {
  6983. "query": {
  6984. "path": "collection/key",
  6985. "filters": [],
  6986. "orderBys": []
  6987. },
  6988. "metadata": [
  6989. {
  6990. "key": "collection/key",
  6991. "version": 1000,
  6992. "value": {
  6993. "foo": "bar"
  6994. },
  6995. "options": {
  6996. "hasLocalMutations": false,
  6997. "hasCommittedMutations": false
  6998. }
  6999. }
  7000. ],
  7001. "errorCode": 0,
  7002. "fromCache": false,
  7003. "hasPendingWrites": false
  7004. }
  7005. ]
  7006. }
  7007. ]
  7008. },
  7009. "Writes that fail with code unavailable are retried": {
  7010. "describeName": "Writes:",
  7011. "itName": "Writes that fail with code unavailable are retried",
  7012. "tags": [],
  7013. "config": {
  7014. "useGarbageCollection": true,
  7015. "numClients": 1
  7016. },
  7017. "steps": [
  7018. {
  7019. "userListen": [
  7020. 2,
  7021. {
  7022. "path": "collection/key",
  7023. "filters": [],
  7024. "orderBys": []
  7025. }
  7026. ],
  7027. "expectedState": {
  7028. "activeTargets": {
  7029. "2": {
  7030. "queries": [
  7031. {
  7032. "path": "collection/key",
  7033. "filters": [],
  7034. "orderBys": []
  7035. }
  7036. ],
  7037. "resumeToken": ""
  7038. }
  7039. }
  7040. }
  7041. },
  7042. {
  7043. "userSet": [
  7044. "collection/key",
  7045. {
  7046. "foo": "bar"
  7047. }
  7048. ],
  7049. "expectedSnapshotEvents": [
  7050. {
  7051. "query": {
  7052. "path": "collection/key",
  7053. "filters": [],
  7054. "orderBys": []
  7055. },
  7056. "added": [
  7057. {
  7058. "key": "collection/key",
  7059. "version": 0,
  7060. "value": {
  7061. "foo": "bar"
  7062. },
  7063. "options": {
  7064. "hasLocalMutations": true,
  7065. "hasCommittedMutations": false
  7066. }
  7067. }
  7068. ],
  7069. "errorCode": 0,
  7070. "fromCache": true,
  7071. "hasPendingWrites": true
  7072. }
  7073. ]
  7074. },
  7075. {
  7076. "failWrite": {
  7077. "error": {
  7078. "code": 14
  7079. },
  7080. "keepInQueue": true
  7081. }
  7082. },
  7083. {
  7084. "writeAck": {
  7085. "version": 1000
  7086. },
  7087. "expectedState": {
  7088. "userCallbacks": {
  7089. "acknowledgedDocs": [
  7090. "collection/key"
  7091. ],
  7092. "rejectedDocs": []
  7093. }
  7094. }
  7095. },
  7096. {
  7097. "watchAck": [
  7098. 2
  7099. ]
  7100. },
  7101. {
  7102. "watchEntity": {
  7103. "docs": [
  7104. {
  7105. "key": "collection/key",
  7106. "version": 1000,
  7107. "value": {
  7108. "foo": "bar"
  7109. },
  7110. "options": {
  7111. "hasLocalMutations": false,
  7112. "hasCommittedMutations": false
  7113. }
  7114. }
  7115. ],
  7116. "targets": [
  7117. 2
  7118. ]
  7119. }
  7120. },
  7121. {
  7122. "watchCurrent": [
  7123. [
  7124. 2
  7125. ],
  7126. "resume-token-1000"
  7127. ]
  7128. },
  7129. {
  7130. "watchSnapshot": {
  7131. "version": 1000,
  7132. "targetIds": []
  7133. },
  7134. "expectedSnapshotEvents": [
  7135. {
  7136. "query": {
  7137. "path": "collection/key",
  7138. "filters": [],
  7139. "orderBys": []
  7140. },
  7141. "metadata": [
  7142. {
  7143. "key": "collection/key",
  7144. "version": 1000,
  7145. "value": {
  7146. "foo": "bar"
  7147. },
  7148. "options": {
  7149. "hasLocalMutations": false,
  7150. "hasCommittedMutations": false
  7151. }
  7152. }
  7153. ],
  7154. "errorCode": 0,
  7155. "fromCache": false,
  7156. "hasPendingWrites": false
  7157. }
  7158. ]
  7159. }
  7160. ]
  7161. },
  7162. "Writes that fail with code unauthenticated are retried": {
  7163. "describeName": "Writes:",
  7164. "itName": "Writes that fail with code unauthenticated are retried",
  7165. "tags": [],
  7166. "config": {
  7167. "useGarbageCollection": true,
  7168. "numClients": 1
  7169. },
  7170. "steps": [
  7171. {
  7172. "userListen": [
  7173. 2,
  7174. {
  7175. "path": "collection/key",
  7176. "filters": [],
  7177. "orderBys": []
  7178. }
  7179. ],
  7180. "expectedState": {
  7181. "activeTargets": {
  7182. "2": {
  7183. "queries": [
  7184. {
  7185. "path": "collection/key",
  7186. "filters": [],
  7187. "orderBys": []
  7188. }
  7189. ],
  7190. "resumeToken": ""
  7191. }
  7192. }
  7193. }
  7194. },
  7195. {
  7196. "userSet": [
  7197. "collection/key",
  7198. {
  7199. "foo": "bar"
  7200. }
  7201. ],
  7202. "expectedSnapshotEvents": [
  7203. {
  7204. "query": {
  7205. "path": "collection/key",
  7206. "filters": [],
  7207. "orderBys": []
  7208. },
  7209. "added": [
  7210. {
  7211. "key": "collection/key",
  7212. "version": 0,
  7213. "value": {
  7214. "foo": "bar"
  7215. },
  7216. "options": {
  7217. "hasLocalMutations": true,
  7218. "hasCommittedMutations": false
  7219. }
  7220. }
  7221. ],
  7222. "errorCode": 0,
  7223. "fromCache": true,
  7224. "hasPendingWrites": true
  7225. }
  7226. ]
  7227. },
  7228. {
  7229. "failWrite": {
  7230. "error": {
  7231. "code": 16
  7232. },
  7233. "keepInQueue": true
  7234. }
  7235. },
  7236. {
  7237. "writeAck": {
  7238. "version": 1000
  7239. },
  7240. "expectedState": {
  7241. "userCallbacks": {
  7242. "acknowledgedDocs": [
  7243. "collection/key"
  7244. ],
  7245. "rejectedDocs": []
  7246. }
  7247. }
  7248. },
  7249. {
  7250. "watchAck": [
  7251. 2
  7252. ]
  7253. },
  7254. {
  7255. "watchEntity": {
  7256. "docs": [
  7257. {
  7258. "key": "collection/key",
  7259. "version": 1000,
  7260. "value": {
  7261. "foo": "bar"
  7262. },
  7263. "options": {
  7264. "hasLocalMutations": false,
  7265. "hasCommittedMutations": false
  7266. }
  7267. }
  7268. ],
  7269. "targets": [
  7270. 2
  7271. ]
  7272. }
  7273. },
  7274. {
  7275. "watchCurrent": [
  7276. [
  7277. 2
  7278. ],
  7279. "resume-token-1000"
  7280. ]
  7281. },
  7282. {
  7283. "watchSnapshot": {
  7284. "version": 1000,
  7285. "targetIds": []
  7286. },
  7287. "expectedSnapshotEvents": [
  7288. {
  7289. "query": {
  7290. "path": "collection/key",
  7291. "filters": [],
  7292. "orderBys": []
  7293. },
  7294. "metadata": [
  7295. {
  7296. "key": "collection/key",
  7297. "version": 1000,
  7298. "value": {
  7299. "foo": "bar"
  7300. },
  7301. "options": {
  7302. "hasLocalMutations": false,
  7303. "hasCommittedMutations": false
  7304. }
  7305. }
  7306. ],
  7307. "errorCode": 0,
  7308. "fromCache": false,
  7309. "hasPendingWrites": false
  7310. }
  7311. ]
  7312. }
  7313. ]
  7314. },
  7315. "Ensure correct events after patching a doc (including a delete) and getting watcher events.": {
  7316. "describeName": "Writes:",
  7317. "itName": "Ensure correct events after patching a doc (including a delete) and getting watcher events.",
  7318. "tags": [],
  7319. "config": {
  7320. "useGarbageCollection": true,
  7321. "numClients": 1
  7322. },
  7323. "steps": [
  7324. {
  7325. "userListen": [
  7326. 2,
  7327. {
  7328. "path": "collection/doc",
  7329. "filters": [],
  7330. "orderBys": []
  7331. }
  7332. ],
  7333. "expectedState": {
  7334. "activeTargets": {
  7335. "2": {
  7336. "queries": [
  7337. {
  7338. "path": "collection/doc",
  7339. "filters": [],
  7340. "orderBys": []
  7341. }
  7342. ],
  7343. "resumeToken": ""
  7344. }
  7345. }
  7346. }
  7347. },
  7348. {
  7349. "watchAck": [
  7350. 2
  7351. ]
  7352. },
  7353. {
  7354. "watchEntity": {
  7355. "docs": [
  7356. {
  7357. "key": "collection/doc",
  7358. "version": 1000,
  7359. "value": {
  7360. "a": {
  7361. "b": 2
  7362. },
  7363. "v": 1
  7364. },
  7365. "options": {
  7366. "hasLocalMutations": false,
  7367. "hasCommittedMutations": false
  7368. }
  7369. }
  7370. ],
  7371. "targets": [
  7372. 2
  7373. ]
  7374. }
  7375. },
  7376. {
  7377. "watchCurrent": [
  7378. [
  7379. 2
  7380. ],
  7381. "resume-token-500"
  7382. ]
  7383. },
  7384. {
  7385. "watchSnapshot": {
  7386. "version": 500,
  7387. "targetIds": []
  7388. },
  7389. "expectedSnapshotEvents": [
  7390. {
  7391. "query": {
  7392. "path": "collection/doc",
  7393. "filters": [],
  7394. "orderBys": []
  7395. },
  7396. "added": [
  7397. {
  7398. "key": "collection/doc",
  7399. "version": 1000,
  7400. "value": {
  7401. "a": {
  7402. "b": 2
  7403. },
  7404. "v": 1
  7405. },
  7406. "options": {
  7407. "hasLocalMutations": false,
  7408. "hasCommittedMutations": false
  7409. }
  7410. }
  7411. ],
  7412. "errorCode": 0,
  7413. "fromCache": false,
  7414. "hasPendingWrites": false
  7415. }
  7416. ]
  7417. },
  7418. {
  7419. "userPatch": [
  7420. "collection/doc",
  7421. {
  7422. "v": 2,
  7423. "a.c": "<DELETE>"
  7424. }
  7425. ],
  7426. "expectedSnapshotEvents": [
  7427. {
  7428. "query": {
  7429. "path": "collection/doc",
  7430. "filters": [],
  7431. "orderBys": []
  7432. },
  7433. "modified": [
  7434. {
  7435. "key": "collection/doc",
  7436. "version": 1000,
  7437. "value": {
  7438. "a": {
  7439. "b": 2
  7440. },
  7441. "v": 2
  7442. },
  7443. "options": {
  7444. "hasLocalMutations": true,
  7445. "hasCommittedMutations": false
  7446. }
  7447. }
  7448. ],
  7449. "errorCode": 0,
  7450. "fromCache": false,
  7451. "hasPendingWrites": true
  7452. }
  7453. ]
  7454. },
  7455. {
  7456. "watchEntity": {
  7457. "docs": [
  7458. {
  7459. "key": "collection/doc",
  7460. "version": 2000,
  7461. "value": {
  7462. "a": {
  7463. "b": 2
  7464. },
  7465. "v": 2
  7466. },
  7467. "options": {
  7468. "hasLocalMutations": false,
  7469. "hasCommittedMutations": false
  7470. }
  7471. }
  7472. ],
  7473. "targets": [
  7474. 2
  7475. ]
  7476. }
  7477. },
  7478. {
  7479. "watchSnapshot": {
  7480. "version": 2000,
  7481. "targetIds": []
  7482. }
  7483. },
  7484. {
  7485. "writeAck": {
  7486. "version": 2000
  7487. },
  7488. "expectedState": {
  7489. "userCallbacks": {
  7490. "acknowledgedDocs": [
  7491. "collection/doc"
  7492. ],
  7493. "rejectedDocs": []
  7494. }
  7495. },
  7496. "expectedSnapshotEvents": [
  7497. {
  7498. "query": {
  7499. "path": "collection/doc",
  7500. "filters": [],
  7501. "orderBys": []
  7502. },
  7503. "metadata": [
  7504. {
  7505. "key": "collection/doc",
  7506. "version": 2000,
  7507. "value": {
  7508. "a": {
  7509. "b": 2
  7510. },
  7511. "v": 2
  7512. },
  7513. "options": {
  7514. "hasLocalMutations": false,
  7515. "hasCommittedMutations": false
  7516. }
  7517. }
  7518. ],
  7519. "errorCode": 0,
  7520. "fromCache": false,
  7521. "hasPendingWrites": false
  7522. }
  7523. ]
  7524. }
  7525. ]
  7526. },
  7527. "Writes are resent after network disconnect": {
  7528. "describeName": "Writes:",
  7529. "itName": "Writes are resent after network disconnect",
  7530. "tags": [],
  7531. "config": {
  7532. "useGarbageCollection": true,
  7533. "numClients": 1
  7534. },
  7535. "steps": [
  7536. {
  7537. "userSet": [
  7538. "collection/key",
  7539. {
  7540. "foo": "bar"
  7541. }
  7542. ],
  7543. "expectedState": {
  7544. "numOutstandingWrites": 1
  7545. }
  7546. },
  7547. {
  7548. "enableNetwork": false,
  7549. "expectedState": {
  7550. "activeTargets": {},
  7551. "limboDocs": [],
  7552. "writeStreamRequestCount": 3
  7553. }
  7554. },
  7555. {
  7556. "enableNetwork": true,
  7557. "expectedState": {
  7558. "writeStreamRequestCount": 5,
  7559. "numOutstandingWrites": 1
  7560. }
  7561. },
  7562. {
  7563. "writeAck": {
  7564. "version": 1
  7565. },
  7566. "expectedState": {
  7567. "userCallbacks": {
  7568. "acknowledgedDocs": [
  7569. "collection/key"
  7570. ],
  7571. "rejectedDocs": []
  7572. },
  7573. "numOutstandingWrites": 0
  7574. }
  7575. }
  7576. ]
  7577. },
  7578. "New writes are sent after write failure": {
  7579. "describeName": "Writes:",
  7580. "itName": "New writes are sent after write failure",
  7581. "tags": [],
  7582. "config": {
  7583. "useGarbageCollection": true,
  7584. "numClients": 1
  7585. },
  7586. "steps": [
  7587. {
  7588. "userSet": [
  7589. "collection/a",
  7590. {
  7591. "v": 1
  7592. }
  7593. ]
  7594. },
  7595. {
  7596. "failWrite": {
  7597. "error": {
  7598. "code": 9
  7599. }
  7600. },
  7601. "expectedState": {
  7602. "userCallbacks": {
  7603. "acknowledgedDocs": [],
  7604. "rejectedDocs": [
  7605. "collection/a"
  7606. ]
  7607. }
  7608. }
  7609. },
  7610. {
  7611. "userSet": [
  7612. "collection/b",
  7613. {
  7614. "v": 1
  7615. }
  7616. ]
  7617. },
  7618. {
  7619. "writeAck": {
  7620. "version": 2000
  7621. },
  7622. "expectedState": {
  7623. "userCallbacks": {
  7624. "acknowledgedDocs": [
  7625. "collection/b"
  7626. ],
  7627. "rejectedDocs": []
  7628. }
  7629. }
  7630. }
  7631. ]
  7632. },
  7633. "Primary client acknowledges write": {
  7634. "describeName": "Writes:",
  7635. "itName": "Primary client acknowledges write",
  7636. "tags": [
  7637. "multi-client"
  7638. ],
  7639. "config": {
  7640. "useGarbageCollection": false,
  7641. "numClients": 2
  7642. },
  7643. "steps": [
  7644. {
  7645. "drainQueue": true,
  7646. "clientIndex": 0
  7647. },
  7648. {
  7649. "applyClientState": {
  7650. "visibility": "visible"
  7651. },
  7652. "clientIndex": 0
  7653. },
  7654. {
  7655. "drainQueue": true,
  7656. "clientIndex": 1
  7657. },
  7658. {
  7659. "userSet": [
  7660. "collection/a",
  7661. {
  7662. "v": 1
  7663. }
  7664. ],
  7665. "clientIndex": 1
  7666. },
  7667. {
  7668. "drainQueue": true,
  7669. "clientIndex": 0
  7670. },
  7671. {
  7672. "writeAck": {
  7673. "version": 1000
  7674. },
  7675. "clientIndex": 0
  7676. },
  7677. {
  7678. "drainQueue": true,
  7679. "expectedState": {
  7680. "userCallbacks": {
  7681. "acknowledgedDocs": [
  7682. "collection/a"
  7683. ],
  7684. "rejectedDocs": []
  7685. }
  7686. },
  7687. "clientIndex": 1
  7688. }
  7689. ]
  7690. },
  7691. "Primary client rejects write": {
  7692. "describeName": "Writes:",
  7693. "itName": "Primary client rejects write",
  7694. "tags": [
  7695. "multi-client"
  7696. ],
  7697. "config": {
  7698. "useGarbageCollection": false,
  7699. "numClients": 2
  7700. },
  7701. "steps": [
  7702. {
  7703. "drainQueue": true,
  7704. "clientIndex": 0
  7705. },
  7706. {
  7707. "applyClientState": {
  7708. "visibility": "visible"
  7709. },
  7710. "clientIndex": 0
  7711. },
  7712. {
  7713. "drainQueue": true,
  7714. "clientIndex": 1
  7715. },
  7716. {
  7717. "userSet": [
  7718. "collection/a",
  7719. {
  7720. "v": 1
  7721. }
  7722. ],
  7723. "clientIndex": 1
  7724. },
  7725. {
  7726. "drainQueue": true,
  7727. "clientIndex": 0
  7728. },
  7729. {
  7730. "failWrite": {
  7731. "error": {
  7732. "code": 9
  7733. }
  7734. },
  7735. "clientIndex": 0
  7736. },
  7737. {
  7738. "drainQueue": true,
  7739. "expectedState": {
  7740. "userCallbacks": {
  7741. "acknowledgedDocs": [],
  7742. "rejectedDocs": [
  7743. "collection/a"
  7744. ]
  7745. }
  7746. },
  7747. "clientIndex": 1
  7748. }
  7749. ]
  7750. },
  7751. "Pending writes are shared between clients": {
  7752. "describeName": "Writes:",
  7753. "itName": "Pending writes are shared between clients",
  7754. "tags": [
  7755. "multi-client"
  7756. ],
  7757. "config": {
  7758. "useGarbageCollection": false,
  7759. "numClients": 2
  7760. },
  7761. "steps": [
  7762. {
  7763. "drainQueue": true,
  7764. "clientIndex": 0
  7765. },
  7766. {
  7767. "userListen": [
  7768. 2,
  7769. {
  7770. "path": "collection",
  7771. "filters": [],
  7772. "orderBys": []
  7773. }
  7774. ],
  7775. "expectedState": {
  7776. "activeTargets": {
  7777. "2": {
  7778. "queries": [
  7779. {
  7780. "path": "collection",
  7781. "filters": [],
  7782. "orderBys": []
  7783. }
  7784. ],
  7785. "resumeToken": ""
  7786. }
  7787. }
  7788. },
  7789. "clientIndex": 0
  7790. },
  7791. {
  7792. "watchAck": [
  7793. 2
  7794. ],
  7795. "clientIndex": 0
  7796. },
  7797. {
  7798. "watchEntity": {
  7799. "docs": [],
  7800. "targets": [
  7801. 2
  7802. ]
  7803. },
  7804. "clientIndex": 0
  7805. },
  7806. {
  7807. "watchCurrent": [
  7808. [
  7809. 2
  7810. ],
  7811. "resume-token-500"
  7812. ],
  7813. "clientIndex": 0
  7814. },
  7815. {
  7816. "watchSnapshot": {
  7817. "version": 500,
  7818. "targetIds": []
  7819. },
  7820. "expectedSnapshotEvents": [
  7821. {
  7822. "query": {
  7823. "path": "collection",
  7824. "filters": [],
  7825. "orderBys": []
  7826. },
  7827. "errorCode": 0,
  7828. "fromCache": false,
  7829. "hasPendingWrites": false
  7830. }
  7831. ],
  7832. "clientIndex": 0
  7833. },
  7834. {
  7835. "userSet": [
  7836. "collection/a",
  7837. {
  7838. "v": 1
  7839. }
  7840. ],
  7841. "expectedSnapshotEvents": [
  7842. {
  7843. "query": {
  7844. "path": "collection",
  7845. "filters": [],
  7846. "orderBys": []
  7847. },
  7848. "added": [
  7849. {
  7850. "key": "collection/a",
  7851. "version": 0,
  7852. "value": {
  7853. "v": 1
  7854. },
  7855. "options": {
  7856. "hasLocalMutations": true,
  7857. "hasCommittedMutations": false
  7858. }
  7859. }
  7860. ],
  7861. "errorCode": 0,
  7862. "fromCache": false,
  7863. "hasPendingWrites": true
  7864. }
  7865. ],
  7866. "clientIndex": 0
  7867. },
  7868. {
  7869. "drainQueue": true,
  7870. "clientIndex": 1
  7871. },
  7872. {
  7873. "userListen": [
  7874. 2,
  7875. {
  7876. "path": "collection",
  7877. "filters": [],
  7878. "orderBys": []
  7879. }
  7880. ],
  7881. "expectedState": {
  7882. "activeTargets": {
  7883. "2": {
  7884. "queries": [
  7885. {
  7886. "path": "collection",
  7887. "filters": [],
  7888. "orderBys": []
  7889. }
  7890. ],
  7891. "resumeToken": ""
  7892. }
  7893. }
  7894. },
  7895. "expectedSnapshotEvents": [
  7896. {
  7897. "query": {
  7898. "path": "collection",
  7899. "filters": [],
  7900. "orderBys": []
  7901. },
  7902. "added": [
  7903. {
  7904. "key": "collection/a",
  7905. "version": 0,
  7906. "value": {
  7907. "v": 1
  7908. },
  7909. "options": {
  7910. "hasLocalMutations": true,
  7911. "hasCommittedMutations": false
  7912. }
  7913. }
  7914. ],
  7915. "errorCode": 0,
  7916. "fromCache": false,
  7917. "hasPendingWrites": true
  7918. }
  7919. ],
  7920. "clientIndex": 1
  7921. },
  7922. {
  7923. "drainQueue": true,
  7924. "clientIndex": 0
  7925. },
  7926. {
  7927. "userSet": [
  7928. "collection/a",
  7929. {
  7930. "v": 2
  7931. }
  7932. ],
  7933. "expectedSnapshotEvents": [
  7934. {
  7935. "query": {
  7936. "path": "collection",
  7937. "filters": [],
  7938. "orderBys": []
  7939. },
  7940. "modified": [
  7941. {
  7942. "key": "collection/a",
  7943. "version": 0,
  7944. "value": {
  7945. "v": 2
  7946. },
  7947. "options": {
  7948. "hasLocalMutations": true,
  7949. "hasCommittedMutations": false
  7950. }
  7951. }
  7952. ],
  7953. "errorCode": 0,
  7954. "fromCache": false,
  7955. "hasPendingWrites": true
  7956. }
  7957. ],
  7958. "clientIndex": 0
  7959. },
  7960. {
  7961. "drainQueue": true,
  7962. "expectedSnapshotEvents": [
  7963. {
  7964. "query": {
  7965. "path": "collection",
  7966. "filters": [],
  7967. "orderBys": []
  7968. },
  7969. "modified": [
  7970. {
  7971. "key": "collection/a",
  7972. "version": 0,
  7973. "value": {
  7974. "v": 2
  7975. },
  7976. "options": {
  7977. "hasLocalMutations": true,
  7978. "hasCommittedMutations": false
  7979. }
  7980. }
  7981. ],
  7982. "errorCode": 0,
  7983. "fromCache": false,
  7984. "hasPendingWrites": true
  7985. }
  7986. ],
  7987. "clientIndex": 1
  7988. },
  7989. {
  7990. "userSet": [
  7991. "collection/a",
  7992. {
  7993. "v": 3
  7994. }
  7995. ],
  7996. "expectedSnapshotEvents": [
  7997. {
  7998. "query": {
  7999. "path": "collection",
  8000. "filters": [],
  8001. "orderBys": []
  8002. },
  8003. "modified": [
  8004. {
  8005. "key": "collection/a",
  8006. "version": 0,
  8007. "value": {
  8008. "v": 3
  8009. },
  8010. "options": {
  8011. "hasLocalMutations": true,
  8012. "hasCommittedMutations": false
  8013. }
  8014. }
  8015. ],
  8016. "errorCode": 0,
  8017. "fromCache": false,
  8018. "hasPendingWrites": true
  8019. }
  8020. ],
  8021. "clientIndex": 1
  8022. },
  8023. {
  8024. "drainQueue": true,
  8025. "expectedSnapshotEvents": [
  8026. {
  8027. "query": {
  8028. "path": "collection",
  8029. "filters": [],
  8030. "orderBys": []
  8031. },
  8032. "modified": [
  8033. {
  8034. "key": "collection/a",
  8035. "version": 0,
  8036. "value": {
  8037. "v": 3
  8038. },
  8039. "options": {
  8040. "hasLocalMutations": true,
  8041. "hasCommittedMutations": false
  8042. }
  8043. }
  8044. ],
  8045. "errorCode": 0,
  8046. "fromCache": false,
  8047. "hasPendingWrites": true
  8048. }
  8049. ],
  8050. "clientIndex": 0
  8051. }
  8052. ]
  8053. },
  8054. "Pending write is acknowledged by primary client": {
  8055. "describeName": "Writes:",
  8056. "itName": "Pending write is acknowledged by primary client",
  8057. "tags": [
  8058. "multi-client"
  8059. ],
  8060. "config": {
  8061. "useGarbageCollection": false,
  8062. "numClients": 2
  8063. },
  8064. "steps": [
  8065. {
  8066. "drainQueue": true,
  8067. "clientIndex": 0
  8068. },
  8069. {
  8070. "applyClientState": {
  8071. "visibility": "visible"
  8072. },
  8073. "clientIndex": 0
  8074. },
  8075. {
  8076. "userListen": [
  8077. 2,
  8078. {
  8079. "path": "collection",
  8080. "filters": [],
  8081. "orderBys": []
  8082. }
  8083. ],
  8084. "expectedState": {
  8085. "activeTargets": {
  8086. "2": {
  8087. "queries": [
  8088. {
  8089. "path": "collection",
  8090. "filters": [],
  8091. "orderBys": []
  8092. }
  8093. ],
  8094. "resumeToken": ""
  8095. }
  8096. }
  8097. },
  8098. "clientIndex": 0
  8099. },
  8100. {
  8101. "watchAck": [
  8102. 2
  8103. ],
  8104. "clientIndex": 0
  8105. },
  8106. {
  8107. "watchEntity": {
  8108. "docs": [],
  8109. "targets": [
  8110. 2
  8111. ]
  8112. },
  8113. "clientIndex": 0
  8114. },
  8115. {
  8116. "watchCurrent": [
  8117. [
  8118. 2
  8119. ],
  8120. "resume-token-500"
  8121. ],
  8122. "clientIndex": 0
  8123. },
  8124. {
  8125. "watchSnapshot": {
  8126. "version": 500,
  8127. "targetIds": []
  8128. },
  8129. "expectedSnapshotEvents": [
  8130. {
  8131. "query": {
  8132. "path": "collection",
  8133. "filters": [],
  8134. "orderBys": []
  8135. },
  8136. "errorCode": 0,
  8137. "fromCache": false,
  8138. "hasPendingWrites": false
  8139. }
  8140. ],
  8141. "clientIndex": 0
  8142. },
  8143. {
  8144. "drainQueue": true,
  8145. "clientIndex": 1
  8146. },
  8147. {
  8148. "userListen": [
  8149. 2,
  8150. {
  8151. "path": "collection",
  8152. "filters": [],
  8153. "orderBys": []
  8154. }
  8155. ],
  8156. "expectedState": {
  8157. "activeTargets": {
  8158. "2": {
  8159. "queries": [
  8160. {
  8161. "path": "collection",
  8162. "filters": [],
  8163. "orderBys": []
  8164. }
  8165. ],
  8166. "resumeToken": ""
  8167. }
  8168. }
  8169. },
  8170. "expectedSnapshotEvents": [
  8171. {
  8172. "query": {
  8173. "path": "collection",
  8174. "filters": [],
  8175. "orderBys": []
  8176. },
  8177. "errorCode": 0,
  8178. "fromCache": false,
  8179. "hasPendingWrites": false
  8180. }
  8181. ],
  8182. "clientIndex": 1
  8183. },
  8184. {
  8185. "userSet": [
  8186. "collection/a",
  8187. {
  8188. "v": 1
  8189. }
  8190. ],
  8191. "expectedSnapshotEvents": [
  8192. {
  8193. "query": {
  8194. "path": "collection",
  8195. "filters": [],
  8196. "orderBys": []
  8197. },
  8198. "added": [
  8199. {
  8200. "key": "collection/a",
  8201. "version": 0,
  8202. "value": {
  8203. "v": 1
  8204. },
  8205. "options": {
  8206. "hasLocalMutations": true,
  8207. "hasCommittedMutations": false
  8208. }
  8209. }
  8210. ],
  8211. "errorCode": 0,
  8212. "fromCache": false,
  8213. "hasPendingWrites": true
  8214. }
  8215. ],
  8216. "clientIndex": 1
  8217. },
  8218. {
  8219. "drainQueue": true,
  8220. "expectedSnapshotEvents": [
  8221. {
  8222. "query": {
  8223. "path": "collection",
  8224. "filters": [],
  8225. "orderBys": []
  8226. },
  8227. "added": [
  8228. {
  8229. "key": "collection/a",
  8230. "version": 0,
  8231. "value": {
  8232. "v": 1
  8233. },
  8234. "options": {
  8235. "hasLocalMutations": true,
  8236. "hasCommittedMutations": false
  8237. }
  8238. }
  8239. ],
  8240. "errorCode": 0,
  8241. "fromCache": false,
  8242. "hasPendingWrites": true
  8243. }
  8244. ],
  8245. "clientIndex": 0
  8246. },
  8247. {
  8248. "writeAck": {
  8249. "version": 1000
  8250. },
  8251. "clientIndex": 0
  8252. },
  8253. {
  8254. "watchEntity": {
  8255. "docs": [
  8256. {
  8257. "key": "collection/a",
  8258. "version": 1000,
  8259. "value": {
  8260. "v": 1
  8261. },
  8262. "options": {
  8263. "hasLocalMutations": false,
  8264. "hasCommittedMutations": false
  8265. }
  8266. }
  8267. ],
  8268. "targets": [
  8269. 2
  8270. ]
  8271. },
  8272. "clientIndex": 0
  8273. },
  8274. {
  8275. "watchSnapshot": {
  8276. "version": 1000,
  8277. "targetIds": []
  8278. },
  8279. "expectedSnapshotEvents": [
  8280. {
  8281. "query": {
  8282. "path": "collection",
  8283. "filters": [],
  8284. "orderBys": []
  8285. },
  8286. "metadata": [
  8287. {
  8288. "key": "collection/a",
  8289. "version": 1000,
  8290. "value": {
  8291. "v": 1
  8292. },
  8293. "options": {
  8294. "hasLocalMutations": false,
  8295. "hasCommittedMutations": false
  8296. }
  8297. }
  8298. ],
  8299. "errorCode": 0,
  8300. "fromCache": false,
  8301. "hasPendingWrites": false
  8302. }
  8303. ],
  8304. "clientIndex": 0
  8305. },
  8306. {
  8307. "drainQueue": true,
  8308. "expectedState": {
  8309. "userCallbacks": {
  8310. "acknowledgedDocs": [
  8311. "collection/a"
  8312. ],
  8313. "rejectedDocs": []
  8314. }
  8315. },
  8316. "expectedSnapshotEvents": [
  8317. {
  8318. "query": {
  8319. "path": "collection",
  8320. "filters": [],
  8321. "orderBys": []
  8322. },
  8323. "metadata": [
  8324. {
  8325. "key": "collection/a",
  8326. "version": 1000,
  8327. "value": {
  8328. "v": 1
  8329. },
  8330. "options": {
  8331. "hasLocalMutations": false,
  8332. "hasCommittedMutations": false
  8333. }
  8334. }
  8335. ],
  8336. "errorCode": 0,
  8337. "fromCache": false,
  8338. "hasPendingWrites": false
  8339. }
  8340. ],
  8341. "clientIndex": 1
  8342. }
  8343. ]
  8344. },
  8345. "Pending write is rejected by primary client": {
  8346. "describeName": "Writes:",
  8347. "itName": "Pending write is rejected by primary client",
  8348. "tags": [
  8349. "multi-client"
  8350. ],
  8351. "config": {
  8352. "useGarbageCollection": false,
  8353. "numClients": 2
  8354. },
  8355. "steps": [
  8356. {
  8357. "drainQueue": true,
  8358. "clientIndex": 0
  8359. },
  8360. {
  8361. "userListen": [
  8362. 2,
  8363. {
  8364. "path": "collection",
  8365. "filters": [],
  8366. "orderBys": []
  8367. }
  8368. ],
  8369. "expectedState": {
  8370. "activeTargets": {
  8371. "2": {
  8372. "queries": [
  8373. {
  8374. "path": "collection",
  8375. "filters": [],
  8376. "orderBys": []
  8377. }
  8378. ],
  8379. "resumeToken": ""
  8380. }
  8381. }
  8382. },
  8383. "clientIndex": 0
  8384. },
  8385. {
  8386. "watchAck": [
  8387. 2
  8388. ],
  8389. "clientIndex": 0
  8390. },
  8391. {
  8392. "watchEntity": {
  8393. "docs": [],
  8394. "targets": [
  8395. 2
  8396. ]
  8397. },
  8398. "clientIndex": 0
  8399. },
  8400. {
  8401. "watchCurrent": [
  8402. [
  8403. 2
  8404. ],
  8405. "resume-token-500"
  8406. ],
  8407. "clientIndex": 0
  8408. },
  8409. {
  8410. "watchSnapshot": {
  8411. "version": 500,
  8412. "targetIds": []
  8413. },
  8414. "expectedSnapshotEvents": [
  8415. {
  8416. "query": {
  8417. "path": "collection",
  8418. "filters": [],
  8419. "orderBys": []
  8420. },
  8421. "errorCode": 0,
  8422. "fromCache": false,
  8423. "hasPendingWrites": false
  8424. }
  8425. ],
  8426. "clientIndex": 0
  8427. },
  8428. {
  8429. "drainQueue": true,
  8430. "clientIndex": 1
  8431. },
  8432. {
  8433. "userListen": [
  8434. 2,
  8435. {
  8436. "path": "collection",
  8437. "filters": [],
  8438. "orderBys": []
  8439. }
  8440. ],
  8441. "expectedState": {
  8442. "activeTargets": {
  8443. "2": {
  8444. "queries": [
  8445. {
  8446. "path": "collection",
  8447. "filters": [],
  8448. "orderBys": []
  8449. }
  8450. ],
  8451. "resumeToken": ""
  8452. }
  8453. }
  8454. },
  8455. "expectedSnapshotEvents": [
  8456. {
  8457. "query": {
  8458. "path": "collection",
  8459. "filters": [],
  8460. "orderBys": []
  8461. },
  8462. "errorCode": 0,
  8463. "fromCache": false,
  8464. "hasPendingWrites": false
  8465. }
  8466. ],
  8467. "clientIndex": 1
  8468. },
  8469. {
  8470. "userSet": [
  8471. "collection/a",
  8472. {
  8473. "v": 1
  8474. }
  8475. ],
  8476. "expectedSnapshotEvents": [
  8477. {
  8478. "query": {
  8479. "path": "collection",
  8480. "filters": [],
  8481. "orderBys": []
  8482. },
  8483. "added": [
  8484. {
  8485. "key": "collection/a",
  8486. "version": 0,
  8487. "value": {
  8488. "v": 1
  8489. },
  8490. "options": {
  8491. "hasLocalMutations": true,
  8492. "hasCommittedMutations": false
  8493. }
  8494. }
  8495. ],
  8496. "errorCode": 0,
  8497. "fromCache": false,
  8498. "hasPendingWrites": true
  8499. }
  8500. ],
  8501. "clientIndex": 1
  8502. },
  8503. {
  8504. "drainQueue": true,
  8505. "expectedSnapshotEvents": [
  8506. {
  8507. "query": {
  8508. "path": "collection",
  8509. "filters": [],
  8510. "orderBys": []
  8511. },
  8512. "added": [
  8513. {
  8514. "key": "collection/a",
  8515. "version": 0,
  8516. "value": {
  8517. "v": 1
  8518. },
  8519. "options": {
  8520. "hasLocalMutations": true,
  8521. "hasCommittedMutations": false
  8522. }
  8523. }
  8524. ],
  8525. "errorCode": 0,
  8526. "fromCache": false,
  8527. "hasPendingWrites": true
  8528. }
  8529. ],
  8530. "clientIndex": 0
  8531. },
  8532. {
  8533. "failWrite": {
  8534. "error": {
  8535. "code": 9
  8536. }
  8537. },
  8538. "expectedSnapshotEvents": [
  8539. {
  8540. "query": {
  8541. "path": "collection",
  8542. "filters": [],
  8543. "orderBys": []
  8544. },
  8545. "removed": [
  8546. {
  8547. "key": "collection/a",
  8548. "version": 0,
  8549. "value": {
  8550. "v": 1
  8551. },
  8552. "options": {
  8553. "hasLocalMutations": true,
  8554. "hasCommittedMutations": false
  8555. }
  8556. }
  8557. ],
  8558. "errorCode": 0,
  8559. "fromCache": false,
  8560. "hasPendingWrites": false
  8561. }
  8562. ],
  8563. "clientIndex": 0
  8564. },
  8565. {
  8566. "drainQueue": true,
  8567. "expectedState": {
  8568. "userCallbacks": {
  8569. "acknowledgedDocs": [],
  8570. "rejectedDocs": [
  8571. "collection/a"
  8572. ]
  8573. }
  8574. },
  8575. "expectedSnapshotEvents": [
  8576. {
  8577. "query": {
  8578. "path": "collection",
  8579. "filters": [],
  8580. "orderBys": []
  8581. },
  8582. "removed": [
  8583. {
  8584. "key": "collection/a",
  8585. "version": 0,
  8586. "value": {
  8587. "v": 1
  8588. },
  8589. "options": {
  8590. "hasLocalMutations": true,
  8591. "hasCommittedMutations": false
  8592. }
  8593. }
  8594. ],
  8595. "errorCode": 0,
  8596. "fromCache": false,
  8597. "hasPendingWrites": false
  8598. }
  8599. ],
  8600. "clientIndex": 1
  8601. }
  8602. ]
  8603. },
  8604. "Writes are released by primary client": {
  8605. "describeName": "Writes:",
  8606. "itName": "Writes are released by primary client",
  8607. "tags": [
  8608. "multi-client"
  8609. ],
  8610. "config": {
  8611. "useGarbageCollection": false,
  8612. "numClients": 2
  8613. },
  8614. "steps": [
  8615. {
  8616. "drainQueue": true,
  8617. "clientIndex": 0
  8618. },
  8619. {
  8620. "userListen": [
  8621. 2,
  8622. {
  8623. "path": "collection",
  8624. "filters": [],
  8625. "orderBys": []
  8626. }
  8627. ],
  8628. "expectedState": {
  8629. "activeTargets": {
  8630. "2": {
  8631. "queries": [
  8632. {
  8633. "path": "collection",
  8634. "filters": [],
  8635. "orderBys": []
  8636. }
  8637. ],
  8638. "resumeToken": ""
  8639. }
  8640. }
  8641. },
  8642. "clientIndex": 0
  8643. },
  8644. {
  8645. "watchAck": [
  8646. 2
  8647. ],
  8648. "clientIndex": 0
  8649. },
  8650. {
  8651. "watchEntity": {
  8652. "docs": [],
  8653. "targets": [
  8654. 2
  8655. ]
  8656. },
  8657. "clientIndex": 0
  8658. },
  8659. {
  8660. "watchCurrent": [
  8661. [
  8662. 2
  8663. ],
  8664. "resume-token-500"
  8665. ],
  8666. "clientIndex": 0
  8667. },
  8668. {
  8669. "watchSnapshot": {
  8670. "version": 500,
  8671. "targetIds": []
  8672. },
  8673. "expectedSnapshotEvents": [
  8674. {
  8675. "query": {
  8676. "path": "collection",
  8677. "filters": [],
  8678. "orderBys": []
  8679. },
  8680. "errorCode": 0,
  8681. "fromCache": false,
  8682. "hasPendingWrites": false
  8683. }
  8684. ],
  8685. "clientIndex": 0
  8686. },
  8687. {
  8688. "drainQueue": true,
  8689. "clientIndex": 1
  8690. },
  8691. {
  8692. "userSet": [
  8693. "collection/a",
  8694. {
  8695. "v": 1
  8696. }
  8697. ],
  8698. "clientIndex": 1
  8699. },
  8700. {
  8701. "drainQueue": true,
  8702. "expectedSnapshotEvents": [
  8703. {
  8704. "query": {
  8705. "path": "collection",
  8706. "filters": [],
  8707. "orderBys": []
  8708. },
  8709. "added": [
  8710. {
  8711. "key": "collection/a",
  8712. "version": 0,
  8713. "value": {
  8714. "v": 1
  8715. },
  8716. "options": {
  8717. "hasLocalMutations": true,
  8718. "hasCommittedMutations": false
  8719. }
  8720. }
  8721. ],
  8722. "errorCode": 0,
  8723. "fromCache": false,
  8724. "hasPendingWrites": true
  8725. }
  8726. ],
  8727. "clientIndex": 0
  8728. },
  8729. {
  8730. "writeAck": {
  8731. "version": 1000
  8732. },
  8733. "clientIndex": 0
  8734. },
  8735. {
  8736. "drainQueue": true,
  8737. "expectedState": {
  8738. "userCallbacks": {
  8739. "acknowledgedDocs": [
  8740. "collection/a"
  8741. ],
  8742. "rejectedDocs": []
  8743. }
  8744. },
  8745. "clientIndex": 1
  8746. },
  8747. {
  8748. "drainQueue": true,
  8749. "clientIndex": 0
  8750. },
  8751. {
  8752. "watchEntity": {
  8753. "docs": [
  8754. {
  8755. "key": "collection/a",
  8756. "version": 1000,
  8757. "value": {
  8758. "v": 1
  8759. },
  8760. "options": {
  8761. "hasLocalMutations": false,
  8762. "hasCommittedMutations": false
  8763. }
  8764. }
  8765. ],
  8766. "targets": [
  8767. 2
  8768. ]
  8769. },
  8770. "clientIndex": 0
  8771. },
  8772. {
  8773. "watchSnapshot": {
  8774. "version": 2000,
  8775. "targetIds": []
  8776. },
  8777. "expectedSnapshotEvents": [
  8778. {
  8779. "query": {
  8780. "path": "collection",
  8781. "filters": [],
  8782. "orderBys": []
  8783. },
  8784. "metadata": [
  8785. {
  8786. "key": "collection/a",
  8787. "version": 1000,
  8788. "value": {
  8789. "v": 1
  8790. },
  8791. "options": {
  8792. "hasLocalMutations": false,
  8793. "hasCommittedMutations": false
  8794. }
  8795. }
  8796. ],
  8797. "errorCode": 0,
  8798. "fromCache": false,
  8799. "hasPendingWrites": false
  8800. }
  8801. ],
  8802. "clientIndex": 0
  8803. }
  8804. ]
  8805. },
  8806. "Writes are held during primary failover": {
  8807. "describeName": "Writes:",
  8808. "itName": "Writes are held during primary failover",
  8809. "tags": [
  8810. "multi-client"
  8811. ],
  8812. "config": {
  8813. "useGarbageCollection": false,
  8814. "numClients": 2
  8815. },
  8816. "steps": [
  8817. {
  8818. "drainQueue": true,
  8819. "clientIndex": 0
  8820. },
  8821. {
  8822. "userListen": [
  8823. 2,
  8824. {
  8825. "path": "collection",
  8826. "filters": [],
  8827. "orderBys": []
  8828. }
  8829. ],
  8830. "expectedState": {
  8831. "activeTargets": {
  8832. "2": {
  8833. "queries": [
  8834. {
  8835. "path": "collection",
  8836. "filters": [],
  8837. "orderBys": []
  8838. }
  8839. ],
  8840. "resumeToken": ""
  8841. }
  8842. }
  8843. },
  8844. "clientIndex": 0
  8845. },
  8846. {
  8847. "userSet": [
  8848. "collection/doc",
  8849. {
  8850. "v": 1
  8851. }
  8852. ],
  8853. "expectedSnapshotEvents": [
  8854. {
  8855. "query": {
  8856. "path": "collection",
  8857. "filters": [],
  8858. "orderBys": []
  8859. },
  8860. "added": [
  8861. {
  8862. "key": "collection/doc",
  8863. "version": 0,
  8864. "value": {
  8865. "v": 1
  8866. },
  8867. "options": {
  8868. "hasLocalMutations": true,
  8869. "hasCommittedMutations": false
  8870. }
  8871. }
  8872. ],
  8873. "errorCode": 0,
  8874. "fromCache": true,
  8875. "hasPendingWrites": true
  8876. }
  8877. ],
  8878. "clientIndex": 0
  8879. },
  8880. {
  8881. "watchAck": [
  8882. 2
  8883. ],
  8884. "clientIndex": 0
  8885. },
  8886. {
  8887. "watchEntity": {
  8888. "docs": [],
  8889. "targets": [
  8890. 2
  8891. ]
  8892. },
  8893. "clientIndex": 0
  8894. },
  8895. {
  8896. "watchCurrent": [
  8897. [
  8898. 2
  8899. ],
  8900. "resume-token-1000"
  8901. ],
  8902. "clientIndex": 0
  8903. },
  8904. {
  8905. "watchSnapshot": {
  8906. "version": 1000,
  8907. "targetIds": []
  8908. },
  8909. "expectedSnapshotEvents": [
  8910. {
  8911. "query": {
  8912. "path": "collection",
  8913. "filters": [],
  8914. "orderBys": []
  8915. },
  8916. "errorCode": 0,
  8917. "fromCache": false,
  8918. "hasPendingWrites": true
  8919. }
  8920. ],
  8921. "clientIndex": 0
  8922. },
  8923. {
  8924. "writeAck": {
  8925. "version": 2000
  8926. },
  8927. "expectedState": {
  8928. "userCallbacks": {
  8929. "acknowledgedDocs": [
  8930. "collection/doc"
  8931. ],
  8932. "rejectedDocs": []
  8933. }
  8934. },
  8935. "clientIndex": 0
  8936. },
  8937. {
  8938. "drainQueue": true,
  8939. "clientIndex": 1
  8940. },
  8941. {
  8942. "applyClientState": {
  8943. "primary": true
  8944. },
  8945. "expectedState": {
  8946. "isPrimary": true,
  8947. "activeTargets": {
  8948. "2": {
  8949. "queries": [
  8950. {
  8951. "path": "collection",
  8952. "filters": [],
  8953. "orderBys": []
  8954. }
  8955. ],
  8956. "resumeToken": "resume-token-1000"
  8957. }
  8958. }
  8959. },
  8960. "clientIndex": 1
  8961. },
  8962. {
  8963. "userListen": [
  8964. 4,
  8965. {
  8966. "path": "collection/doc",
  8967. "filters": [],
  8968. "orderBys": []
  8969. }
  8970. ],
  8971. "expectedState": {
  8972. "activeTargets": {
  8973. "2": {
  8974. "queries": [
  8975. {
  8976. "path": "collection",
  8977. "filters": [],
  8978. "orderBys": []
  8979. }
  8980. ],
  8981. "resumeToken": "resume-token-1000"
  8982. },
  8983. "4": {
  8984. "queries": [
  8985. {
  8986. "path": "collection/doc",
  8987. "filters": [],
  8988. "orderBys": []
  8989. }
  8990. ],
  8991. "resumeToken": ""
  8992. }
  8993. }
  8994. },
  8995. "expectedSnapshotEvents": [
  8996. {
  8997. "query": {
  8998. "path": "collection/doc",
  8999. "filters": [],
  9000. "orderBys": []
  9001. },
  9002. "added": [
  9003. {
  9004. "key": "collection/doc",
  9005. "version": 2000,
  9006. "value": {
  9007. "v": 1
  9008. },
  9009. "options": {
  9010. "hasLocalMutations": false,
  9011. "hasCommittedMutations": true
  9012. }
  9013. }
  9014. ],
  9015. "errorCode": 0,
  9016. "fromCache": true,
  9017. "hasPendingWrites": false
  9018. }
  9019. ],
  9020. "clientIndex": 1
  9021. },
  9022. {
  9023. "watchAck": [
  9024. 2
  9025. ],
  9026. "clientIndex": 1
  9027. },
  9028. {
  9029. "watchAck": [
  9030. 4
  9031. ],
  9032. "clientIndex": 1
  9033. },
  9034. {
  9035. "watchEntity": {
  9036. "docs": [
  9037. {
  9038. "key": "collection/doc",
  9039. "version": 2000,
  9040. "value": {
  9041. "v": 1
  9042. },
  9043. "options": {
  9044. "hasLocalMutations": false,
  9045. "hasCommittedMutations": false
  9046. }
  9047. }
  9048. ],
  9049. "targets": [
  9050. 2,
  9051. 4
  9052. ]
  9053. },
  9054. "clientIndex": 1
  9055. },
  9056. {
  9057. "watchCurrent": [
  9058. [
  9059. 2
  9060. ],
  9061. "resume-token-2000"
  9062. ],
  9063. "clientIndex": 1
  9064. },
  9065. {
  9066. "watchCurrent": [
  9067. [
  9068. 4
  9069. ],
  9070. "resume-token-2000"
  9071. ],
  9072. "clientIndex": 1
  9073. },
  9074. {
  9075. "watchSnapshot": {
  9076. "version": 2000,
  9077. "targetIds": []
  9078. },
  9079. "expectedSnapshotEvents": [
  9080. {
  9081. "query": {
  9082. "path": "collection/doc",
  9083. "filters": [],
  9084. "orderBys": []
  9085. },
  9086. "errorCode": 0,
  9087. "fromCache": false,
  9088. "hasPendingWrites": false
  9089. }
  9090. ],
  9091. "clientIndex": 1
  9092. },
  9093. {
  9094. "drainQueue": true,
  9095. "expectedState": {
  9096. "activeTargets": {
  9097. "2": {
  9098. "queries": [
  9099. {
  9100. "path": "collection",
  9101. "filters": [],
  9102. "orderBys": []
  9103. }
  9104. ],
  9105. "resumeToken": ""
  9106. },
  9107. "4": {
  9108. "queries": [
  9109. {
  9110. "path": "collection/doc",
  9111. "filters": [],
  9112. "orderBys": []
  9113. }
  9114. ],
  9115. "resumeToken": ""
  9116. }
  9117. }
  9118. },
  9119. "clientIndex": 0
  9120. },
  9121. {
  9122. "runTimer": "client_metadata_refresh",
  9123. "expectedState": {
  9124. "isPrimary": false
  9125. },
  9126. "expectedSnapshotEvents": [
  9127. {
  9128. "query": {
  9129. "path": "collection",
  9130. "filters": [],
  9131. "orderBys": []
  9132. },
  9133. "metadata": [
  9134. {
  9135. "key": "collection/doc",
  9136. "version": 2000,
  9137. "value": {
  9138. "v": 1
  9139. },
  9140. "options": {
  9141. "hasLocalMutations": false,
  9142. "hasCommittedMutations": false
  9143. }
  9144. }
  9145. ],
  9146. "errorCode": 0,
  9147. "fromCache": false,
  9148. "hasPendingWrites": false
  9149. }
  9150. ],
  9151. "clientIndex": 0
  9152. }
  9153. ]
  9154. },
  9155. "Write are sequenced by multiple clients": {
  9156. "describeName": "Writes:",
  9157. "itName": "Write are sequenced by multiple clients",
  9158. "tags": [
  9159. "multi-client"
  9160. ],
  9161. "config": {
  9162. "useGarbageCollection": false,
  9163. "numClients": 4
  9164. },
  9165. "steps": [
  9166. {
  9167. "drainQueue": true,
  9168. "clientIndex": 0
  9169. },
  9170. {
  9171. "userSet": [
  9172. "collection/a",
  9173. {
  9174. "v": 1
  9175. }
  9176. ],
  9177. "clientIndex": 0
  9178. },
  9179. {
  9180. "drainQueue": true,
  9181. "clientIndex": 1
  9182. },
  9183. {
  9184. "userSet": [
  9185. "collection/b",
  9186. {
  9187. "v": 1
  9188. }
  9189. ],
  9190. "clientIndex": 1
  9191. },
  9192. {
  9193. "drainQueue": true,
  9194. "clientIndex": 2
  9195. },
  9196. {
  9197. "userSet": [
  9198. "collection/c",
  9199. {
  9200. "v": 1
  9201. }
  9202. ],
  9203. "clientIndex": 2
  9204. },
  9205. {
  9206. "drainQueue": true,
  9207. "clientIndex": 3
  9208. },
  9209. {
  9210. "userSet": [
  9211. "collection/d",
  9212. {
  9213. "v": 1
  9214. }
  9215. ],
  9216. "clientIndex": 3
  9217. },
  9218. {
  9219. "drainQueue": true,
  9220. "clientIndex": 0
  9221. },
  9222. {
  9223. "writeAck": {
  9224. "version": 1000
  9225. },
  9226. "expectedState": {
  9227. "userCallbacks": {
  9228. "acknowledgedDocs": [
  9229. "collection/a"
  9230. ],
  9231. "rejectedDocs": []
  9232. }
  9233. },
  9234. "clientIndex": 0
  9235. },
  9236. {
  9237. "writeAck": {
  9238. "version": 2000
  9239. },
  9240. "clientIndex": 0
  9241. },
  9242. {
  9243. "writeAck": {
  9244. "version": 3000
  9245. },
  9246. "clientIndex": 0
  9247. },
  9248. {
  9249. "failWrite": {
  9250. "error": {
  9251. "code": 9
  9252. }
  9253. },
  9254. "clientIndex": 0
  9255. },
  9256. {
  9257. "drainQueue": true,
  9258. "expectedState": {
  9259. "userCallbacks": {
  9260. "acknowledgedDocs": [
  9261. "collection/b"
  9262. ],
  9263. "rejectedDocs": []
  9264. }
  9265. },
  9266. "clientIndex": 1
  9267. },
  9268. {
  9269. "drainQueue": true,
  9270. "expectedState": {
  9271. "userCallbacks": {
  9272. "acknowledgedDocs": [
  9273. "collection/c"
  9274. ],
  9275. "rejectedDocs": []
  9276. }
  9277. },
  9278. "clientIndex": 2
  9279. },
  9280. {
  9281. "drainQueue": true,
  9282. "expectedState": {
  9283. "userCallbacks": {
  9284. "acknowledgedDocs": [],
  9285. "rejectedDocs": [
  9286. "collection/d"
  9287. ]
  9288. }
  9289. },
  9290. "clientIndex": 3
  9291. },
  9292. {
  9293. "drainQueue": true,
  9294. "clientIndex": 0
  9295. },
  9296. {
  9297. "userSet": [
  9298. "collection/f",
  9299. {
  9300. "v": 1
  9301. }
  9302. ],
  9303. "clientIndex": 0
  9304. },
  9305. {
  9306. "drainQueue": true,
  9307. "clientIndex": 1
  9308. },
  9309. {
  9310. "userSet": [
  9311. "collection/g",
  9312. {
  9313. "v": 1
  9314. }
  9315. ],
  9316. "clientIndex": 1
  9317. },
  9318. {
  9319. "drainQueue": true,
  9320. "clientIndex": 2
  9321. },
  9322. {
  9323. "userSet": [
  9324. "collection/h",
  9325. {
  9326. "v": 1
  9327. }
  9328. ],
  9329. "clientIndex": 2
  9330. },
  9331. {
  9332. "drainQueue": true,
  9333. "clientIndex": 3
  9334. },
  9335. {
  9336. "userSet": [
  9337. "collection/i",
  9338. {
  9339. "v": 1
  9340. }
  9341. ],
  9342. "clientIndex": 3
  9343. },
  9344. {
  9345. "drainQueue": true,
  9346. "clientIndex": 0
  9347. },
  9348. {
  9349. "writeAck": {
  9350. "version": 4000
  9351. },
  9352. "expectedState": {
  9353. "userCallbacks": {
  9354. "acknowledgedDocs": [
  9355. "collection/f"
  9356. ],
  9357. "rejectedDocs": []
  9358. }
  9359. },
  9360. "clientIndex": 0
  9361. },
  9362. {
  9363. "writeAck": {
  9364. "version": 5000
  9365. },
  9366. "clientIndex": 0
  9367. },
  9368. {
  9369. "writeAck": {
  9370. "version": 6000
  9371. },
  9372. "clientIndex": 0
  9373. },
  9374. {
  9375. "failWrite": {
  9376. "error": {
  9377. "code": 9
  9378. }
  9379. },
  9380. "clientIndex": 0
  9381. },
  9382. {
  9383. "drainQueue": true,
  9384. "expectedState": {
  9385. "userCallbacks": {
  9386. "acknowledgedDocs": [
  9387. "collection/g"
  9388. ],
  9389. "rejectedDocs": []
  9390. }
  9391. },
  9392. "clientIndex": 1
  9393. },
  9394. {
  9395. "drainQueue": true,
  9396. "expectedState": {
  9397. "userCallbacks": {
  9398. "acknowledgedDocs": [
  9399. "collection/h"
  9400. ],
  9401. "rejectedDocs": []
  9402. }
  9403. },
  9404. "clientIndex": 2
  9405. },
  9406. {
  9407. "drainQueue": true,
  9408. "expectedState": {
  9409. "userCallbacks": {
  9410. "acknowledgedDocs": [],
  9411. "rejectedDocs": [
  9412. "collection/i"
  9413. ]
  9414. }
  9415. },
  9416. "clientIndex": 3
  9417. },
  9418. {
  9419. "drainQueue": true,
  9420. "clientIndex": 3
  9421. },
  9422. {
  9423. "userSet": [
  9424. "collection/j",
  9425. {
  9426. "v": 1
  9427. }
  9428. ],
  9429. "clientIndex": 3
  9430. },
  9431. {
  9432. "userSet": [
  9433. "collection/k",
  9434. {
  9435. "v": 1
  9436. }
  9437. ],
  9438. "clientIndex": 3
  9439. },
  9440. {
  9441. "userSet": [
  9442. "collection/l",
  9443. {
  9444. "v": 1
  9445. }
  9446. ],
  9447. "clientIndex": 3
  9448. },
  9449. {
  9450. "drainQueue": true,
  9451. "clientIndex": 0
  9452. },
  9453. {
  9454. "writeAck": {
  9455. "version": 7000
  9456. },
  9457. "clientIndex": 0
  9458. },
  9459. {
  9460. "failWrite": {
  9461. "error": {
  9462. "code": 9
  9463. }
  9464. },
  9465. "clientIndex": 0
  9466. },
  9467. {
  9468. "writeAck": {
  9469. "version": 8000
  9470. },
  9471. "clientIndex": 0
  9472. },
  9473. {
  9474. "drainQueue": true,
  9475. "expectedState": {
  9476. "userCallbacks": {
  9477. "acknowledgedDocs": [
  9478. "collection/j",
  9479. "collection/l"
  9480. ],
  9481. "rejectedDocs": [
  9482. "collection/k"
  9483. ]
  9484. }
  9485. },
  9486. "clientIndex": 3
  9487. }
  9488. ]
  9489. },
  9490. "Write is executed after primary tab failover": {
  9491. "describeName": "Writes:",
  9492. "itName": "Write is executed after primary tab failover",
  9493. "tags": [
  9494. "multi-client"
  9495. ],
  9496. "config": {
  9497. "useGarbageCollection": false,
  9498. "numClients": 2
  9499. },
  9500. "steps": [
  9501. {
  9502. "drainQueue": true,
  9503. "clientIndex": 0
  9504. },
  9505. {
  9506. "applyClientState": {
  9507. "visibility": "visible"
  9508. },
  9509. "expectedState": {
  9510. "isPrimary": true
  9511. },
  9512. "clientIndex": 0
  9513. },
  9514. {
  9515. "drainQueue": true,
  9516. "expectedState": {
  9517. "isPrimary": false
  9518. },
  9519. "clientIndex": 1
  9520. },
  9521. {
  9522. "userSet": [
  9523. "collection/a",
  9524. {
  9525. "v": 1
  9526. }
  9527. ],
  9528. "clientIndex": 1
  9529. },
  9530. {
  9531. "userSet": [
  9532. "collection/b",
  9533. {
  9534. "v": 1
  9535. }
  9536. ],
  9537. "clientIndex": 1
  9538. },
  9539. {
  9540. "drainQueue": true,
  9541. "clientIndex": 0
  9542. },
  9543. {
  9544. "writeAck": {
  9545. "version": 1000
  9546. },
  9547. "clientIndex": 0
  9548. },
  9549. {
  9550. "shutdown": true,
  9551. "expectedState": {
  9552. "activeTargets": {},
  9553. "limboDocs": []
  9554. },
  9555. "clientIndex": 0
  9556. },
  9557. {
  9558. "drainQueue": true,
  9559. "expectedState": {
  9560. "userCallbacks": {
  9561. "acknowledgedDocs": [
  9562. "collection/a"
  9563. ],
  9564. "rejectedDocs": []
  9565. }
  9566. },
  9567. "clientIndex": 1
  9568. },
  9569. {
  9570. "runTimer": "client_metadata_refresh",
  9571. "expectedState": {
  9572. "isPrimary": true
  9573. },
  9574. "clientIndex": 1
  9575. },
  9576. {
  9577. "writeAck": {
  9578. "version": 2000
  9579. },
  9580. "expectedState": {
  9581. "userCallbacks": {
  9582. "acknowledgedDocs": [
  9583. "collection/b"
  9584. ],
  9585. "rejectedDocs": []
  9586. }
  9587. },
  9588. "clientIndex": 1
  9589. }
  9590. ]
  9591. },
  9592. "Secondary tabs handle user change": {
  9593. "describeName": "Writes:",
  9594. "itName": "Secondary tabs handle user change",
  9595. "tags": [
  9596. "multi-client"
  9597. ],
  9598. "config": {
  9599. "useGarbageCollection": false,
  9600. "numClients": 2
  9601. },
  9602. "steps": [
  9603. {
  9604. "drainQueue": true,
  9605. "clientIndex": 0
  9606. },
  9607. {
  9608. "userListen": [
  9609. 2,
  9610. {
  9611. "path": "collection",
  9612. "filters": [],
  9613. "orderBys": []
  9614. }
  9615. ],
  9616. "expectedState": {
  9617. "activeTargets": {
  9618. "2": {
  9619. "queries": [
  9620. {
  9621. "path": "collection",
  9622. "filters": [],
  9623. "orderBys": []
  9624. }
  9625. ],
  9626. "resumeToken": ""
  9627. }
  9628. }
  9629. },
  9630. "clientIndex": 0
  9631. },
  9632. {
  9633. "changeUser": "user1",
  9634. "clientIndex": 0
  9635. },
  9636. {
  9637. "userSet": [
  9638. "collection/a",
  9639. {
  9640. "v": 1
  9641. }
  9642. ],
  9643. "expectedSnapshotEvents": [
  9644. {
  9645. "query": {
  9646. "path": "collection",
  9647. "filters": [],
  9648. "orderBys": []
  9649. },
  9650. "added": [
  9651. {
  9652. "key": "collection/a",
  9653. "version": 0,
  9654. "value": {
  9655. "v": 1
  9656. },
  9657. "options": {
  9658. "hasLocalMutations": true,
  9659. "hasCommittedMutations": false
  9660. }
  9661. }
  9662. ],
  9663. "errorCode": 0,
  9664. "fromCache": true,
  9665. "hasPendingWrites": true
  9666. }
  9667. ],
  9668. "clientIndex": 0
  9669. },
  9670. {
  9671. "drainQueue": true,
  9672. "clientIndex": 1
  9673. },
  9674. {
  9675. "changeUser": "user1",
  9676. "clientIndex": 1
  9677. },
  9678. {
  9679. "userListen": [
  9680. 2,
  9681. {
  9682. "path": "collection",
  9683. "filters": [],
  9684. "orderBys": []
  9685. }
  9686. ],
  9687. "expectedState": {
  9688. "activeTargets": {
  9689. "2": {
  9690. "queries": [
  9691. {
  9692. "path": "collection",
  9693. "filters": [],
  9694. "orderBys": []
  9695. }
  9696. ],
  9697. "resumeToken": ""
  9698. }
  9699. }
  9700. },
  9701. "expectedSnapshotEvents": [
  9702. {
  9703. "query": {
  9704. "path": "collection",
  9705. "filters": [],
  9706. "orderBys": []
  9707. },
  9708. "added": [
  9709. {
  9710. "key": "collection/a",
  9711. "version": 0,
  9712. "value": {
  9713. "v": 1
  9714. },
  9715. "options": {
  9716. "hasLocalMutations": true,
  9717. "hasCommittedMutations": false
  9718. }
  9719. }
  9720. ],
  9721. "errorCode": 0,
  9722. "fromCache": true,
  9723. "hasPendingWrites": true
  9724. }
  9725. ],
  9726. "clientIndex": 1
  9727. },
  9728. {
  9729. "userSet": [
  9730. "collection/b",
  9731. {
  9732. "v": 1
  9733. }
  9734. ],
  9735. "expectedSnapshotEvents": [
  9736. {
  9737. "query": {
  9738. "path": "collection",
  9739. "filters": [],
  9740. "orderBys": []
  9741. },
  9742. "added": [
  9743. {
  9744. "key": "collection/b",
  9745. "version": 0,
  9746. "value": {
  9747. "v": 1
  9748. },
  9749. "options": {
  9750. "hasLocalMutations": true,
  9751. "hasCommittedMutations": false
  9752. }
  9753. }
  9754. ],
  9755. "errorCode": 0,
  9756. "fromCache": true,
  9757. "hasPendingWrites": true
  9758. }
  9759. ],
  9760. "clientIndex": 1
  9761. },
  9762. {
  9763. "drainQueue": true,
  9764. "expectedSnapshotEvents": [
  9765. {
  9766. "query": {
  9767. "path": "collection",
  9768. "filters": [],
  9769. "orderBys": []
  9770. },
  9771. "added": [
  9772. {
  9773. "key": "collection/b",
  9774. "version": 0,
  9775. "value": {
  9776. "v": 1
  9777. },
  9778. "options": {
  9779. "hasLocalMutations": true,
  9780. "hasCommittedMutations": false
  9781. }
  9782. }
  9783. ],
  9784. "errorCode": 0,
  9785. "fromCache": true,
  9786. "hasPendingWrites": true
  9787. }
  9788. ],
  9789. "clientIndex": 0
  9790. },
  9791. {
  9792. "changeUser": "user2",
  9793. "expectedSnapshotEvents": [
  9794. {
  9795. "query": {
  9796. "path": "collection",
  9797. "filters": [],
  9798. "orderBys": []
  9799. },
  9800. "removed": [
  9801. {
  9802. "key": "collection/a",
  9803. "version": 0,
  9804. "value": {
  9805. "v": 1
  9806. },
  9807. "options": {
  9808. "hasLocalMutations": true,
  9809. "hasCommittedMutations": false
  9810. }
  9811. },
  9812. {
  9813. "key": "collection/b",
  9814. "version": 0,
  9815. "value": {
  9816. "v": 1
  9817. },
  9818. "options": {
  9819. "hasLocalMutations": true,
  9820. "hasCommittedMutations": false
  9821. }
  9822. }
  9823. ],
  9824. "errorCode": 0,
  9825. "fromCache": true,
  9826. "hasPendingWrites": false
  9827. }
  9828. ],
  9829. "clientIndex": 0
  9830. },
  9831. {
  9832. "userSet": [
  9833. "collection/c",
  9834. {
  9835. "v": 1
  9836. }
  9837. ],
  9838. "expectedSnapshotEvents": [
  9839. {
  9840. "query": {
  9841. "path": "collection",
  9842. "filters": [],
  9843. "orderBys": []
  9844. },
  9845. "added": [
  9846. {
  9847. "key": "collection/c",
  9848. "version": 0,
  9849. "value": {
  9850. "v": 1
  9851. },
  9852. "options": {
  9853. "hasLocalMutations": true,
  9854. "hasCommittedMutations": false
  9855. }
  9856. }
  9857. ],
  9858. "errorCode": 0,
  9859. "fromCache": true,
  9860. "hasPendingWrites": true
  9861. }
  9862. ],
  9863. "clientIndex": 0
  9864. },
  9865. {
  9866. "drainQueue": true,
  9867. "clientIndex": 1
  9868. },
  9869. {
  9870. "changeUser": "user2",
  9871. "expectedSnapshotEvents": [
  9872. {
  9873. "query": {
  9874. "path": "collection",
  9875. "filters": [],
  9876. "orderBys": []
  9877. },
  9878. "added": [
  9879. {
  9880. "key": "collection/c",
  9881. "version": 0,
  9882. "value": {
  9883. "v": 1
  9884. },
  9885. "options": {
  9886. "hasLocalMutations": true,
  9887. "hasCommittedMutations": false
  9888. }
  9889. }
  9890. ],
  9891. "removed": [
  9892. {
  9893. "key": "collection/a",
  9894. "version": 0,
  9895. "value": {
  9896. "v": 1
  9897. },
  9898. "options": {
  9899. "hasLocalMutations": true,
  9900. "hasCommittedMutations": false
  9901. }
  9902. },
  9903. {
  9904. "key": "collection/b",
  9905. "version": 0,
  9906. "value": {
  9907. "v": 1
  9908. },
  9909. "options": {
  9910. "hasLocalMutations": true,
  9911. "hasCommittedMutations": false
  9912. }
  9913. }
  9914. ],
  9915. "errorCode": 0,
  9916. "fromCache": true,
  9917. "hasPendingWrites": true
  9918. }
  9919. ],
  9920. "clientIndex": 1
  9921. },
  9922. {
  9923. "changeUser": "user1",
  9924. "expectedSnapshotEvents": [
  9925. {
  9926. "query": {
  9927. "path": "collection",
  9928. "filters": [],
  9929. "orderBys": []
  9930. },
  9931. "added": [
  9932. {
  9933. "key": "collection/a",
  9934. "version": 0,
  9935. "value": {
  9936. "v": 1
  9937. },
  9938. "options": {
  9939. "hasLocalMutations": true,
  9940. "hasCommittedMutations": false
  9941. }
  9942. },
  9943. {
  9944. "key": "collection/b",
  9945. "version": 0,
  9946. "value": {
  9947. "v": 1
  9948. },
  9949. "options": {
  9950. "hasLocalMutations": true,
  9951. "hasCommittedMutations": false
  9952. }
  9953. }
  9954. ],
  9955. "removed": [
  9956. {
  9957. "key": "collection/c",
  9958. "version": 0,
  9959. "value": {
  9960. "v": 1
  9961. },
  9962. "options": {
  9963. "hasLocalMutations": true,
  9964. "hasCommittedMutations": false
  9965. }
  9966. }
  9967. ],
  9968. "errorCode": 0,
  9969. "fromCache": true,
  9970. "hasPendingWrites": true
  9971. }
  9972. ],
  9973. "clientIndex": 1
  9974. },
  9975. {
  9976. "drainQueue": true,
  9977. "clientIndex": 0
  9978. },
  9979. {
  9980. "changeUser": "user1",
  9981. "expectedSnapshotEvents": [
  9982. {
  9983. "query": {
  9984. "path": "collection",
  9985. "filters": [],
  9986. "orderBys": []
  9987. },
  9988. "added": [
  9989. {
  9990. "key": "collection/a",
  9991. "version": 0,
  9992. "value": {
  9993. "v": 1
  9994. },
  9995. "options": {
  9996. "hasLocalMutations": true,
  9997. "hasCommittedMutations": false
  9998. }
  9999. },
  10000. {
  10001. "key": "collection/b",
  10002. "version": 0,
  10003. "value": {
  10004. "v": 1
  10005. },
  10006. "options": {
  10007. "hasLocalMutations": true,
  10008. "hasCommittedMutations": false
  10009. }
  10010. }
  10011. ],
  10012. "removed": [
  10013. {
  10014. "key": "collection/c",
  10015. "version": 0,
  10016. "value": {
  10017. "v": 1
  10018. },
  10019. "options": {
  10020. "hasLocalMutations": true,
  10021. "hasCommittedMutations": false
  10022. }
  10023. }
  10024. ],
  10025. "errorCode": 0,
  10026. "fromCache": true,
  10027. "hasPendingWrites": true
  10028. }
  10029. ],
  10030. "clientIndex": 0
  10031. }
  10032. ]
  10033. },
  10034. "Mutations are scoped by user": {
  10035. "describeName": "Writes:",
  10036. "itName": "Mutations are scoped by user",
  10037. "tags": [
  10038. "multi-client"
  10039. ],
  10040. "config": {
  10041. "useGarbageCollection": false,
  10042. "numClients": 2
  10043. },
  10044. "steps": [
  10045. {
  10046. "drainQueue": true,
  10047. "clientIndex": 0
  10048. },
  10049. {
  10050. "changeUser": "user1",
  10051. "clientIndex": 0
  10052. },
  10053. {
  10054. "userSet": [
  10055. "collection/a",
  10056. {
  10057. "v": 1
  10058. }
  10059. ],
  10060. "clientIndex": 0
  10061. },
  10062. {
  10063. "drainQueue": true,
  10064. "clientIndex": 1
  10065. },
  10066. {
  10067. "changeUser": "user2",
  10068. "clientIndex": 1
  10069. },
  10070. {
  10071. "userSet": [
  10072. "collection/b",
  10073. {
  10074. "v": 1
  10075. }
  10076. ],
  10077. "clientIndex": 1
  10078. },
  10079. {
  10080. "drainQueue": true,
  10081. "clientIndex": 0
  10082. },
  10083. {
  10084. "userListen": [
  10085. 2,
  10086. {
  10087. "path": "collection",
  10088. "filters": [],
  10089. "orderBys": []
  10090. }
  10091. ],
  10092. "expectedState": {
  10093. "activeTargets": {
  10094. "2": {
  10095. "queries": [
  10096. {
  10097. "path": "collection",
  10098. "filters": [],
  10099. "orderBys": []
  10100. }
  10101. ],
  10102. "resumeToken": ""
  10103. }
  10104. }
  10105. },
  10106. "expectedSnapshotEvents": [
  10107. {
  10108. "query": {
  10109. "path": "collection",
  10110. "filters": [],
  10111. "orderBys": []
  10112. },
  10113. "added": [
  10114. {
  10115. "key": "collection/a",
  10116. "version": 0,
  10117. "value": {
  10118. "v": 1
  10119. },
  10120. "options": {
  10121. "hasLocalMutations": true,
  10122. "hasCommittedMutations": false
  10123. }
  10124. }
  10125. ],
  10126. "errorCode": 0,
  10127. "fromCache": true,
  10128. "hasPendingWrites": true
  10129. }
  10130. ],
  10131. "clientIndex": 0
  10132. },
  10133. {
  10134. "drainQueue": true,
  10135. "clientIndex": 1
  10136. },
  10137. {
  10138. "userListen": [
  10139. 2,
  10140. {
  10141. "path": "collection",
  10142. "filters": [],
  10143. "orderBys": []
  10144. }
  10145. ],
  10146. "expectedState": {
  10147. "activeTargets": {
  10148. "2": {
  10149. "queries": [
  10150. {
  10151. "path": "collection",
  10152. "filters": [],
  10153. "orderBys": []
  10154. }
  10155. ],
  10156. "resumeToken": ""
  10157. }
  10158. }
  10159. },
  10160. "expectedSnapshotEvents": [
  10161. {
  10162. "query": {
  10163. "path": "collection",
  10164. "filters": [],
  10165. "orderBys": []
  10166. },
  10167. "added": [
  10168. {
  10169. "key": "collection/b",
  10170. "version": 0,
  10171. "value": {
  10172. "v": 1
  10173. },
  10174. "options": {
  10175. "hasLocalMutations": true,
  10176. "hasCommittedMutations": false
  10177. }
  10178. }
  10179. ],
  10180. "errorCode": 0,
  10181. "fromCache": true,
  10182. "hasPendingWrites": true
  10183. }
  10184. ],
  10185. "clientIndex": 1
  10186. }
  10187. ]
  10188. },
  10189. "Mutation recovers after primary takeover": {
  10190. "describeName": "Writes:",
  10191. "itName": "Mutation recovers after primary takeover",
  10192. "tags": [
  10193. "multi-client"
  10194. ],
  10195. "config": {
  10196. "useGarbageCollection": false,
  10197. "numClients": 2
  10198. },
  10199. "steps": [
  10200. {
  10201. "drainQueue": true,
  10202. "expectedState": {
  10203. "isPrimary": true
  10204. },
  10205. "clientIndex": 0
  10206. },
  10207. {
  10208. "userSet": [
  10209. "collection/a",
  10210. {
  10211. "k": "a"
  10212. }
  10213. ],
  10214. "clientIndex": 0
  10215. },
  10216. {
  10217. "drainQueue": true,
  10218. "clientIndex": 1
  10219. },
  10220. {
  10221. "userListen": [
  10222. 2,
  10223. {
  10224. "path": "collection",
  10225. "filters": [],
  10226. "orderBys": []
  10227. }
  10228. ],
  10229. "expectedState": {
  10230. "activeTargets": {
  10231. "2": {
  10232. "queries": [
  10233. {
  10234. "path": "collection",
  10235. "filters": [],
  10236. "orderBys": []
  10237. }
  10238. ],
  10239. "resumeToken": ""
  10240. }
  10241. }
  10242. },
  10243. "expectedSnapshotEvents": [
  10244. {
  10245. "query": {
  10246. "path": "collection",
  10247. "filters": [],
  10248. "orderBys": []
  10249. },
  10250. "added": [
  10251. {
  10252. "key": "collection/a",
  10253. "version": 0,
  10254. "value": {
  10255. "k": "a"
  10256. },
  10257. "options": {
  10258. "hasLocalMutations": true,
  10259. "hasCommittedMutations": false
  10260. }
  10261. }
  10262. ],
  10263. "errorCode": 0,
  10264. "fromCache": true,
  10265. "hasPendingWrites": true
  10266. }
  10267. ],
  10268. "clientIndex": 1
  10269. },
  10270. {
  10271. "drainQueue": true,
  10272. "expectedState": {
  10273. "activeTargets": {
  10274. "2": {
  10275. "queries": [
  10276. {
  10277. "path": "collection",
  10278. "filters": [],
  10279. "orderBys": []
  10280. }
  10281. ],
  10282. "resumeToken": ""
  10283. }
  10284. }
  10285. },
  10286. "clientIndex": 0
  10287. },
  10288. {
  10289. "drainQueue": true,
  10290. "clientIndex": 1
  10291. },
  10292. {
  10293. "applyClientState": {
  10294. "primary": true
  10295. },
  10296. "expectedState": {
  10297. "isPrimary": true
  10298. },
  10299. "clientIndex": 1
  10300. },
  10301. {
  10302. "writeAck": {
  10303. "version": 1000
  10304. },
  10305. "clientIndex": 1
  10306. },
  10307. {
  10308. "watchAck": [
  10309. 2
  10310. ],
  10311. "clientIndex": 1
  10312. },
  10313. {
  10314. "watchEntity": {
  10315. "docs": [
  10316. {
  10317. "key": "collection/a",
  10318. "version": 1000,
  10319. "value": {
  10320. "k": "a"
  10321. },
  10322. "options": {
  10323. "hasLocalMutations": false,
  10324. "hasCommittedMutations": false
  10325. }
  10326. }
  10327. ],
  10328. "targets": [
  10329. 2
  10330. ]
  10331. },
  10332. "clientIndex": 1
  10333. },
  10334. {
  10335. "watchCurrent": [
  10336. [
  10337. 2
  10338. ],
  10339. "resume-token-1000"
  10340. ],
  10341. "clientIndex": 1
  10342. },
  10343. {
  10344. "watchSnapshot": {
  10345. "version": 1000,
  10346. "targetIds": []
  10347. },
  10348. "expectedSnapshotEvents": [
  10349. {
  10350. "query": {
  10351. "path": "collection",
  10352. "filters": [],
  10353. "orderBys": []
  10354. },
  10355. "metadata": [
  10356. {
  10357. "key": "collection/a",
  10358. "version": 1000,
  10359. "value": {
  10360. "k": "a"
  10361. },
  10362. "options": {
  10363. "hasLocalMutations": false,
  10364. "hasCommittedMutations": false
  10365. }
  10366. }
  10367. ],
  10368. "errorCode": 0,
  10369. "fromCache": false,
  10370. "hasPendingWrites": false
  10371. }
  10372. ],
  10373. "clientIndex": 1
  10374. },
  10375. {
  10376. "drainQueue": true,
  10377. "expectedState": {
  10378. "userCallbacks": {
  10379. "acknowledgedDocs": [
  10380. "collection/a"
  10381. ],
  10382. "rejectedDocs": []
  10383. }
  10384. },
  10385. "clientIndex": 0
  10386. }
  10387. ]
  10388. },
  10389. "Write is sent by newly started primary": {
  10390. "describeName": "Writes:",
  10391. "itName": "Write is sent by newly started primary",
  10392. "tags": [
  10393. "multi-client"
  10394. ],
  10395. "config": {
  10396. "useGarbageCollection": false,
  10397. "numClients": 3
  10398. },
  10399. "steps": [
  10400. {
  10401. "drainQueue": true,
  10402. "expectedState": {
  10403. "isPrimary": true
  10404. },
  10405. "clientIndex": 0
  10406. },
  10407. {
  10408. "drainQueue": true,
  10409. "expectedState": {
  10410. "isPrimary": false
  10411. },
  10412. "clientIndex": 1
  10413. },
  10414. {
  10415. "userSet": [
  10416. "collection/a",
  10417. {
  10418. "v": 1
  10419. }
  10420. ],
  10421. "clientIndex": 1
  10422. },
  10423. {
  10424. "drainQueue": true,
  10425. "clientIndex": 0
  10426. },
  10427. {
  10428. "shutdown": true,
  10429. "expectedState": {
  10430. "activeTargets": {},
  10431. "limboDocs": []
  10432. },
  10433. "clientIndex": 0
  10434. },
  10435. {
  10436. "drainQueue": true,
  10437. "expectedState": {
  10438. "isPrimary": true,
  10439. "numOutstandingWrites": 1
  10440. },
  10441. "clientIndex": 2
  10442. },
  10443. {
  10444. "writeAck": {
  10445. "version": 1000
  10446. },
  10447. "clientIndex": 2
  10448. },
  10449. {
  10450. "drainQueue": true,
  10451. "expectedState": {
  10452. "userCallbacks": {
  10453. "acknowledgedDocs": [
  10454. "collection/a"
  10455. ],
  10456. "rejectedDocs": []
  10457. }
  10458. },
  10459. "clientIndex": 1
  10460. }
  10461. ]
  10462. },
  10463. "Unresponsive primary ignores acknowledged write": {
  10464. "describeName": "Writes:",
  10465. "itName": "Unresponsive primary ignores acknowledged write",
  10466. "tags": [
  10467. "multi-client"
  10468. ],
  10469. "config": {
  10470. "useGarbageCollection": false,
  10471. "numClients": 3
  10472. },
  10473. "steps": [
  10474. {
  10475. "drainQueue": true,
  10476. "expectedState": {
  10477. "isPrimary": true
  10478. },
  10479. "clientIndex": 0
  10480. },
  10481. {
  10482. "userSet": [
  10483. "collection/a",
  10484. {
  10485. "k": "a"
  10486. }
  10487. ],
  10488. "clientIndex": 0
  10489. },
  10490. {
  10491. "writeAck": {
  10492. "version": 1000
  10493. },
  10494. "expectedState": {
  10495. "userCallbacks": {
  10496. "acknowledgedDocs": [
  10497. "collection/a"
  10498. ],
  10499. "rejectedDocs": []
  10500. }
  10501. },
  10502. "clientIndex": 0
  10503. },
  10504. {
  10505. "drainQueue": true,
  10506. "clientIndex": 1
  10507. },
  10508. {
  10509. "userSet": [
  10510. "collection/b",
  10511. {
  10512. "k": "b"
  10513. }
  10514. ],
  10515. "clientIndex": 1
  10516. },
  10517. {
  10518. "drainQueue": true,
  10519. "clientIndex": 2
  10520. },
  10521. {
  10522. "applyClientState": {
  10523. "primary": true
  10524. },
  10525. "expectedState": {
  10526. "isPrimary": true
  10527. },
  10528. "clientIndex": 2
  10529. },
  10530. {
  10531. "drainQueue": true,
  10532. "clientIndex": 0
  10533. },
  10534. {
  10535. "writeAck": {
  10536. "version": 2000,
  10537. "keepInQueue": true
  10538. },
  10539. "clientIndex": 0
  10540. },
  10541. {
  10542. "drainQueue": true,
  10543. "clientIndex": 2
  10544. },
  10545. {
  10546. "writeAck": {
  10547. "version": 2000
  10548. },
  10549. "clientIndex": 2
  10550. },
  10551. {
  10552. "drainQueue": true,
  10553. "expectedState": {
  10554. "userCallbacks": {
  10555. "acknowledgedDocs": [
  10556. "collection/b"
  10557. ],
  10558. "rejectedDocs": []
  10559. }
  10560. },
  10561. "clientIndex": 1
  10562. }
  10563. ]
  10564. },
  10565. "Unresponsive primary ignores rejected write": {
  10566. "describeName": "Writes:",
  10567. "itName": "Unresponsive primary ignores rejected write",
  10568. "tags": [
  10569. "multi-client"
  10570. ],
  10571. "config": {
  10572. "useGarbageCollection": false,
  10573. "numClients": 3
  10574. },
  10575. "steps": [
  10576. {
  10577. "drainQueue": true,
  10578. "expectedState": {
  10579. "isPrimary": true
  10580. },
  10581. "clientIndex": 0
  10582. },
  10583. {
  10584. "userSet": [
  10585. "collection/a",
  10586. {
  10587. "k": "a"
  10588. }
  10589. ],
  10590. "clientIndex": 0
  10591. },
  10592. {
  10593. "writeAck": {
  10594. "version": 1000
  10595. },
  10596. "expectedState": {
  10597. "userCallbacks": {
  10598. "acknowledgedDocs": [
  10599. "collection/a"
  10600. ],
  10601. "rejectedDocs": []
  10602. }
  10603. },
  10604. "clientIndex": 0
  10605. },
  10606. {
  10607. "drainQueue": true,
  10608. "clientIndex": 1
  10609. },
  10610. {
  10611. "userSet": [
  10612. "collection/b",
  10613. {
  10614. "k": "b"
  10615. }
  10616. ],
  10617. "clientIndex": 1
  10618. },
  10619. {
  10620. "drainQueue": true,
  10621. "clientIndex": 2
  10622. },
  10623. {
  10624. "applyClientState": {
  10625. "primary": true
  10626. },
  10627. "expectedState": {
  10628. "isPrimary": true
  10629. },
  10630. "clientIndex": 2
  10631. },
  10632. {
  10633. "drainQueue": true,
  10634. "clientIndex": 0
  10635. },
  10636. {
  10637. "failWrite": {
  10638. "error": {
  10639. "code": 9
  10640. },
  10641. "keepInQueue": true
  10642. },
  10643. "clientIndex": 0
  10644. },
  10645. {
  10646. "drainQueue": true,
  10647. "clientIndex": 2
  10648. },
  10649. {
  10650. "failWrite": {
  10651. "error": {
  10652. "code": 9
  10653. }
  10654. },
  10655. "clientIndex": 2
  10656. },
  10657. {
  10658. "drainQueue": true,
  10659. "expectedState": {
  10660. "userCallbacks": {
  10661. "acknowledgedDocs": [],
  10662. "rejectedDocs": [
  10663. "collection/b"
  10664. ]
  10665. }
  10666. },
  10667. "clientIndex": 1
  10668. }
  10669. ]
  10670. },
  10671. "Mutation are not sent twice after primary failover": {
  10672. "describeName": "Writes:",
  10673. "itName": "Mutation are not sent twice after primary failover",
  10674. "tags": [
  10675. "multi-client"
  10676. ],
  10677. "config": {
  10678. "useGarbageCollection": false,
  10679. "numClients": 2
  10680. },
  10681. "steps": [
  10682. {
  10683. "drainQueue": true,
  10684. "expectedState": {
  10685. "isPrimary": true
  10686. },
  10687. "clientIndex": 0
  10688. },
  10689. {
  10690. "userSet": [
  10691. "collection/a",
  10692. {
  10693. "k": "a"
  10694. }
  10695. ],
  10696. "clientIndex": 0
  10697. },
  10698. {
  10699. "userSet": [
  10700. "collection/b",
  10701. {
  10702. "k": "b"
  10703. }
  10704. ],
  10705. "clientIndex": 0
  10706. },
  10707. {
  10708. "drainQueue": true,
  10709. "clientIndex": 1
  10710. },
  10711. {
  10712. "applyClientState": {
  10713. "primary": true
  10714. },
  10715. "expectedState": {
  10716. "isPrimary": true
  10717. },
  10718. "clientIndex": 1
  10719. },
  10720. {
  10721. "writeAck": {
  10722. "version": 1000
  10723. },
  10724. "clientIndex": 1
  10725. },
  10726. {
  10727. "drainQueue": true,
  10728. "expectedState": {
  10729. "userCallbacks": {
  10730. "acknowledgedDocs": [
  10731. "collection/a"
  10732. ],
  10733. "rejectedDocs": []
  10734. }
  10735. },
  10736. "clientIndex": 0
  10737. },
  10738. {
  10739. "applyClientState": {
  10740. "primary": true
  10741. },
  10742. "expectedState": {
  10743. "isPrimary": true
  10744. },
  10745. "clientIndex": 0
  10746. },
  10747. {
  10748. "writeAck": {
  10749. "version": 2000
  10750. },
  10751. "expectedState": {
  10752. "userCallbacks": {
  10753. "acknowledgedDocs": [
  10754. "collection/b"
  10755. ],
  10756. "rejectedDocs": []
  10757. }
  10758. },
  10759. "clientIndex": 0
  10760. },
  10761. {
  10762. "userListen": [
  10763. 2,
  10764. {
  10765. "path": "collection",
  10766. "filters": [],
  10767. "orderBys": []
  10768. }
  10769. ],
  10770. "expectedState": {
  10771. "activeTargets": {
  10772. "2": {
  10773. "queries": [
  10774. {
  10775. "path": "collection",
  10776. "filters": [],
  10777. "orderBys": []
  10778. }
  10779. ],
  10780. "resumeToken": ""
  10781. }
  10782. }
  10783. },
  10784. "expectedSnapshotEvents": [
  10785. {
  10786. "query": {
  10787. "path": "collection",
  10788. "filters": [],
  10789. "orderBys": []
  10790. },
  10791. "added": [
  10792. {
  10793. "key": "collection/a",
  10794. "version": 1000,
  10795. "value": {
  10796. "k": "a"
  10797. },
  10798. "options": {
  10799. "hasLocalMutations": false,
  10800. "hasCommittedMutations": true
  10801. }
  10802. },
  10803. {
  10804. "key": "collection/b",
  10805. "version": 2000,
  10806. "value": {
  10807. "k": "b"
  10808. },
  10809. "options": {
  10810. "hasLocalMutations": false,
  10811. "hasCommittedMutations": true
  10812. }
  10813. }
  10814. ],
  10815. "errorCode": 0,
  10816. "fromCache": true,
  10817. "hasPendingWrites": false
  10818. }
  10819. ],
  10820. "clientIndex": 0
  10821. }
  10822. ]
  10823. }
  10824. }