write_spec_test.json 257 KB

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