write_spec_test.json 231 KB

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