write_spec_test.json 247 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587
  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. 2,
  15. {
  16. "filters": [
  17. ],
  18. "orderBys": [
  19. ],
  20. "path": "collection/key"
  21. }
  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": 1000
  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. 2,
  225. {
  226. "filters": [
  227. ],
  228. "orderBys": [
  229. ],
  230. "path": "collection"
  231. }
  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": 1000
  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. 2,
  486. {
  487. "filters": [
  488. ],
  489. "orderBys": [
  490. ],
  491. "path": "collection/key"
  492. }
  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": 1000
  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. 2,
  718. {
  719. "filters": [
  720. ],
  721. "orderBys": [
  722. ],
  723. "path": "collection"
  724. }
  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. 2,
  785. {
  786. "filters": [
  787. ],
  788. "orderBys": [
  789. ],
  790. "path": "collection"
  791. }
  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. 2,
  971. {
  972. "filters": [
  973. ],
  974. "orderBys": [
  975. ],
  976. "path": "collection/doc"
  977. }
  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": 1000
  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. 2,
  1197. {
  1198. "filters": [
  1199. ],
  1200. "orderBys": [
  1201. ],
  1202. "path": "collection/key"
  1203. }
  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": 1000
  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. 2,
  1407. {
  1408. "filters": [
  1409. ],
  1410. "orderBys": [
  1411. ],
  1412. "path": "collection"
  1413. }
  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": 1000
  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. 2,
  1703. {
  1704. "filters": [
  1705. ],
  1706. "orderBys": [
  1707. ],
  1708. "path": "collection"
  1709. }
  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": 2000
  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. 2,
  2098. {
  2099. "filters": [
  2100. ],
  2101. "orderBys": [
  2102. ],
  2103. "path": "collection"
  2104. }
  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. 2,
  2198. {
  2199. "filters": [
  2200. ],
  2201. "orderBys": [
  2202. ],
  2203. "path": "collection"
  2204. }
  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. 2,
  2428. {
  2429. "filters": [
  2430. ],
  2431. "orderBys": [
  2432. ],
  2433. "path": "collection"
  2434. }
  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. 2,
  2488. {
  2489. "filters": [
  2490. ],
  2491. "orderBys": [
  2492. ],
  2493. "path": "collection"
  2494. }
  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. 2,
  2625. {
  2626. "filters": [
  2627. ],
  2628. "orderBys": [
  2629. ],
  2630. "path": "collection"
  2631. }
  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. 2,
  2705. {
  2706. "filters": [
  2707. ],
  2708. "orderBys": [
  2709. ],
  2710. "path": "collection"
  2711. }
  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. 2,
  2934. {
  2935. "filters": [
  2936. ],
  2937. "orderBys": [
  2938. ],
  2939. "path": "collection"
  2940. }
  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. 2,
  3014. {
  3015. "filters": [
  3016. ],
  3017. "orderBys": [
  3018. ],
  3019. "path": "collection"
  3020. }
  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. 2,
  3216. {
  3217. "filters": [
  3218. ],
  3219. "orderBys": [
  3220. ],
  3221. "path": "collection"
  3222. }
  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. 2,
  3332. {
  3333. "filters": [
  3334. ],
  3335. "orderBys": [
  3336. ],
  3337. "path": "collection"
  3338. }
  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. 2,
  3537. {
  3538. "filters": [
  3539. ],
  3540. "orderBys": [
  3541. ],
  3542. "path": "collection"
  3543. }
  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. 2,
  4879. {
  4880. "filters": [
  4881. ],
  4882. "orderBys": [
  4883. ],
  4884. "path": "collection"
  4885. }
  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. 2,
  4952. {
  4953. "filters": [
  4954. ],
  4955. "orderBys": [
  4956. ],
  4957. "path": "collection"
  4958. }
  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. 2,
  5029. {
  5030. "filters": [
  5031. ],
  5032. "orderBys": [
  5033. ],
  5034. "path": "collection"
  5035. }
  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. 2,
  5414. {
  5415. "filters": [
  5416. ],
  5417. "orderBys": [
  5418. ],
  5419. "path": "collection"
  5420. }
  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": 1000
  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": 500
  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. "Write are sequenced by multiple clients": {
  5949. "describeName": "Writes:",
  5950. "itName": "Write are sequenced by multiple clients",
  5951. "tags": [
  5952. "multi-client"
  5953. ],
  5954. "config": {
  5955. "numClients": 4,
  5956. "useGarbageCollection": false
  5957. },
  5958. "steps": [
  5959. {
  5960. "clientIndex": 0,
  5961. "drainQueue": true
  5962. },
  5963. {
  5964. "clientIndex": 0,
  5965. "userSet": [
  5966. "collection/a",
  5967. {
  5968. "v": 1
  5969. }
  5970. ]
  5971. },
  5972. {
  5973. "clientIndex": 1,
  5974. "drainQueue": true
  5975. },
  5976. {
  5977. "clientIndex": 1,
  5978. "userSet": [
  5979. "collection/b",
  5980. {
  5981. "v": 1
  5982. }
  5983. ]
  5984. },
  5985. {
  5986. "clientIndex": 2,
  5987. "drainQueue": true
  5988. },
  5989. {
  5990. "clientIndex": 2,
  5991. "userSet": [
  5992. "collection/c",
  5993. {
  5994. "v": 1
  5995. }
  5996. ]
  5997. },
  5998. {
  5999. "clientIndex": 3,
  6000. "drainQueue": true
  6001. },
  6002. {
  6003. "clientIndex": 3,
  6004. "userSet": [
  6005. "collection/d",
  6006. {
  6007. "v": 1
  6008. }
  6009. ]
  6010. },
  6011. {
  6012. "clientIndex": 0,
  6013. "drainQueue": true
  6014. },
  6015. {
  6016. "clientIndex": 0,
  6017. "writeAck": {
  6018. "version": 1000
  6019. },
  6020. "expectedState": {
  6021. "userCallbacks": {
  6022. "acknowledgedDocs": [
  6023. "collection/a"
  6024. ],
  6025. "rejectedDocs": [
  6026. ]
  6027. }
  6028. }
  6029. },
  6030. {
  6031. "clientIndex": 0,
  6032. "writeAck": {
  6033. "version": 2000
  6034. }
  6035. },
  6036. {
  6037. "clientIndex": 0,
  6038. "writeAck": {
  6039. "version": 3000
  6040. }
  6041. },
  6042. {
  6043. "clientIndex": 0,
  6044. "failWrite": {
  6045. "error": {
  6046. "code": 9
  6047. }
  6048. }
  6049. },
  6050. {
  6051. "clientIndex": 1,
  6052. "drainQueue": true,
  6053. "expectedState": {
  6054. "userCallbacks": {
  6055. "acknowledgedDocs": [
  6056. "collection/b"
  6057. ],
  6058. "rejectedDocs": [
  6059. ]
  6060. }
  6061. }
  6062. },
  6063. {
  6064. "clientIndex": 2,
  6065. "drainQueue": true,
  6066. "expectedState": {
  6067. "userCallbacks": {
  6068. "acknowledgedDocs": [
  6069. "collection/c"
  6070. ],
  6071. "rejectedDocs": [
  6072. ]
  6073. }
  6074. }
  6075. },
  6076. {
  6077. "clientIndex": 3,
  6078. "drainQueue": true,
  6079. "expectedState": {
  6080. "userCallbacks": {
  6081. "acknowledgedDocs": [
  6082. ],
  6083. "rejectedDocs": [
  6084. "collection/d"
  6085. ]
  6086. }
  6087. }
  6088. },
  6089. {
  6090. "clientIndex": 0,
  6091. "drainQueue": true
  6092. },
  6093. {
  6094. "clientIndex": 0,
  6095. "userSet": [
  6096. "collection/f",
  6097. {
  6098. "v": 1
  6099. }
  6100. ]
  6101. },
  6102. {
  6103. "clientIndex": 1,
  6104. "drainQueue": true
  6105. },
  6106. {
  6107. "clientIndex": 1,
  6108. "userSet": [
  6109. "collection/g",
  6110. {
  6111. "v": 1
  6112. }
  6113. ]
  6114. },
  6115. {
  6116. "clientIndex": 2,
  6117. "drainQueue": true
  6118. },
  6119. {
  6120. "clientIndex": 2,
  6121. "userSet": [
  6122. "collection/h",
  6123. {
  6124. "v": 1
  6125. }
  6126. ]
  6127. },
  6128. {
  6129. "clientIndex": 3,
  6130. "drainQueue": true
  6131. },
  6132. {
  6133. "clientIndex": 3,
  6134. "userSet": [
  6135. "collection/i",
  6136. {
  6137. "v": 1
  6138. }
  6139. ]
  6140. },
  6141. {
  6142. "clientIndex": 0,
  6143. "drainQueue": true
  6144. },
  6145. {
  6146. "clientIndex": 0,
  6147. "writeAck": {
  6148. "version": 4000
  6149. },
  6150. "expectedState": {
  6151. "userCallbacks": {
  6152. "acknowledgedDocs": [
  6153. "collection/f"
  6154. ],
  6155. "rejectedDocs": [
  6156. ]
  6157. }
  6158. }
  6159. },
  6160. {
  6161. "clientIndex": 0,
  6162. "writeAck": {
  6163. "version": 5000
  6164. }
  6165. },
  6166. {
  6167. "clientIndex": 0,
  6168. "writeAck": {
  6169. "version": 6000
  6170. }
  6171. },
  6172. {
  6173. "clientIndex": 0,
  6174. "failWrite": {
  6175. "error": {
  6176. "code": 9
  6177. }
  6178. }
  6179. },
  6180. {
  6181. "clientIndex": 1,
  6182. "drainQueue": true,
  6183. "expectedState": {
  6184. "userCallbacks": {
  6185. "acknowledgedDocs": [
  6186. "collection/g"
  6187. ],
  6188. "rejectedDocs": [
  6189. ]
  6190. }
  6191. }
  6192. },
  6193. {
  6194. "clientIndex": 2,
  6195. "drainQueue": true,
  6196. "expectedState": {
  6197. "userCallbacks": {
  6198. "acknowledgedDocs": [
  6199. "collection/h"
  6200. ],
  6201. "rejectedDocs": [
  6202. ]
  6203. }
  6204. }
  6205. },
  6206. {
  6207. "clientIndex": 3,
  6208. "drainQueue": true,
  6209. "expectedState": {
  6210. "userCallbacks": {
  6211. "acknowledgedDocs": [
  6212. ],
  6213. "rejectedDocs": [
  6214. "collection/i"
  6215. ]
  6216. }
  6217. }
  6218. },
  6219. {
  6220. "clientIndex": 3,
  6221. "drainQueue": true
  6222. },
  6223. {
  6224. "clientIndex": 3,
  6225. "userSet": [
  6226. "collection/j",
  6227. {
  6228. "v": 1
  6229. }
  6230. ]
  6231. },
  6232. {
  6233. "clientIndex": 3,
  6234. "userSet": [
  6235. "collection/k",
  6236. {
  6237. "v": 1
  6238. }
  6239. ]
  6240. },
  6241. {
  6242. "clientIndex": 3,
  6243. "userSet": [
  6244. "collection/l",
  6245. {
  6246. "v": 1
  6247. }
  6248. ]
  6249. },
  6250. {
  6251. "clientIndex": 0,
  6252. "drainQueue": true
  6253. },
  6254. {
  6255. "clientIndex": 0,
  6256. "writeAck": {
  6257. "version": 7000
  6258. }
  6259. },
  6260. {
  6261. "clientIndex": 0,
  6262. "failWrite": {
  6263. "error": {
  6264. "code": 9
  6265. }
  6266. }
  6267. },
  6268. {
  6269. "clientIndex": 0,
  6270. "writeAck": {
  6271. "version": 8000
  6272. }
  6273. },
  6274. {
  6275. "clientIndex": 3,
  6276. "drainQueue": true,
  6277. "expectedState": {
  6278. "userCallbacks": {
  6279. "acknowledgedDocs": [
  6280. "collection/j",
  6281. "collection/l"
  6282. ],
  6283. "rejectedDocs": [
  6284. "collection/k"
  6285. ]
  6286. }
  6287. }
  6288. }
  6289. ]
  6290. },
  6291. "Write is executed after primary tab failover": {
  6292. "describeName": "Writes:",
  6293. "itName": "Write is executed after primary tab failover",
  6294. "tags": [
  6295. "multi-client"
  6296. ],
  6297. "config": {
  6298. "numClients": 2,
  6299. "useGarbageCollection": false
  6300. },
  6301. "steps": [
  6302. {
  6303. "clientIndex": 0,
  6304. "drainQueue": true
  6305. },
  6306. {
  6307. "applyClientState": {
  6308. "visibility": "visible"
  6309. },
  6310. "clientIndex": 0,
  6311. "expectedState": {
  6312. "isPrimary": true
  6313. }
  6314. },
  6315. {
  6316. "clientIndex": 1,
  6317. "drainQueue": true,
  6318. "expectedState": {
  6319. "isPrimary": false
  6320. }
  6321. },
  6322. {
  6323. "clientIndex": 1,
  6324. "userSet": [
  6325. "collection/a",
  6326. {
  6327. "v": 1
  6328. }
  6329. ]
  6330. },
  6331. {
  6332. "clientIndex": 1,
  6333. "userSet": [
  6334. "collection/b",
  6335. {
  6336. "v": 1
  6337. }
  6338. ]
  6339. },
  6340. {
  6341. "clientIndex": 0,
  6342. "drainQueue": true
  6343. },
  6344. {
  6345. "clientIndex": 0,
  6346. "writeAck": {
  6347. "version": 1000
  6348. }
  6349. },
  6350. {
  6351. "clientIndex": 0,
  6352. "shutdown": true,
  6353. "expectedState": {
  6354. "activeLimboDocs": [
  6355. ],
  6356. "activeTargets": {
  6357. },
  6358. "enqueuedLimboDocs": [
  6359. ]
  6360. }
  6361. },
  6362. {
  6363. "clientIndex": 1,
  6364. "drainQueue": true,
  6365. "expectedState": {
  6366. "userCallbacks": {
  6367. "acknowledgedDocs": [
  6368. "collection/a"
  6369. ],
  6370. "rejectedDocs": [
  6371. ]
  6372. }
  6373. }
  6374. },
  6375. {
  6376. "clientIndex": 1,
  6377. "runTimer": "client_metadata_refresh",
  6378. "expectedState": {
  6379. "isPrimary": true
  6380. }
  6381. },
  6382. {
  6383. "clientIndex": 1,
  6384. "writeAck": {
  6385. "version": 2000
  6386. },
  6387. "expectedState": {
  6388. "userCallbacks": {
  6389. "acknowledgedDocs": [
  6390. "collection/b"
  6391. ],
  6392. "rejectedDocs": [
  6393. ]
  6394. }
  6395. }
  6396. }
  6397. ]
  6398. },
  6399. "Write is sent by newly started primary": {
  6400. "describeName": "Writes:",
  6401. "itName": "Write is sent by newly started primary",
  6402. "tags": [
  6403. "multi-client"
  6404. ],
  6405. "config": {
  6406. "numClients": 3,
  6407. "useGarbageCollection": false
  6408. },
  6409. "steps": [
  6410. {
  6411. "clientIndex": 0,
  6412. "drainQueue": true,
  6413. "expectedState": {
  6414. "isPrimary": true
  6415. }
  6416. },
  6417. {
  6418. "clientIndex": 1,
  6419. "drainQueue": true,
  6420. "expectedState": {
  6421. "isPrimary": false
  6422. }
  6423. },
  6424. {
  6425. "clientIndex": 1,
  6426. "userSet": [
  6427. "collection/a",
  6428. {
  6429. "v": 1
  6430. }
  6431. ]
  6432. },
  6433. {
  6434. "clientIndex": 0,
  6435. "drainQueue": true
  6436. },
  6437. {
  6438. "clientIndex": 0,
  6439. "shutdown": true,
  6440. "expectedState": {
  6441. "activeLimboDocs": [
  6442. ],
  6443. "activeTargets": {
  6444. },
  6445. "enqueuedLimboDocs": [
  6446. ]
  6447. }
  6448. },
  6449. {
  6450. "clientIndex": 2,
  6451. "drainQueue": true,
  6452. "expectedState": {
  6453. "isPrimary": true,
  6454. "numOutstandingWrites": 1
  6455. }
  6456. },
  6457. {
  6458. "clientIndex": 2,
  6459. "writeAck": {
  6460. "version": 1000
  6461. }
  6462. },
  6463. {
  6464. "clientIndex": 1,
  6465. "drainQueue": true,
  6466. "expectedState": {
  6467. "userCallbacks": {
  6468. "acknowledgedDocs": [
  6469. "collection/a"
  6470. ],
  6471. "rejectedDocs": [
  6472. ]
  6473. }
  6474. }
  6475. }
  6476. ]
  6477. },
  6478. "Writes are held during primary failover": {
  6479. "describeName": "Writes:",
  6480. "itName": "Writes are held during primary failover",
  6481. "tags": [
  6482. "multi-client"
  6483. ],
  6484. "config": {
  6485. "numClients": 2,
  6486. "useGarbageCollection": false
  6487. },
  6488. "steps": [
  6489. {
  6490. "clientIndex": 0,
  6491. "drainQueue": true
  6492. },
  6493. {
  6494. "clientIndex": 0,
  6495. "userListen": [
  6496. 2,
  6497. {
  6498. "filters": [
  6499. ],
  6500. "orderBys": [
  6501. ],
  6502. "path": "collection"
  6503. }
  6504. ],
  6505. "expectedState": {
  6506. "activeTargets": {
  6507. "2": {
  6508. "queries": [
  6509. {
  6510. "filters": [
  6511. ],
  6512. "orderBys": [
  6513. ],
  6514. "path": "collection"
  6515. }
  6516. ],
  6517. "resumeToken": ""
  6518. }
  6519. }
  6520. }
  6521. },
  6522. {
  6523. "clientIndex": 0,
  6524. "userSet": [
  6525. "collection/doc",
  6526. {
  6527. "v": 1
  6528. }
  6529. ],
  6530. "expectedSnapshotEvents": [
  6531. {
  6532. "added": [
  6533. {
  6534. "key": "collection/doc",
  6535. "options": {
  6536. "hasCommittedMutations": false,
  6537. "hasLocalMutations": true
  6538. },
  6539. "value": {
  6540. "v": 1
  6541. },
  6542. "version": 0
  6543. }
  6544. ],
  6545. "errorCode": 0,
  6546. "fromCache": true,
  6547. "hasPendingWrites": true,
  6548. "query": {
  6549. "filters": [
  6550. ],
  6551. "orderBys": [
  6552. ],
  6553. "path": "collection"
  6554. }
  6555. }
  6556. ]
  6557. },
  6558. {
  6559. "clientIndex": 0,
  6560. "watchAck": [
  6561. 2
  6562. ]
  6563. },
  6564. {
  6565. "clientIndex": 0,
  6566. "watchEntity": {
  6567. "docs": [
  6568. ],
  6569. "targets": [
  6570. 2
  6571. ]
  6572. }
  6573. },
  6574. {
  6575. "clientIndex": 0,
  6576. "watchCurrent": [
  6577. [
  6578. 2
  6579. ],
  6580. "resume-token-1000"
  6581. ]
  6582. },
  6583. {
  6584. "clientIndex": 0,
  6585. "watchSnapshot": {
  6586. "targetIds": [
  6587. ],
  6588. "version": 1000
  6589. },
  6590. "expectedSnapshotEvents": [
  6591. {
  6592. "errorCode": 0,
  6593. "fromCache": false,
  6594. "hasPendingWrites": true,
  6595. "query": {
  6596. "filters": [
  6597. ],
  6598. "orderBys": [
  6599. ],
  6600. "path": "collection"
  6601. }
  6602. }
  6603. ]
  6604. },
  6605. {
  6606. "clientIndex": 0,
  6607. "writeAck": {
  6608. "version": 2000
  6609. },
  6610. "expectedState": {
  6611. "userCallbacks": {
  6612. "acknowledgedDocs": [
  6613. "collection/doc"
  6614. ],
  6615. "rejectedDocs": [
  6616. ]
  6617. }
  6618. }
  6619. },
  6620. {
  6621. "clientIndex": 1,
  6622. "drainQueue": true
  6623. },
  6624. {
  6625. "applyClientState": {
  6626. "primary": true
  6627. },
  6628. "clientIndex": 1,
  6629. "expectedState": {
  6630. "activeTargets": {
  6631. "2": {
  6632. "queries": [
  6633. {
  6634. "filters": [
  6635. ],
  6636. "orderBys": [
  6637. ],
  6638. "path": "collection"
  6639. }
  6640. ],
  6641. "resumeToken": "resume-token-1000"
  6642. }
  6643. },
  6644. "isPrimary": true
  6645. }
  6646. },
  6647. {
  6648. "clientIndex": 1,
  6649. "userListen": [
  6650. 4,
  6651. {
  6652. "filters": [
  6653. ],
  6654. "orderBys": [
  6655. ],
  6656. "path": "collection/doc"
  6657. }
  6658. ],
  6659. "expectedSnapshotEvents": [
  6660. {
  6661. "added": [
  6662. {
  6663. "key": "collection/doc",
  6664. "options": {
  6665. "hasCommittedMutations": true,
  6666. "hasLocalMutations": false
  6667. },
  6668. "value": {
  6669. "v": 1
  6670. },
  6671. "version": 2000
  6672. }
  6673. ],
  6674. "errorCode": 0,
  6675. "fromCache": true,
  6676. "hasPendingWrites": false,
  6677. "query": {
  6678. "filters": [
  6679. ],
  6680. "orderBys": [
  6681. ],
  6682. "path": "collection/doc"
  6683. }
  6684. }
  6685. ],
  6686. "expectedState": {
  6687. "activeTargets": {
  6688. "2": {
  6689. "queries": [
  6690. {
  6691. "filters": [
  6692. ],
  6693. "orderBys": [
  6694. ],
  6695. "path": "collection"
  6696. }
  6697. ],
  6698. "resumeToken": "resume-token-1000"
  6699. },
  6700. "4": {
  6701. "queries": [
  6702. {
  6703. "filters": [
  6704. ],
  6705. "orderBys": [
  6706. ],
  6707. "path": "collection/doc"
  6708. }
  6709. ],
  6710. "resumeToken": ""
  6711. }
  6712. }
  6713. }
  6714. },
  6715. {
  6716. "clientIndex": 1,
  6717. "watchAck": [
  6718. 2
  6719. ]
  6720. },
  6721. {
  6722. "clientIndex": 1,
  6723. "watchAck": [
  6724. 4
  6725. ]
  6726. },
  6727. {
  6728. "clientIndex": 1,
  6729. "watchEntity": {
  6730. "docs": [
  6731. {
  6732. "key": "collection/doc",
  6733. "options": {
  6734. "hasCommittedMutations": false,
  6735. "hasLocalMutations": false
  6736. },
  6737. "value": {
  6738. "v": 1
  6739. },
  6740. "version": 2000
  6741. }
  6742. ],
  6743. "targets": [
  6744. 2,
  6745. 4
  6746. ]
  6747. }
  6748. },
  6749. {
  6750. "clientIndex": 1,
  6751. "watchCurrent": [
  6752. [
  6753. 2
  6754. ],
  6755. "resume-token-2000"
  6756. ]
  6757. },
  6758. {
  6759. "clientIndex": 1,
  6760. "watchCurrent": [
  6761. [
  6762. 4
  6763. ],
  6764. "resume-token-2000"
  6765. ]
  6766. },
  6767. {
  6768. "clientIndex": 1,
  6769. "watchSnapshot": {
  6770. "targetIds": [
  6771. ],
  6772. "version": 2000
  6773. },
  6774. "expectedSnapshotEvents": [
  6775. {
  6776. "errorCode": 0,
  6777. "fromCache": false,
  6778. "hasPendingWrites": false,
  6779. "query": {
  6780. "filters": [
  6781. ],
  6782. "orderBys": [
  6783. ],
  6784. "path": "collection/doc"
  6785. }
  6786. }
  6787. ]
  6788. },
  6789. {
  6790. "clientIndex": 0,
  6791. "drainQueue": true,
  6792. "expectedState": {
  6793. "activeTargets": {
  6794. "2": {
  6795. "queries": [
  6796. {
  6797. "filters": [
  6798. ],
  6799. "orderBys": [
  6800. ],
  6801. "path": "collection"
  6802. }
  6803. ],
  6804. "resumeToken": ""
  6805. },
  6806. "4": {
  6807. "queries": [
  6808. {
  6809. "filters": [
  6810. ],
  6811. "orderBys": [
  6812. ],
  6813. "path": "collection/doc"
  6814. }
  6815. ],
  6816. "resumeToken": ""
  6817. }
  6818. }
  6819. }
  6820. },
  6821. {
  6822. "clientIndex": 0,
  6823. "runTimer": "client_metadata_refresh",
  6824. "expectedSnapshotEvents": [
  6825. {
  6826. "errorCode": 0,
  6827. "fromCache": false,
  6828. "hasPendingWrites": false,
  6829. "metadata": [
  6830. {
  6831. "key": "collection/doc",
  6832. "options": {
  6833. "hasCommittedMutations": false,
  6834. "hasLocalMutations": false
  6835. },
  6836. "value": {
  6837. "v": 1
  6838. },
  6839. "version": 2000
  6840. }
  6841. ],
  6842. "query": {
  6843. "filters": [
  6844. ],
  6845. "orderBys": [
  6846. ],
  6847. "path": "collection"
  6848. }
  6849. }
  6850. ],
  6851. "expectedState": {
  6852. "isPrimary": false
  6853. }
  6854. }
  6855. ]
  6856. },
  6857. "Writes are not re-sent after disable/enable network.": {
  6858. "describeName": "Writes:",
  6859. "itName": "Writes are not re-sent after disable/enable network.",
  6860. "tags": [
  6861. ],
  6862. "config": {
  6863. "numClients": 1,
  6864. "useGarbageCollection": true
  6865. },
  6866. "steps": [
  6867. {
  6868. "userListen": [
  6869. 2,
  6870. {
  6871. "filters": [
  6872. ],
  6873. "orderBys": [
  6874. ],
  6875. "path": "collection"
  6876. }
  6877. ],
  6878. "expectedState": {
  6879. "activeTargets": {
  6880. "2": {
  6881. "queries": [
  6882. {
  6883. "filters": [
  6884. ],
  6885. "orderBys": [
  6886. ],
  6887. "path": "collection"
  6888. }
  6889. ],
  6890. "resumeToken": ""
  6891. }
  6892. }
  6893. }
  6894. },
  6895. {
  6896. "watchAck": [
  6897. 2
  6898. ]
  6899. },
  6900. {
  6901. "watchEntity": {
  6902. "docs": [
  6903. ],
  6904. "targets": [
  6905. 2
  6906. ]
  6907. }
  6908. },
  6909. {
  6910. "watchCurrent": [
  6911. [
  6912. 2
  6913. ],
  6914. "resume-token-500"
  6915. ]
  6916. },
  6917. {
  6918. "watchSnapshot": {
  6919. "targetIds": [
  6920. ],
  6921. "version": 500
  6922. },
  6923. "expectedSnapshotEvents": [
  6924. {
  6925. "errorCode": 0,
  6926. "fromCache": false,
  6927. "hasPendingWrites": false,
  6928. "query": {
  6929. "filters": [
  6930. ],
  6931. "orderBys": [
  6932. ],
  6933. "path": "collection"
  6934. }
  6935. }
  6936. ]
  6937. },
  6938. {
  6939. "userSet": [
  6940. "collection/a",
  6941. {
  6942. "v": 1
  6943. }
  6944. ],
  6945. "expectedSnapshotEvents": [
  6946. {
  6947. "added": [
  6948. {
  6949. "key": "collection/a",
  6950. "options": {
  6951. "hasCommittedMutations": false,
  6952. "hasLocalMutations": true
  6953. },
  6954. "value": {
  6955. "v": 1
  6956. },
  6957. "version": 0
  6958. }
  6959. ],
  6960. "errorCode": 0,
  6961. "fromCache": false,
  6962. "hasPendingWrites": true,
  6963. "query": {
  6964. "filters": [
  6965. ],
  6966. "orderBys": [
  6967. ],
  6968. "path": "collection"
  6969. }
  6970. }
  6971. ]
  6972. },
  6973. {
  6974. "writeAck": {
  6975. "version": 1000
  6976. },
  6977. "expectedState": {
  6978. "userCallbacks": {
  6979. "acknowledgedDocs": [
  6980. "collection/a"
  6981. ],
  6982. "rejectedDocs": [
  6983. ]
  6984. },
  6985. "writeStreamRequestCount": 2
  6986. }
  6987. },
  6988. {
  6989. "enableNetwork": false,
  6990. "expectedSnapshotEvents": [
  6991. {
  6992. "errorCode": 0,
  6993. "fromCache": true,
  6994. "hasPendingWrites": true,
  6995. "query": {
  6996. "filters": [
  6997. ],
  6998. "orderBys": [
  6999. ],
  7000. "path": "collection"
  7001. }
  7002. }
  7003. ],
  7004. "expectedState": {
  7005. "activeLimboDocs": [
  7006. ],
  7007. "activeTargets": {
  7008. },
  7009. "enqueuedLimboDocs": [
  7010. ],
  7011. "writeStreamRequestCount": 3
  7012. }
  7013. },
  7014. {
  7015. "enableNetwork": true,
  7016. "expectedState": {
  7017. "activeTargets": {
  7018. "2": {
  7019. "queries": [
  7020. {
  7021. "filters": [
  7022. ],
  7023. "orderBys": [
  7024. ],
  7025. "path": "collection"
  7026. }
  7027. ],
  7028. "resumeToken": "resume-token-500"
  7029. }
  7030. },
  7031. "writeStreamRequestCount": 3
  7032. }
  7033. },
  7034. {
  7035. "watchAck": [
  7036. 2
  7037. ]
  7038. },
  7039. {
  7040. "watchEntity": {
  7041. "docs": [
  7042. {
  7043. "key": "collection/a",
  7044. "options": {
  7045. "hasCommittedMutations": false,
  7046. "hasLocalMutations": false
  7047. },
  7048. "value": {
  7049. "v": 1
  7050. },
  7051. "version": 1000
  7052. }
  7053. ],
  7054. "targets": [
  7055. 2
  7056. ]
  7057. }
  7058. },
  7059. {
  7060. "watchCurrent": [
  7061. [
  7062. 2
  7063. ],
  7064. "resume-token-2000"
  7065. ]
  7066. },
  7067. {
  7068. "watchSnapshot": {
  7069. "targetIds": [
  7070. ],
  7071. "version": 2000
  7072. },
  7073. "expectedSnapshotEvents": [
  7074. {
  7075. "errorCode": 0,
  7076. "fromCache": false,
  7077. "hasPendingWrites": false,
  7078. "metadata": [
  7079. {
  7080. "key": "collection/a",
  7081. "options": {
  7082. "hasCommittedMutations": false,
  7083. "hasLocalMutations": false
  7084. },
  7085. "value": {
  7086. "v": 1
  7087. },
  7088. "version": 1000
  7089. }
  7090. ],
  7091. "query": {
  7092. "filters": [
  7093. ],
  7094. "orderBys": [
  7095. ],
  7096. "path": "collection"
  7097. }
  7098. }
  7099. ]
  7100. }
  7101. ]
  7102. },
  7103. "Writes are not re-sent.": {
  7104. "describeName": "Writes:",
  7105. "itName": "Writes are not re-sent.",
  7106. "tags": [
  7107. ],
  7108. "config": {
  7109. "numClients": 1,
  7110. "useGarbageCollection": true
  7111. },
  7112. "steps": [
  7113. {
  7114. "userListen": [
  7115. 2,
  7116. {
  7117. "filters": [
  7118. ],
  7119. "orderBys": [
  7120. ],
  7121. "path": "collection"
  7122. }
  7123. ],
  7124. "expectedState": {
  7125. "activeTargets": {
  7126. "2": {
  7127. "queries": [
  7128. {
  7129. "filters": [
  7130. ],
  7131. "orderBys": [
  7132. ],
  7133. "path": "collection"
  7134. }
  7135. ],
  7136. "resumeToken": ""
  7137. }
  7138. }
  7139. }
  7140. },
  7141. {
  7142. "watchAck": [
  7143. 2
  7144. ]
  7145. },
  7146. {
  7147. "watchEntity": {
  7148. "docs": [
  7149. ],
  7150. "targets": [
  7151. 2
  7152. ]
  7153. }
  7154. },
  7155. {
  7156. "watchCurrent": [
  7157. [
  7158. 2
  7159. ],
  7160. "resume-token-500"
  7161. ]
  7162. },
  7163. {
  7164. "watchSnapshot": {
  7165. "targetIds": [
  7166. ],
  7167. "version": 500
  7168. },
  7169. "expectedSnapshotEvents": [
  7170. {
  7171. "errorCode": 0,
  7172. "fromCache": false,
  7173. "hasPendingWrites": false,
  7174. "query": {
  7175. "filters": [
  7176. ],
  7177. "orderBys": [
  7178. ],
  7179. "path": "collection"
  7180. }
  7181. }
  7182. ]
  7183. },
  7184. {
  7185. "userSet": [
  7186. "collection/a",
  7187. {
  7188. "v": 1
  7189. }
  7190. ],
  7191. "expectedSnapshotEvents": [
  7192. {
  7193. "added": [
  7194. {
  7195. "key": "collection/a",
  7196. "options": {
  7197. "hasCommittedMutations": false,
  7198. "hasLocalMutations": true
  7199. },
  7200. "value": {
  7201. "v": 1
  7202. },
  7203. "version": 0
  7204. }
  7205. ],
  7206. "errorCode": 0,
  7207. "fromCache": false,
  7208. "hasPendingWrites": true,
  7209. "query": {
  7210. "filters": [
  7211. ],
  7212. "orderBys": [
  7213. ],
  7214. "path": "collection"
  7215. }
  7216. }
  7217. ]
  7218. },
  7219. {
  7220. "writeAck": {
  7221. "version": 1000
  7222. },
  7223. "expectedState": {
  7224. "userCallbacks": {
  7225. "acknowledgedDocs": [
  7226. "collection/a"
  7227. ],
  7228. "rejectedDocs": [
  7229. ]
  7230. }
  7231. }
  7232. },
  7233. {
  7234. "userSet": [
  7235. "collection/b",
  7236. {
  7237. "v": 1
  7238. }
  7239. ],
  7240. "expectedSnapshotEvents": [
  7241. {
  7242. "added": [
  7243. {
  7244. "key": "collection/b",
  7245. "options": {
  7246. "hasCommittedMutations": false,
  7247. "hasLocalMutations": true
  7248. },
  7249. "value": {
  7250. "v": 1
  7251. },
  7252. "version": 0
  7253. }
  7254. ],
  7255. "errorCode": 0,
  7256. "fromCache": false,
  7257. "hasPendingWrites": true,
  7258. "query": {
  7259. "filters": [
  7260. ],
  7261. "orderBys": [
  7262. ],
  7263. "path": "collection"
  7264. }
  7265. }
  7266. ]
  7267. },
  7268. {
  7269. "writeAck": {
  7270. "version": 2000
  7271. },
  7272. "expectedState": {
  7273. "userCallbacks": {
  7274. "acknowledgedDocs": [
  7275. "collection/b"
  7276. ],
  7277. "rejectedDocs": [
  7278. ]
  7279. }
  7280. }
  7281. },
  7282. {
  7283. "watchEntity": {
  7284. "docs": [
  7285. {
  7286. "key": "collection/a",
  7287. "options": {
  7288. "hasCommittedMutations": false,
  7289. "hasLocalMutations": false
  7290. },
  7291. "value": {
  7292. "v": 1
  7293. },
  7294. "version": 1000
  7295. },
  7296. {
  7297. "key": "collection/b",
  7298. "options": {
  7299. "hasCommittedMutations": false,
  7300. "hasLocalMutations": false
  7301. },
  7302. "value": {
  7303. "v": 1
  7304. },
  7305. "version": 2000
  7306. }
  7307. ],
  7308. "targets": [
  7309. 2
  7310. ]
  7311. }
  7312. },
  7313. {
  7314. "watchSnapshot": {
  7315. "targetIds": [
  7316. ],
  7317. "version": 2000
  7318. },
  7319. "expectedSnapshotEvents": [
  7320. {
  7321. "errorCode": 0,
  7322. "fromCache": false,
  7323. "hasPendingWrites": false,
  7324. "metadata": [
  7325. {
  7326. "key": "collection/a",
  7327. "options": {
  7328. "hasCommittedMutations": false,
  7329. "hasLocalMutations": false
  7330. },
  7331. "value": {
  7332. "v": 1
  7333. },
  7334. "version": 1000
  7335. },
  7336. {
  7337. "key": "collection/b",
  7338. "options": {
  7339. "hasCommittedMutations": false,
  7340. "hasLocalMutations": false
  7341. },
  7342. "value": {
  7343. "v": 1
  7344. },
  7345. "version": 2000
  7346. }
  7347. ],
  7348. "query": {
  7349. "filters": [
  7350. ],
  7351. "orderBys": [
  7352. ],
  7353. "path": "collection"
  7354. }
  7355. }
  7356. ]
  7357. }
  7358. ]
  7359. },
  7360. "Writes are pipelined": {
  7361. "describeName": "Writes:",
  7362. "itName": "Writes are pipelined",
  7363. "tags": [
  7364. ],
  7365. "config": {
  7366. "numClients": 1,
  7367. "useGarbageCollection": true
  7368. },
  7369. "steps": [
  7370. {
  7371. "userListen": [
  7372. 2,
  7373. {
  7374. "filters": [
  7375. ],
  7376. "orderBys": [
  7377. ],
  7378. "path": "collection"
  7379. }
  7380. ],
  7381. "expectedState": {
  7382. "activeTargets": {
  7383. "2": {
  7384. "queries": [
  7385. {
  7386. "filters": [
  7387. ],
  7388. "orderBys": [
  7389. ],
  7390. "path": "collection"
  7391. }
  7392. ],
  7393. "resumeToken": ""
  7394. }
  7395. }
  7396. }
  7397. },
  7398. {
  7399. "watchAck": [
  7400. 2
  7401. ]
  7402. },
  7403. {
  7404. "watchCurrent": [
  7405. [
  7406. 2
  7407. ],
  7408. "resume-token"
  7409. ]
  7410. },
  7411. {
  7412. "userSet": [
  7413. "collection/a0",
  7414. {
  7415. "v": 1
  7416. }
  7417. ],
  7418. "expectedSnapshotEvents": [
  7419. {
  7420. "added": [
  7421. {
  7422. "key": "collection/a0",
  7423. "options": {
  7424. "hasCommittedMutations": false,
  7425. "hasLocalMutations": true
  7426. },
  7427. "value": {
  7428. "v": 1
  7429. },
  7430. "version": 0
  7431. }
  7432. ],
  7433. "errorCode": 0,
  7434. "fromCache": true,
  7435. "hasPendingWrites": true,
  7436. "query": {
  7437. "filters": [
  7438. ],
  7439. "orderBys": [
  7440. ],
  7441. "path": "collection"
  7442. }
  7443. }
  7444. ]
  7445. },
  7446. {
  7447. "userSet": [
  7448. "collection/a1",
  7449. {
  7450. "v": 1
  7451. }
  7452. ],
  7453. "expectedSnapshotEvents": [
  7454. {
  7455. "added": [
  7456. {
  7457. "key": "collection/a1",
  7458. "options": {
  7459. "hasCommittedMutations": false,
  7460. "hasLocalMutations": true
  7461. },
  7462. "value": {
  7463. "v": 1
  7464. },
  7465. "version": 0
  7466. }
  7467. ],
  7468. "errorCode": 0,
  7469. "fromCache": true,
  7470. "hasPendingWrites": true,
  7471. "query": {
  7472. "filters": [
  7473. ],
  7474. "orderBys": [
  7475. ],
  7476. "path": "collection"
  7477. }
  7478. }
  7479. ]
  7480. },
  7481. {
  7482. "userSet": [
  7483. "collection/a2",
  7484. {
  7485. "v": 1
  7486. }
  7487. ],
  7488. "expectedSnapshotEvents": [
  7489. {
  7490. "added": [
  7491. {
  7492. "key": "collection/a2",
  7493. "options": {
  7494. "hasCommittedMutations": false,
  7495. "hasLocalMutations": true
  7496. },
  7497. "value": {
  7498. "v": 1
  7499. },
  7500. "version": 0
  7501. }
  7502. ],
  7503. "errorCode": 0,
  7504. "fromCache": true,
  7505. "hasPendingWrites": true,
  7506. "query": {
  7507. "filters": [
  7508. ],
  7509. "orderBys": [
  7510. ],
  7511. "path": "collection"
  7512. }
  7513. }
  7514. ]
  7515. },
  7516. {
  7517. "userSet": [
  7518. "collection/a3",
  7519. {
  7520. "v": 1
  7521. }
  7522. ],
  7523. "expectedSnapshotEvents": [
  7524. {
  7525. "added": [
  7526. {
  7527. "key": "collection/a3",
  7528. "options": {
  7529. "hasCommittedMutations": false,
  7530. "hasLocalMutations": true
  7531. },
  7532. "value": {
  7533. "v": 1
  7534. },
  7535. "version": 0
  7536. }
  7537. ],
  7538. "errorCode": 0,
  7539. "fromCache": true,
  7540. "hasPendingWrites": true,
  7541. "query": {
  7542. "filters": [
  7543. ],
  7544. "orderBys": [
  7545. ],
  7546. "path": "collection"
  7547. }
  7548. }
  7549. ]
  7550. },
  7551. {
  7552. "userSet": [
  7553. "collection/a4",
  7554. {
  7555. "v": 1
  7556. }
  7557. ],
  7558. "expectedSnapshotEvents": [
  7559. {
  7560. "added": [
  7561. {
  7562. "key": "collection/a4",
  7563. "options": {
  7564. "hasCommittedMutations": false,
  7565. "hasLocalMutations": true
  7566. },
  7567. "value": {
  7568. "v": 1
  7569. },
  7570. "version": 0
  7571. }
  7572. ],
  7573. "errorCode": 0,
  7574. "fromCache": true,
  7575. "hasPendingWrites": true,
  7576. "query": {
  7577. "filters": [
  7578. ],
  7579. "orderBys": [
  7580. ],
  7581. "path": "collection"
  7582. }
  7583. }
  7584. ]
  7585. },
  7586. {
  7587. "userSet": [
  7588. "collection/a5",
  7589. {
  7590. "v": 1
  7591. }
  7592. ],
  7593. "expectedSnapshotEvents": [
  7594. {
  7595. "added": [
  7596. {
  7597. "key": "collection/a5",
  7598. "options": {
  7599. "hasCommittedMutations": false,
  7600. "hasLocalMutations": true
  7601. },
  7602. "value": {
  7603. "v": 1
  7604. },
  7605. "version": 0
  7606. }
  7607. ],
  7608. "errorCode": 0,
  7609. "fromCache": true,
  7610. "hasPendingWrites": true,
  7611. "query": {
  7612. "filters": [
  7613. ],
  7614. "orderBys": [
  7615. ],
  7616. "path": "collection"
  7617. }
  7618. }
  7619. ]
  7620. },
  7621. {
  7622. "userSet": [
  7623. "collection/a6",
  7624. {
  7625. "v": 1
  7626. }
  7627. ],
  7628. "expectedSnapshotEvents": [
  7629. {
  7630. "added": [
  7631. {
  7632. "key": "collection/a6",
  7633. "options": {
  7634. "hasCommittedMutations": false,
  7635. "hasLocalMutations": true
  7636. },
  7637. "value": {
  7638. "v": 1
  7639. },
  7640. "version": 0
  7641. }
  7642. ],
  7643. "errorCode": 0,
  7644. "fromCache": true,
  7645. "hasPendingWrites": true,
  7646. "query": {
  7647. "filters": [
  7648. ],
  7649. "orderBys": [
  7650. ],
  7651. "path": "collection"
  7652. }
  7653. }
  7654. ]
  7655. },
  7656. {
  7657. "userSet": [
  7658. "collection/a7",
  7659. {
  7660. "v": 1
  7661. }
  7662. ],
  7663. "expectedSnapshotEvents": [
  7664. {
  7665. "added": [
  7666. {
  7667. "key": "collection/a7",
  7668. "options": {
  7669. "hasCommittedMutations": false,
  7670. "hasLocalMutations": true
  7671. },
  7672. "value": {
  7673. "v": 1
  7674. },
  7675. "version": 0
  7676. }
  7677. ],
  7678. "errorCode": 0,
  7679. "fromCache": true,
  7680. "hasPendingWrites": true,
  7681. "query": {
  7682. "filters": [
  7683. ],
  7684. "orderBys": [
  7685. ],
  7686. "path": "collection"
  7687. }
  7688. }
  7689. ]
  7690. },
  7691. {
  7692. "userSet": [
  7693. "collection/a8",
  7694. {
  7695. "v": 1
  7696. }
  7697. ],
  7698. "expectedSnapshotEvents": [
  7699. {
  7700. "added": [
  7701. {
  7702. "key": "collection/a8",
  7703. "options": {
  7704. "hasCommittedMutations": false,
  7705. "hasLocalMutations": true
  7706. },
  7707. "value": {
  7708. "v": 1
  7709. },
  7710. "version": 0
  7711. }
  7712. ],
  7713. "errorCode": 0,
  7714. "fromCache": true,
  7715. "hasPendingWrites": true,
  7716. "query": {
  7717. "filters": [
  7718. ],
  7719. "orderBys": [
  7720. ],
  7721. "path": "collection"
  7722. }
  7723. }
  7724. ]
  7725. },
  7726. {
  7727. "userSet": [
  7728. "collection/a9",
  7729. {
  7730. "v": 1
  7731. }
  7732. ],
  7733. "expectedSnapshotEvents": [
  7734. {
  7735. "added": [
  7736. {
  7737. "key": "collection/a9",
  7738. "options": {
  7739. "hasCommittedMutations": false,
  7740. "hasLocalMutations": true
  7741. },
  7742. "value": {
  7743. "v": 1
  7744. },
  7745. "version": 0
  7746. }
  7747. ],
  7748. "errorCode": 0,
  7749. "fromCache": true,
  7750. "hasPendingWrites": true,
  7751. "query": {
  7752. "filters": [
  7753. ],
  7754. "orderBys": [
  7755. ],
  7756. "path": "collection"
  7757. }
  7758. }
  7759. ]
  7760. },
  7761. {
  7762. "userSet": [
  7763. "collection/a10",
  7764. {
  7765. "v": 1
  7766. }
  7767. ],
  7768. "expectedSnapshotEvents": [
  7769. {
  7770. "added": [
  7771. {
  7772. "key": "collection/a10",
  7773. "options": {
  7774. "hasCommittedMutations": false,
  7775. "hasLocalMutations": true
  7776. },
  7777. "value": {
  7778. "v": 1
  7779. },
  7780. "version": 0
  7781. }
  7782. ],
  7783. "errorCode": 0,
  7784. "fromCache": true,
  7785. "hasPendingWrites": true,
  7786. "query": {
  7787. "filters": [
  7788. ],
  7789. "orderBys": [
  7790. ],
  7791. "path": "collection"
  7792. }
  7793. }
  7794. ]
  7795. },
  7796. {
  7797. "userSet": [
  7798. "collection/a11",
  7799. {
  7800. "v": 1
  7801. }
  7802. ],
  7803. "expectedSnapshotEvents": [
  7804. {
  7805. "added": [
  7806. {
  7807. "key": "collection/a11",
  7808. "options": {
  7809. "hasCommittedMutations": false,
  7810. "hasLocalMutations": true
  7811. },
  7812. "value": {
  7813. "v": 1
  7814. },
  7815. "version": 0
  7816. }
  7817. ],
  7818. "errorCode": 0,
  7819. "fromCache": true,
  7820. "hasPendingWrites": true,
  7821. "query": {
  7822. "filters": [
  7823. ],
  7824. "orderBys": [
  7825. ],
  7826. "path": "collection"
  7827. }
  7828. }
  7829. ]
  7830. },
  7831. {
  7832. "userSet": [
  7833. "collection/a12",
  7834. {
  7835. "v": 1
  7836. }
  7837. ],
  7838. "expectedSnapshotEvents": [
  7839. {
  7840. "added": [
  7841. {
  7842. "key": "collection/a12",
  7843. "options": {
  7844. "hasCommittedMutations": false,
  7845. "hasLocalMutations": true
  7846. },
  7847. "value": {
  7848. "v": 1
  7849. },
  7850. "version": 0
  7851. }
  7852. ],
  7853. "errorCode": 0,
  7854. "fromCache": true,
  7855. "hasPendingWrites": true,
  7856. "query": {
  7857. "filters": [
  7858. ],
  7859. "orderBys": [
  7860. ],
  7861. "path": "collection"
  7862. }
  7863. }
  7864. ]
  7865. },
  7866. {
  7867. "userSet": [
  7868. "collection/a13",
  7869. {
  7870. "v": 1
  7871. }
  7872. ],
  7873. "expectedSnapshotEvents": [
  7874. {
  7875. "added": [
  7876. {
  7877. "key": "collection/a13",
  7878. "options": {
  7879. "hasCommittedMutations": false,
  7880. "hasLocalMutations": true
  7881. },
  7882. "value": {
  7883. "v": 1
  7884. },
  7885. "version": 0
  7886. }
  7887. ],
  7888. "errorCode": 0,
  7889. "fromCache": true,
  7890. "hasPendingWrites": true,
  7891. "query": {
  7892. "filters": [
  7893. ],
  7894. "orderBys": [
  7895. ],
  7896. "path": "collection"
  7897. }
  7898. }
  7899. ]
  7900. },
  7901. {
  7902. "userSet": [
  7903. "collection/a14",
  7904. {
  7905. "v": 1
  7906. }
  7907. ],
  7908. "expectedSnapshotEvents": [
  7909. {
  7910. "added": [
  7911. {
  7912. "key": "collection/a14",
  7913. "options": {
  7914. "hasCommittedMutations": false,
  7915. "hasLocalMutations": true
  7916. },
  7917. "value": {
  7918. "v": 1
  7919. },
  7920. "version": 0
  7921. }
  7922. ],
  7923. "errorCode": 0,
  7924. "fromCache": true,
  7925. "hasPendingWrites": true,
  7926. "query": {
  7927. "filters": [
  7928. ],
  7929. "orderBys": [
  7930. ],
  7931. "path": "collection"
  7932. }
  7933. }
  7934. ],
  7935. "expectedState": {
  7936. "numOutstandingWrites": 10
  7937. }
  7938. },
  7939. {
  7940. "writeAck": {
  7941. "version": 1000
  7942. },
  7943. "expectedState": {
  7944. "userCallbacks": {
  7945. "acknowledgedDocs": [
  7946. "collection/a0"
  7947. ],
  7948. "rejectedDocs": [
  7949. ]
  7950. }
  7951. }
  7952. },
  7953. {
  7954. "watchEntity": {
  7955. "docs": [
  7956. {
  7957. "key": "collection/a0",
  7958. "options": {
  7959. "hasCommittedMutations": false,
  7960. "hasLocalMutations": false
  7961. },
  7962. "value": {
  7963. "v": 1
  7964. },
  7965. "version": 1000
  7966. }
  7967. ],
  7968. "targets": [
  7969. 2
  7970. ]
  7971. }
  7972. },
  7973. {
  7974. "watchSnapshot": {
  7975. "targetIds": [
  7976. ],
  7977. "version": 1000
  7978. },
  7979. "expectedSnapshotEvents": [
  7980. {
  7981. "errorCode": 0,
  7982. "fromCache": false,
  7983. "hasPendingWrites": true,
  7984. "metadata": [
  7985. {
  7986. "key": "collection/a0",
  7987. "options": {
  7988. "hasCommittedMutations": false,
  7989. "hasLocalMutations": false
  7990. },
  7991. "value": {
  7992. "v": 1
  7993. },
  7994. "version": 1000
  7995. }
  7996. ],
  7997. "query": {
  7998. "filters": [
  7999. ],
  8000. "orderBys": [
  8001. ],
  8002. "path": "collection"
  8003. }
  8004. }
  8005. ]
  8006. },
  8007. {
  8008. "writeAck": {
  8009. "version": 2000
  8010. },
  8011. "expectedState": {
  8012. "userCallbacks": {
  8013. "acknowledgedDocs": [
  8014. "collection/a1"
  8015. ],
  8016. "rejectedDocs": [
  8017. ]
  8018. }
  8019. }
  8020. },
  8021. {
  8022. "watchEntity": {
  8023. "docs": [
  8024. {
  8025. "key": "collection/a1",
  8026. "options": {
  8027. "hasCommittedMutations": false,
  8028. "hasLocalMutations": false
  8029. },
  8030. "value": {
  8031. "v": 1
  8032. },
  8033. "version": 2000
  8034. }
  8035. ],
  8036. "targets": [
  8037. 2
  8038. ]
  8039. }
  8040. },
  8041. {
  8042. "watchSnapshot": {
  8043. "targetIds": [
  8044. ],
  8045. "version": 2000
  8046. },
  8047. "expectedSnapshotEvents": [
  8048. {
  8049. "errorCode": 0,
  8050. "fromCache": false,
  8051. "hasPendingWrites": true,
  8052. "metadata": [
  8053. {
  8054. "key": "collection/a1",
  8055. "options": {
  8056. "hasCommittedMutations": false,
  8057. "hasLocalMutations": false
  8058. },
  8059. "value": {
  8060. "v": 1
  8061. },
  8062. "version": 2000
  8063. }
  8064. ],
  8065. "query": {
  8066. "filters": [
  8067. ],
  8068. "orderBys": [
  8069. ],
  8070. "path": "collection"
  8071. }
  8072. }
  8073. ]
  8074. },
  8075. {
  8076. "writeAck": {
  8077. "version": 3000
  8078. },
  8079. "expectedState": {
  8080. "userCallbacks": {
  8081. "acknowledgedDocs": [
  8082. "collection/a2"
  8083. ],
  8084. "rejectedDocs": [
  8085. ]
  8086. }
  8087. }
  8088. },
  8089. {
  8090. "watchEntity": {
  8091. "docs": [
  8092. {
  8093. "key": "collection/a2",
  8094. "options": {
  8095. "hasCommittedMutations": false,
  8096. "hasLocalMutations": false
  8097. },
  8098. "value": {
  8099. "v": 1
  8100. },
  8101. "version": 3000
  8102. }
  8103. ],
  8104. "targets": [
  8105. 2
  8106. ]
  8107. }
  8108. },
  8109. {
  8110. "watchSnapshot": {
  8111. "targetIds": [
  8112. ],
  8113. "version": 3000
  8114. },
  8115. "expectedSnapshotEvents": [
  8116. {
  8117. "errorCode": 0,
  8118. "fromCache": false,
  8119. "hasPendingWrites": true,
  8120. "metadata": [
  8121. {
  8122. "key": "collection/a2",
  8123. "options": {
  8124. "hasCommittedMutations": false,
  8125. "hasLocalMutations": false
  8126. },
  8127. "value": {
  8128. "v": 1
  8129. },
  8130. "version": 3000
  8131. }
  8132. ],
  8133. "query": {
  8134. "filters": [
  8135. ],
  8136. "orderBys": [
  8137. ],
  8138. "path": "collection"
  8139. }
  8140. }
  8141. ]
  8142. },
  8143. {
  8144. "writeAck": {
  8145. "version": 4000
  8146. },
  8147. "expectedState": {
  8148. "userCallbacks": {
  8149. "acknowledgedDocs": [
  8150. "collection/a3"
  8151. ],
  8152. "rejectedDocs": [
  8153. ]
  8154. }
  8155. }
  8156. },
  8157. {
  8158. "watchEntity": {
  8159. "docs": [
  8160. {
  8161. "key": "collection/a3",
  8162. "options": {
  8163. "hasCommittedMutations": false,
  8164. "hasLocalMutations": false
  8165. },
  8166. "value": {
  8167. "v": 1
  8168. },
  8169. "version": 4000
  8170. }
  8171. ],
  8172. "targets": [
  8173. 2
  8174. ]
  8175. }
  8176. },
  8177. {
  8178. "watchSnapshot": {
  8179. "targetIds": [
  8180. ],
  8181. "version": 4000
  8182. },
  8183. "expectedSnapshotEvents": [
  8184. {
  8185. "errorCode": 0,
  8186. "fromCache": false,
  8187. "hasPendingWrites": true,
  8188. "metadata": [
  8189. {
  8190. "key": "collection/a3",
  8191. "options": {
  8192. "hasCommittedMutations": false,
  8193. "hasLocalMutations": false
  8194. },
  8195. "value": {
  8196. "v": 1
  8197. },
  8198. "version": 4000
  8199. }
  8200. ],
  8201. "query": {
  8202. "filters": [
  8203. ],
  8204. "orderBys": [
  8205. ],
  8206. "path": "collection"
  8207. }
  8208. }
  8209. ]
  8210. },
  8211. {
  8212. "writeAck": {
  8213. "version": 5000
  8214. },
  8215. "expectedState": {
  8216. "userCallbacks": {
  8217. "acknowledgedDocs": [
  8218. "collection/a4"
  8219. ],
  8220. "rejectedDocs": [
  8221. ]
  8222. }
  8223. }
  8224. },
  8225. {
  8226. "watchEntity": {
  8227. "docs": [
  8228. {
  8229. "key": "collection/a4",
  8230. "options": {
  8231. "hasCommittedMutations": false,
  8232. "hasLocalMutations": false
  8233. },
  8234. "value": {
  8235. "v": 1
  8236. },
  8237. "version": 5000
  8238. }
  8239. ],
  8240. "targets": [
  8241. 2
  8242. ]
  8243. }
  8244. },
  8245. {
  8246. "watchSnapshot": {
  8247. "targetIds": [
  8248. ],
  8249. "version": 5000
  8250. },
  8251. "expectedSnapshotEvents": [
  8252. {
  8253. "errorCode": 0,
  8254. "fromCache": false,
  8255. "hasPendingWrites": true,
  8256. "metadata": [
  8257. {
  8258. "key": "collection/a4",
  8259. "options": {
  8260. "hasCommittedMutations": false,
  8261. "hasLocalMutations": false
  8262. },
  8263. "value": {
  8264. "v": 1
  8265. },
  8266. "version": 5000
  8267. }
  8268. ],
  8269. "query": {
  8270. "filters": [
  8271. ],
  8272. "orderBys": [
  8273. ],
  8274. "path": "collection"
  8275. }
  8276. }
  8277. ]
  8278. },
  8279. {
  8280. "writeAck": {
  8281. "version": 6000
  8282. },
  8283. "expectedState": {
  8284. "userCallbacks": {
  8285. "acknowledgedDocs": [
  8286. "collection/a5"
  8287. ],
  8288. "rejectedDocs": [
  8289. ]
  8290. }
  8291. }
  8292. },
  8293. {
  8294. "watchEntity": {
  8295. "docs": [
  8296. {
  8297. "key": "collection/a5",
  8298. "options": {
  8299. "hasCommittedMutations": false,
  8300. "hasLocalMutations": false
  8301. },
  8302. "value": {
  8303. "v": 1
  8304. },
  8305. "version": 6000
  8306. }
  8307. ],
  8308. "targets": [
  8309. 2
  8310. ]
  8311. }
  8312. },
  8313. {
  8314. "watchSnapshot": {
  8315. "targetIds": [
  8316. ],
  8317. "version": 6000
  8318. },
  8319. "expectedSnapshotEvents": [
  8320. {
  8321. "errorCode": 0,
  8322. "fromCache": false,
  8323. "hasPendingWrites": true,
  8324. "metadata": [
  8325. {
  8326. "key": "collection/a5",
  8327. "options": {
  8328. "hasCommittedMutations": false,
  8329. "hasLocalMutations": false
  8330. },
  8331. "value": {
  8332. "v": 1
  8333. },
  8334. "version": 6000
  8335. }
  8336. ],
  8337. "query": {
  8338. "filters": [
  8339. ],
  8340. "orderBys": [
  8341. ],
  8342. "path": "collection"
  8343. }
  8344. }
  8345. ]
  8346. },
  8347. {
  8348. "writeAck": {
  8349. "version": 7000
  8350. },
  8351. "expectedState": {
  8352. "userCallbacks": {
  8353. "acknowledgedDocs": [
  8354. "collection/a6"
  8355. ],
  8356. "rejectedDocs": [
  8357. ]
  8358. }
  8359. }
  8360. },
  8361. {
  8362. "watchEntity": {
  8363. "docs": [
  8364. {
  8365. "key": "collection/a6",
  8366. "options": {
  8367. "hasCommittedMutations": false,
  8368. "hasLocalMutations": false
  8369. },
  8370. "value": {
  8371. "v": 1
  8372. },
  8373. "version": 7000
  8374. }
  8375. ],
  8376. "targets": [
  8377. 2
  8378. ]
  8379. }
  8380. },
  8381. {
  8382. "watchSnapshot": {
  8383. "targetIds": [
  8384. ],
  8385. "version": 7000
  8386. },
  8387. "expectedSnapshotEvents": [
  8388. {
  8389. "errorCode": 0,
  8390. "fromCache": false,
  8391. "hasPendingWrites": true,
  8392. "metadata": [
  8393. {
  8394. "key": "collection/a6",
  8395. "options": {
  8396. "hasCommittedMutations": false,
  8397. "hasLocalMutations": false
  8398. },
  8399. "value": {
  8400. "v": 1
  8401. },
  8402. "version": 7000
  8403. }
  8404. ],
  8405. "query": {
  8406. "filters": [
  8407. ],
  8408. "orderBys": [
  8409. ],
  8410. "path": "collection"
  8411. }
  8412. }
  8413. ]
  8414. },
  8415. {
  8416. "writeAck": {
  8417. "version": 8000
  8418. },
  8419. "expectedState": {
  8420. "userCallbacks": {
  8421. "acknowledgedDocs": [
  8422. "collection/a7"
  8423. ],
  8424. "rejectedDocs": [
  8425. ]
  8426. }
  8427. }
  8428. },
  8429. {
  8430. "watchEntity": {
  8431. "docs": [
  8432. {
  8433. "key": "collection/a7",
  8434. "options": {
  8435. "hasCommittedMutations": false,
  8436. "hasLocalMutations": false
  8437. },
  8438. "value": {
  8439. "v": 1
  8440. },
  8441. "version": 8000
  8442. }
  8443. ],
  8444. "targets": [
  8445. 2
  8446. ]
  8447. }
  8448. },
  8449. {
  8450. "watchSnapshot": {
  8451. "targetIds": [
  8452. ],
  8453. "version": 8000
  8454. },
  8455. "expectedSnapshotEvents": [
  8456. {
  8457. "errorCode": 0,
  8458. "fromCache": false,
  8459. "hasPendingWrites": true,
  8460. "metadata": [
  8461. {
  8462. "key": "collection/a7",
  8463. "options": {
  8464. "hasCommittedMutations": false,
  8465. "hasLocalMutations": false
  8466. },
  8467. "value": {
  8468. "v": 1
  8469. },
  8470. "version": 8000
  8471. }
  8472. ],
  8473. "query": {
  8474. "filters": [
  8475. ],
  8476. "orderBys": [
  8477. ],
  8478. "path": "collection"
  8479. }
  8480. }
  8481. ]
  8482. },
  8483. {
  8484. "writeAck": {
  8485. "version": 9000
  8486. },
  8487. "expectedState": {
  8488. "userCallbacks": {
  8489. "acknowledgedDocs": [
  8490. "collection/a8"
  8491. ],
  8492. "rejectedDocs": [
  8493. ]
  8494. }
  8495. }
  8496. },
  8497. {
  8498. "watchEntity": {
  8499. "docs": [
  8500. {
  8501. "key": "collection/a8",
  8502. "options": {
  8503. "hasCommittedMutations": false,
  8504. "hasLocalMutations": false
  8505. },
  8506. "value": {
  8507. "v": 1
  8508. },
  8509. "version": 9000
  8510. }
  8511. ],
  8512. "targets": [
  8513. 2
  8514. ]
  8515. }
  8516. },
  8517. {
  8518. "watchSnapshot": {
  8519. "targetIds": [
  8520. ],
  8521. "version": 9000
  8522. },
  8523. "expectedSnapshotEvents": [
  8524. {
  8525. "errorCode": 0,
  8526. "fromCache": false,
  8527. "hasPendingWrites": true,
  8528. "metadata": [
  8529. {
  8530. "key": "collection/a8",
  8531. "options": {
  8532. "hasCommittedMutations": false,
  8533. "hasLocalMutations": false
  8534. },
  8535. "value": {
  8536. "v": 1
  8537. },
  8538. "version": 9000
  8539. }
  8540. ],
  8541. "query": {
  8542. "filters": [
  8543. ],
  8544. "orderBys": [
  8545. ],
  8546. "path": "collection"
  8547. }
  8548. }
  8549. ]
  8550. },
  8551. {
  8552. "writeAck": {
  8553. "version": 10000
  8554. },
  8555. "expectedState": {
  8556. "userCallbacks": {
  8557. "acknowledgedDocs": [
  8558. "collection/a9"
  8559. ],
  8560. "rejectedDocs": [
  8561. ]
  8562. }
  8563. }
  8564. },
  8565. {
  8566. "watchEntity": {
  8567. "docs": [
  8568. {
  8569. "key": "collection/a9",
  8570. "options": {
  8571. "hasCommittedMutations": false,
  8572. "hasLocalMutations": false
  8573. },
  8574. "value": {
  8575. "v": 1
  8576. },
  8577. "version": 10000
  8578. }
  8579. ],
  8580. "targets": [
  8581. 2
  8582. ]
  8583. }
  8584. },
  8585. {
  8586. "watchSnapshot": {
  8587. "targetIds": [
  8588. ],
  8589. "version": 10000
  8590. },
  8591. "expectedSnapshotEvents": [
  8592. {
  8593. "errorCode": 0,
  8594. "fromCache": false,
  8595. "hasPendingWrites": true,
  8596. "metadata": [
  8597. {
  8598. "key": "collection/a9",
  8599. "options": {
  8600. "hasCommittedMutations": false,
  8601. "hasLocalMutations": false
  8602. },
  8603. "value": {
  8604. "v": 1
  8605. },
  8606. "version": 10000
  8607. }
  8608. ],
  8609. "query": {
  8610. "filters": [
  8611. ],
  8612. "orderBys": [
  8613. ],
  8614. "path": "collection"
  8615. }
  8616. }
  8617. ]
  8618. },
  8619. {
  8620. "writeAck": {
  8621. "version": 11000
  8622. },
  8623. "expectedState": {
  8624. "userCallbacks": {
  8625. "acknowledgedDocs": [
  8626. "collection/a10"
  8627. ],
  8628. "rejectedDocs": [
  8629. ]
  8630. }
  8631. }
  8632. },
  8633. {
  8634. "watchEntity": {
  8635. "docs": [
  8636. {
  8637. "key": "collection/a10",
  8638. "options": {
  8639. "hasCommittedMutations": false,
  8640. "hasLocalMutations": false
  8641. },
  8642. "value": {
  8643. "v": 1
  8644. },
  8645. "version": 11000
  8646. }
  8647. ],
  8648. "targets": [
  8649. 2
  8650. ]
  8651. }
  8652. },
  8653. {
  8654. "watchSnapshot": {
  8655. "targetIds": [
  8656. ],
  8657. "version": 11000
  8658. },
  8659. "expectedSnapshotEvents": [
  8660. {
  8661. "errorCode": 0,
  8662. "fromCache": false,
  8663. "hasPendingWrites": true,
  8664. "metadata": [
  8665. {
  8666. "key": "collection/a10",
  8667. "options": {
  8668. "hasCommittedMutations": false,
  8669. "hasLocalMutations": false
  8670. },
  8671. "value": {
  8672. "v": 1
  8673. },
  8674. "version": 11000
  8675. }
  8676. ],
  8677. "query": {
  8678. "filters": [
  8679. ],
  8680. "orderBys": [
  8681. ],
  8682. "path": "collection"
  8683. }
  8684. }
  8685. ]
  8686. },
  8687. {
  8688. "writeAck": {
  8689. "version": 12000
  8690. },
  8691. "expectedState": {
  8692. "userCallbacks": {
  8693. "acknowledgedDocs": [
  8694. "collection/a11"
  8695. ],
  8696. "rejectedDocs": [
  8697. ]
  8698. }
  8699. }
  8700. },
  8701. {
  8702. "watchEntity": {
  8703. "docs": [
  8704. {
  8705. "key": "collection/a11",
  8706. "options": {
  8707. "hasCommittedMutations": false,
  8708. "hasLocalMutations": false
  8709. },
  8710. "value": {
  8711. "v": 1
  8712. },
  8713. "version": 12000
  8714. }
  8715. ],
  8716. "targets": [
  8717. 2
  8718. ]
  8719. }
  8720. },
  8721. {
  8722. "watchSnapshot": {
  8723. "targetIds": [
  8724. ],
  8725. "version": 12000
  8726. },
  8727. "expectedSnapshotEvents": [
  8728. {
  8729. "errorCode": 0,
  8730. "fromCache": false,
  8731. "hasPendingWrites": true,
  8732. "metadata": [
  8733. {
  8734. "key": "collection/a11",
  8735. "options": {
  8736. "hasCommittedMutations": false,
  8737. "hasLocalMutations": false
  8738. },
  8739. "value": {
  8740. "v": 1
  8741. },
  8742. "version": 12000
  8743. }
  8744. ],
  8745. "query": {
  8746. "filters": [
  8747. ],
  8748. "orderBys": [
  8749. ],
  8750. "path": "collection"
  8751. }
  8752. }
  8753. ]
  8754. },
  8755. {
  8756. "writeAck": {
  8757. "version": 13000
  8758. },
  8759. "expectedState": {
  8760. "userCallbacks": {
  8761. "acknowledgedDocs": [
  8762. "collection/a12"
  8763. ],
  8764. "rejectedDocs": [
  8765. ]
  8766. }
  8767. }
  8768. },
  8769. {
  8770. "watchEntity": {
  8771. "docs": [
  8772. {
  8773. "key": "collection/a12",
  8774. "options": {
  8775. "hasCommittedMutations": false,
  8776. "hasLocalMutations": false
  8777. },
  8778. "value": {
  8779. "v": 1
  8780. },
  8781. "version": 13000
  8782. }
  8783. ],
  8784. "targets": [
  8785. 2
  8786. ]
  8787. }
  8788. },
  8789. {
  8790. "watchSnapshot": {
  8791. "targetIds": [
  8792. ],
  8793. "version": 13000
  8794. },
  8795. "expectedSnapshotEvents": [
  8796. {
  8797. "errorCode": 0,
  8798. "fromCache": false,
  8799. "hasPendingWrites": true,
  8800. "metadata": [
  8801. {
  8802. "key": "collection/a12",
  8803. "options": {
  8804. "hasCommittedMutations": false,
  8805. "hasLocalMutations": false
  8806. },
  8807. "value": {
  8808. "v": 1
  8809. },
  8810. "version": 13000
  8811. }
  8812. ],
  8813. "query": {
  8814. "filters": [
  8815. ],
  8816. "orderBys": [
  8817. ],
  8818. "path": "collection"
  8819. }
  8820. }
  8821. ]
  8822. },
  8823. {
  8824. "writeAck": {
  8825. "version": 14000
  8826. },
  8827. "expectedState": {
  8828. "userCallbacks": {
  8829. "acknowledgedDocs": [
  8830. "collection/a13"
  8831. ],
  8832. "rejectedDocs": [
  8833. ]
  8834. }
  8835. }
  8836. },
  8837. {
  8838. "watchEntity": {
  8839. "docs": [
  8840. {
  8841. "key": "collection/a13",
  8842. "options": {
  8843. "hasCommittedMutations": false,
  8844. "hasLocalMutations": false
  8845. },
  8846. "value": {
  8847. "v": 1
  8848. },
  8849. "version": 14000
  8850. }
  8851. ],
  8852. "targets": [
  8853. 2
  8854. ]
  8855. }
  8856. },
  8857. {
  8858. "watchSnapshot": {
  8859. "targetIds": [
  8860. ],
  8861. "version": 14000
  8862. },
  8863. "expectedSnapshotEvents": [
  8864. {
  8865. "errorCode": 0,
  8866. "fromCache": false,
  8867. "hasPendingWrites": true,
  8868. "metadata": [
  8869. {
  8870. "key": "collection/a13",
  8871. "options": {
  8872. "hasCommittedMutations": false,
  8873. "hasLocalMutations": false
  8874. },
  8875. "value": {
  8876. "v": 1
  8877. },
  8878. "version": 14000
  8879. }
  8880. ],
  8881. "query": {
  8882. "filters": [
  8883. ],
  8884. "orderBys": [
  8885. ],
  8886. "path": "collection"
  8887. }
  8888. }
  8889. ]
  8890. },
  8891. {
  8892. "writeAck": {
  8893. "version": 15000
  8894. },
  8895. "expectedState": {
  8896. "userCallbacks": {
  8897. "acknowledgedDocs": [
  8898. "collection/a14"
  8899. ],
  8900. "rejectedDocs": [
  8901. ]
  8902. }
  8903. }
  8904. },
  8905. {
  8906. "watchEntity": {
  8907. "docs": [
  8908. {
  8909. "key": "collection/a14",
  8910. "options": {
  8911. "hasCommittedMutations": false,
  8912. "hasLocalMutations": false
  8913. },
  8914. "value": {
  8915. "v": 1
  8916. },
  8917. "version": 15000
  8918. }
  8919. ],
  8920. "targets": [
  8921. 2
  8922. ]
  8923. }
  8924. },
  8925. {
  8926. "watchSnapshot": {
  8927. "targetIds": [
  8928. ],
  8929. "version": 15000
  8930. },
  8931. "expectedSnapshotEvents": [
  8932. {
  8933. "errorCode": 0,
  8934. "fromCache": false,
  8935. "hasPendingWrites": false,
  8936. "metadata": [
  8937. {
  8938. "key": "collection/a14",
  8939. "options": {
  8940. "hasCommittedMutations": false,
  8941. "hasLocalMutations": false
  8942. },
  8943. "value": {
  8944. "v": 1
  8945. },
  8946. "version": 15000
  8947. }
  8948. ],
  8949. "query": {
  8950. "filters": [
  8951. ],
  8952. "orderBys": [
  8953. ],
  8954. "path": "collection"
  8955. }
  8956. }
  8957. ]
  8958. }
  8959. ]
  8960. },
  8961. "Writes are released by primary client": {
  8962. "describeName": "Writes:",
  8963. "itName": "Writes are released by primary client",
  8964. "tags": [
  8965. "multi-client"
  8966. ],
  8967. "config": {
  8968. "numClients": 2,
  8969. "useGarbageCollection": false
  8970. },
  8971. "steps": [
  8972. {
  8973. "clientIndex": 0,
  8974. "drainQueue": true
  8975. },
  8976. {
  8977. "clientIndex": 0,
  8978. "userListen": [
  8979. 2,
  8980. {
  8981. "filters": [
  8982. ],
  8983. "orderBys": [
  8984. ],
  8985. "path": "collection"
  8986. }
  8987. ],
  8988. "expectedState": {
  8989. "activeTargets": {
  8990. "2": {
  8991. "queries": [
  8992. {
  8993. "filters": [
  8994. ],
  8995. "orderBys": [
  8996. ],
  8997. "path": "collection"
  8998. }
  8999. ],
  9000. "resumeToken": ""
  9001. }
  9002. }
  9003. }
  9004. },
  9005. {
  9006. "clientIndex": 0,
  9007. "watchAck": [
  9008. 2
  9009. ]
  9010. },
  9011. {
  9012. "clientIndex": 0,
  9013. "watchEntity": {
  9014. "docs": [
  9015. ],
  9016. "targets": [
  9017. 2
  9018. ]
  9019. }
  9020. },
  9021. {
  9022. "clientIndex": 0,
  9023. "watchCurrent": [
  9024. [
  9025. 2
  9026. ],
  9027. "resume-token-500"
  9028. ]
  9029. },
  9030. {
  9031. "clientIndex": 0,
  9032. "watchSnapshot": {
  9033. "targetIds": [
  9034. ],
  9035. "version": 500
  9036. },
  9037. "expectedSnapshotEvents": [
  9038. {
  9039. "errorCode": 0,
  9040. "fromCache": false,
  9041. "hasPendingWrites": false,
  9042. "query": {
  9043. "filters": [
  9044. ],
  9045. "orderBys": [
  9046. ],
  9047. "path": "collection"
  9048. }
  9049. }
  9050. ]
  9051. },
  9052. {
  9053. "clientIndex": 1,
  9054. "drainQueue": true
  9055. },
  9056. {
  9057. "clientIndex": 1,
  9058. "userSet": [
  9059. "collection/a",
  9060. {
  9061. "v": 1
  9062. }
  9063. ]
  9064. },
  9065. {
  9066. "clientIndex": 0,
  9067. "drainQueue": true,
  9068. "expectedSnapshotEvents": [
  9069. {
  9070. "added": [
  9071. {
  9072. "key": "collection/a",
  9073. "options": {
  9074. "hasCommittedMutations": false,
  9075. "hasLocalMutations": true
  9076. },
  9077. "value": {
  9078. "v": 1
  9079. },
  9080. "version": 0
  9081. }
  9082. ],
  9083. "errorCode": 0,
  9084. "fromCache": false,
  9085. "hasPendingWrites": true,
  9086. "query": {
  9087. "filters": [
  9088. ],
  9089. "orderBys": [
  9090. ],
  9091. "path": "collection"
  9092. }
  9093. }
  9094. ]
  9095. },
  9096. {
  9097. "clientIndex": 0,
  9098. "writeAck": {
  9099. "version": 1000
  9100. }
  9101. },
  9102. {
  9103. "clientIndex": 1,
  9104. "drainQueue": true,
  9105. "expectedState": {
  9106. "userCallbacks": {
  9107. "acknowledgedDocs": [
  9108. "collection/a"
  9109. ],
  9110. "rejectedDocs": [
  9111. ]
  9112. }
  9113. }
  9114. },
  9115. {
  9116. "clientIndex": 0,
  9117. "drainQueue": true
  9118. },
  9119. {
  9120. "clientIndex": 0,
  9121. "watchEntity": {
  9122. "docs": [
  9123. {
  9124. "key": "collection/a",
  9125. "options": {
  9126. "hasCommittedMutations": false,
  9127. "hasLocalMutations": false
  9128. },
  9129. "value": {
  9130. "v": 1
  9131. },
  9132. "version": 1000
  9133. }
  9134. ],
  9135. "targets": [
  9136. 2
  9137. ]
  9138. }
  9139. },
  9140. {
  9141. "clientIndex": 0,
  9142. "watchSnapshot": {
  9143. "targetIds": [
  9144. ],
  9145. "version": 2000
  9146. },
  9147. "expectedSnapshotEvents": [
  9148. {
  9149. "errorCode": 0,
  9150. "fromCache": false,
  9151. "hasPendingWrites": false,
  9152. "metadata": [
  9153. {
  9154. "key": "collection/a",
  9155. "options": {
  9156. "hasCommittedMutations": false,
  9157. "hasLocalMutations": false
  9158. },
  9159. "value": {
  9160. "v": 1
  9161. },
  9162. "version": 1000
  9163. }
  9164. ],
  9165. "query": {
  9166. "filters": [
  9167. ],
  9168. "orderBys": [
  9169. ],
  9170. "path": "collection"
  9171. }
  9172. }
  9173. ]
  9174. }
  9175. ]
  9176. },
  9177. "Writes are released when there are no queries left": {
  9178. "comment": "This test verifies that committed mutations are eligible for garbage collection on target removal",
  9179. "describeName": "Writes:",
  9180. "itName": "Writes are released when there are no queries left",
  9181. "tags": [
  9182. "eager-gc"
  9183. ],
  9184. "config": {
  9185. "numClients": 1,
  9186. "useGarbageCollection": true
  9187. },
  9188. "steps": [
  9189. {
  9190. "userListen": [
  9191. 2,
  9192. {
  9193. "filters": [
  9194. ],
  9195. "orderBys": [
  9196. ],
  9197. "path": "collection"
  9198. }
  9199. ],
  9200. "expectedState": {
  9201. "activeTargets": {
  9202. "2": {
  9203. "queries": [
  9204. {
  9205. "filters": [
  9206. ],
  9207. "orderBys": [
  9208. ],
  9209. "path": "collection"
  9210. }
  9211. ],
  9212. "resumeToken": ""
  9213. }
  9214. }
  9215. }
  9216. },
  9217. {
  9218. "watchAck": [
  9219. 2
  9220. ]
  9221. },
  9222. {
  9223. "watchEntity": {
  9224. "docs": [
  9225. ],
  9226. "targets": [
  9227. 2
  9228. ]
  9229. }
  9230. },
  9231. {
  9232. "watchCurrent": [
  9233. [
  9234. 2
  9235. ],
  9236. "resume-token-500"
  9237. ]
  9238. },
  9239. {
  9240. "watchSnapshot": {
  9241. "targetIds": [
  9242. ],
  9243. "version": 500
  9244. },
  9245. "expectedSnapshotEvents": [
  9246. {
  9247. "errorCode": 0,
  9248. "fromCache": false,
  9249. "hasPendingWrites": false,
  9250. "query": {
  9251. "filters": [
  9252. ],
  9253. "orderBys": [
  9254. ],
  9255. "path": "collection"
  9256. }
  9257. }
  9258. ]
  9259. },
  9260. {
  9261. "userSet": [
  9262. "collection/a",
  9263. {
  9264. "v": 1
  9265. }
  9266. ],
  9267. "expectedSnapshotEvents": [
  9268. {
  9269. "added": [
  9270. {
  9271. "key": "collection/a",
  9272. "options": {
  9273. "hasCommittedMutations": false,
  9274. "hasLocalMutations": true
  9275. },
  9276. "value": {
  9277. "v": 1
  9278. },
  9279. "version": 0
  9280. }
  9281. ],
  9282. "errorCode": 0,
  9283. "fromCache": false,
  9284. "hasPendingWrites": true,
  9285. "query": {
  9286. "filters": [
  9287. ],
  9288. "orderBys": [
  9289. ],
  9290. "path": "collection"
  9291. }
  9292. }
  9293. ]
  9294. },
  9295. {
  9296. "writeAck": {
  9297. "version": 1000
  9298. },
  9299. "expectedState": {
  9300. "userCallbacks": {
  9301. "acknowledgedDocs": [
  9302. "collection/a"
  9303. ],
  9304. "rejectedDocs": [
  9305. ]
  9306. }
  9307. }
  9308. },
  9309. {
  9310. "userUnlisten": [
  9311. 2,
  9312. {
  9313. "filters": [
  9314. ],
  9315. "orderBys": [
  9316. ],
  9317. "path": "collection"
  9318. }
  9319. ],
  9320. "expectedState": {
  9321. "activeTargets": {
  9322. }
  9323. }
  9324. },
  9325. {
  9326. "userListen": [
  9327. 4,
  9328. {
  9329. "filters": [
  9330. ],
  9331. "orderBys": [
  9332. ],
  9333. "path": "collection"
  9334. }
  9335. ],
  9336. "expectedState": {
  9337. "activeTargets": {
  9338. "4": {
  9339. "queries": [
  9340. {
  9341. "filters": [
  9342. ],
  9343. "orderBys": [
  9344. ],
  9345. "path": "collection"
  9346. }
  9347. ],
  9348. "resumeToken": ""
  9349. }
  9350. }
  9351. }
  9352. }
  9353. ]
  9354. },
  9355. "Writes are resent after network disconnect": {
  9356. "describeName": "Writes:",
  9357. "itName": "Writes are resent after network disconnect",
  9358. "tags": [
  9359. ],
  9360. "config": {
  9361. "numClients": 1,
  9362. "useGarbageCollection": true
  9363. },
  9364. "steps": [
  9365. {
  9366. "userSet": [
  9367. "collection/key",
  9368. {
  9369. "foo": "bar"
  9370. }
  9371. ],
  9372. "expectedState": {
  9373. "numOutstandingWrites": 1
  9374. }
  9375. },
  9376. {
  9377. "enableNetwork": false,
  9378. "expectedState": {
  9379. "activeLimboDocs": [
  9380. ],
  9381. "activeTargets": {
  9382. },
  9383. "enqueuedLimboDocs": [
  9384. ],
  9385. "writeStreamRequestCount": 3
  9386. }
  9387. },
  9388. {
  9389. "enableNetwork": true,
  9390. "expectedState": {
  9391. "numOutstandingWrites": 1,
  9392. "writeStreamRequestCount": 5
  9393. }
  9394. },
  9395. {
  9396. "writeAck": {
  9397. "version": 1
  9398. },
  9399. "expectedState": {
  9400. "numOutstandingWrites": 0,
  9401. "userCallbacks": {
  9402. "acknowledgedDocs": [
  9403. "collection/key"
  9404. ],
  9405. "rejectedDocs": [
  9406. ]
  9407. }
  9408. }
  9409. }
  9410. ]
  9411. },
  9412. "Writes that fail with code aborted are retried": {
  9413. "describeName": "Writes:",
  9414. "itName": "Writes that fail with code aborted are retried",
  9415. "tags": [
  9416. ],
  9417. "config": {
  9418. "numClients": 1,
  9419. "useGarbageCollection": true
  9420. },
  9421. "steps": [
  9422. {
  9423. "userListen": [
  9424. 2,
  9425. {
  9426. "filters": [
  9427. ],
  9428. "orderBys": [
  9429. ],
  9430. "path": "collection/key"
  9431. }
  9432. ],
  9433. "expectedState": {
  9434. "activeTargets": {
  9435. "2": {
  9436. "queries": [
  9437. {
  9438. "filters": [
  9439. ],
  9440. "orderBys": [
  9441. ],
  9442. "path": "collection/key"
  9443. }
  9444. ],
  9445. "resumeToken": ""
  9446. }
  9447. }
  9448. }
  9449. },
  9450. {
  9451. "userSet": [
  9452. "collection/key",
  9453. {
  9454. "foo": "bar"
  9455. }
  9456. ],
  9457. "expectedSnapshotEvents": [
  9458. {
  9459. "added": [
  9460. {
  9461. "key": "collection/key",
  9462. "options": {
  9463. "hasCommittedMutations": false,
  9464. "hasLocalMutations": true
  9465. },
  9466. "value": {
  9467. "foo": "bar"
  9468. },
  9469. "version": 0
  9470. }
  9471. ],
  9472. "errorCode": 0,
  9473. "fromCache": true,
  9474. "hasPendingWrites": true,
  9475. "query": {
  9476. "filters": [
  9477. ],
  9478. "orderBys": [
  9479. ],
  9480. "path": "collection/key"
  9481. }
  9482. }
  9483. ]
  9484. },
  9485. {
  9486. "failWrite": {
  9487. "error": {
  9488. "code": 10
  9489. },
  9490. "keepInQueue": true
  9491. }
  9492. },
  9493. {
  9494. "writeAck": {
  9495. "version": 1000
  9496. },
  9497. "expectedState": {
  9498. "userCallbacks": {
  9499. "acknowledgedDocs": [
  9500. "collection/key"
  9501. ],
  9502. "rejectedDocs": [
  9503. ]
  9504. }
  9505. }
  9506. },
  9507. {
  9508. "watchAck": [
  9509. 2
  9510. ]
  9511. },
  9512. {
  9513. "watchEntity": {
  9514. "docs": [
  9515. {
  9516. "key": "collection/key",
  9517. "options": {
  9518. "hasCommittedMutations": false,
  9519. "hasLocalMutations": false
  9520. },
  9521. "value": {
  9522. "foo": "bar"
  9523. },
  9524. "version": 1000
  9525. }
  9526. ],
  9527. "targets": [
  9528. 2
  9529. ]
  9530. }
  9531. },
  9532. {
  9533. "watchCurrent": [
  9534. [
  9535. 2
  9536. ],
  9537. "resume-token-1000"
  9538. ]
  9539. },
  9540. {
  9541. "watchSnapshot": {
  9542. "targetIds": [
  9543. ],
  9544. "version": 1000
  9545. },
  9546. "expectedSnapshotEvents": [
  9547. {
  9548. "errorCode": 0,
  9549. "fromCache": false,
  9550. "hasPendingWrites": false,
  9551. "metadata": [
  9552. {
  9553. "key": "collection/key",
  9554. "options": {
  9555. "hasCommittedMutations": false,
  9556. "hasLocalMutations": false
  9557. },
  9558. "value": {
  9559. "foo": "bar"
  9560. },
  9561. "version": 1000
  9562. }
  9563. ],
  9564. "query": {
  9565. "filters": [
  9566. ],
  9567. "orderBys": [
  9568. ],
  9569. "path": "collection/key"
  9570. }
  9571. }
  9572. ]
  9573. }
  9574. ]
  9575. },
  9576. "Writes that fail with code already-exists are rejected": {
  9577. "describeName": "Writes:",
  9578. "itName": "Writes that fail with code already-exists are rejected",
  9579. "tags": [
  9580. ],
  9581. "config": {
  9582. "numClients": 1,
  9583. "useGarbageCollection": true
  9584. },
  9585. "steps": [
  9586. {
  9587. "userListen": [
  9588. 2,
  9589. {
  9590. "filters": [
  9591. ],
  9592. "orderBys": [
  9593. ],
  9594. "path": "collection/key"
  9595. }
  9596. ],
  9597. "expectedState": {
  9598. "activeTargets": {
  9599. "2": {
  9600. "queries": [
  9601. {
  9602. "filters": [
  9603. ],
  9604. "orderBys": [
  9605. ],
  9606. "path": "collection/key"
  9607. }
  9608. ],
  9609. "resumeToken": ""
  9610. }
  9611. }
  9612. }
  9613. },
  9614. {
  9615. "userSet": [
  9616. "collection/key",
  9617. {
  9618. "foo": "bar"
  9619. }
  9620. ],
  9621. "expectedSnapshotEvents": [
  9622. {
  9623. "added": [
  9624. {
  9625. "key": "collection/key",
  9626. "options": {
  9627. "hasCommittedMutations": false,
  9628. "hasLocalMutations": true
  9629. },
  9630. "value": {
  9631. "foo": "bar"
  9632. },
  9633. "version": 0
  9634. }
  9635. ],
  9636. "errorCode": 0,
  9637. "fromCache": true,
  9638. "hasPendingWrites": true,
  9639. "query": {
  9640. "filters": [
  9641. ],
  9642. "orderBys": [
  9643. ],
  9644. "path": "collection/key"
  9645. }
  9646. }
  9647. ]
  9648. },
  9649. {
  9650. "failWrite": {
  9651. "error": {
  9652. "code": 6
  9653. }
  9654. },
  9655. "expectedSnapshotEvents": [
  9656. {
  9657. "errorCode": 0,
  9658. "fromCache": true,
  9659. "hasPendingWrites": false,
  9660. "query": {
  9661. "filters": [
  9662. ],
  9663. "orderBys": [
  9664. ],
  9665. "path": "collection/key"
  9666. },
  9667. "removed": [
  9668. {
  9669. "key": "collection/key",
  9670. "options": {
  9671. "hasCommittedMutations": false,
  9672. "hasLocalMutations": true
  9673. },
  9674. "value": {
  9675. "foo": "bar"
  9676. },
  9677. "version": 0
  9678. }
  9679. ]
  9680. }
  9681. ],
  9682. "expectedState": {
  9683. "userCallbacks": {
  9684. "acknowledgedDocs": [
  9685. ],
  9686. "rejectedDocs": [
  9687. "collection/key"
  9688. ]
  9689. }
  9690. }
  9691. }
  9692. ]
  9693. },
  9694. "Writes that fail with code cancelled are retried": {
  9695. "describeName": "Writes:",
  9696. "itName": "Writes that fail with code cancelled are retried",
  9697. "tags": [
  9698. ],
  9699. "config": {
  9700. "numClients": 1,
  9701. "useGarbageCollection": true
  9702. },
  9703. "steps": [
  9704. {
  9705. "userListen": [
  9706. 2,
  9707. {
  9708. "filters": [
  9709. ],
  9710. "orderBys": [
  9711. ],
  9712. "path": "collection/key"
  9713. }
  9714. ],
  9715. "expectedState": {
  9716. "activeTargets": {
  9717. "2": {
  9718. "queries": [
  9719. {
  9720. "filters": [
  9721. ],
  9722. "orderBys": [
  9723. ],
  9724. "path": "collection/key"
  9725. }
  9726. ],
  9727. "resumeToken": ""
  9728. }
  9729. }
  9730. }
  9731. },
  9732. {
  9733. "userSet": [
  9734. "collection/key",
  9735. {
  9736. "foo": "bar"
  9737. }
  9738. ],
  9739. "expectedSnapshotEvents": [
  9740. {
  9741. "added": [
  9742. {
  9743. "key": "collection/key",
  9744. "options": {
  9745. "hasCommittedMutations": false,
  9746. "hasLocalMutations": true
  9747. },
  9748. "value": {
  9749. "foo": "bar"
  9750. },
  9751. "version": 0
  9752. }
  9753. ],
  9754. "errorCode": 0,
  9755. "fromCache": true,
  9756. "hasPendingWrites": true,
  9757. "query": {
  9758. "filters": [
  9759. ],
  9760. "orderBys": [
  9761. ],
  9762. "path": "collection/key"
  9763. }
  9764. }
  9765. ]
  9766. },
  9767. {
  9768. "failWrite": {
  9769. "error": {
  9770. "code": 1
  9771. },
  9772. "keepInQueue": true
  9773. }
  9774. },
  9775. {
  9776. "writeAck": {
  9777. "version": 1000
  9778. },
  9779. "expectedState": {
  9780. "userCallbacks": {
  9781. "acknowledgedDocs": [
  9782. "collection/key"
  9783. ],
  9784. "rejectedDocs": [
  9785. ]
  9786. }
  9787. }
  9788. },
  9789. {
  9790. "watchAck": [
  9791. 2
  9792. ]
  9793. },
  9794. {
  9795. "watchEntity": {
  9796. "docs": [
  9797. {
  9798. "key": "collection/key",
  9799. "options": {
  9800. "hasCommittedMutations": false,
  9801. "hasLocalMutations": false
  9802. },
  9803. "value": {
  9804. "foo": "bar"
  9805. },
  9806. "version": 1000
  9807. }
  9808. ],
  9809. "targets": [
  9810. 2
  9811. ]
  9812. }
  9813. },
  9814. {
  9815. "watchCurrent": [
  9816. [
  9817. 2
  9818. ],
  9819. "resume-token-1000"
  9820. ]
  9821. },
  9822. {
  9823. "watchSnapshot": {
  9824. "targetIds": [
  9825. ],
  9826. "version": 1000
  9827. },
  9828. "expectedSnapshotEvents": [
  9829. {
  9830. "errorCode": 0,
  9831. "fromCache": false,
  9832. "hasPendingWrites": false,
  9833. "metadata": [
  9834. {
  9835. "key": "collection/key",
  9836. "options": {
  9837. "hasCommittedMutations": false,
  9838. "hasLocalMutations": false
  9839. },
  9840. "value": {
  9841. "foo": "bar"
  9842. },
  9843. "version": 1000
  9844. }
  9845. ],
  9846. "query": {
  9847. "filters": [
  9848. ],
  9849. "orderBys": [
  9850. ],
  9851. "path": "collection/key"
  9852. }
  9853. }
  9854. ]
  9855. }
  9856. ]
  9857. },
  9858. "Writes that fail with code data-loss are rejected": {
  9859. "describeName": "Writes:",
  9860. "itName": "Writes that fail with code data-loss are rejected",
  9861. "tags": [
  9862. ],
  9863. "config": {
  9864. "numClients": 1,
  9865. "useGarbageCollection": true
  9866. },
  9867. "steps": [
  9868. {
  9869. "userListen": [
  9870. 2,
  9871. {
  9872. "filters": [
  9873. ],
  9874. "orderBys": [
  9875. ],
  9876. "path": "collection/key"
  9877. }
  9878. ],
  9879. "expectedState": {
  9880. "activeTargets": {
  9881. "2": {
  9882. "queries": [
  9883. {
  9884. "filters": [
  9885. ],
  9886. "orderBys": [
  9887. ],
  9888. "path": "collection/key"
  9889. }
  9890. ],
  9891. "resumeToken": ""
  9892. }
  9893. }
  9894. }
  9895. },
  9896. {
  9897. "userSet": [
  9898. "collection/key",
  9899. {
  9900. "foo": "bar"
  9901. }
  9902. ],
  9903. "expectedSnapshotEvents": [
  9904. {
  9905. "added": [
  9906. {
  9907. "key": "collection/key",
  9908. "options": {
  9909. "hasCommittedMutations": false,
  9910. "hasLocalMutations": true
  9911. },
  9912. "value": {
  9913. "foo": "bar"
  9914. },
  9915. "version": 0
  9916. }
  9917. ],
  9918. "errorCode": 0,
  9919. "fromCache": true,
  9920. "hasPendingWrites": true,
  9921. "query": {
  9922. "filters": [
  9923. ],
  9924. "orderBys": [
  9925. ],
  9926. "path": "collection/key"
  9927. }
  9928. }
  9929. ]
  9930. },
  9931. {
  9932. "failWrite": {
  9933. "error": {
  9934. "code": 15
  9935. }
  9936. },
  9937. "expectedSnapshotEvents": [
  9938. {
  9939. "errorCode": 0,
  9940. "fromCache": true,
  9941. "hasPendingWrites": false,
  9942. "query": {
  9943. "filters": [
  9944. ],
  9945. "orderBys": [
  9946. ],
  9947. "path": "collection/key"
  9948. },
  9949. "removed": [
  9950. {
  9951. "key": "collection/key",
  9952. "options": {
  9953. "hasCommittedMutations": false,
  9954. "hasLocalMutations": true
  9955. },
  9956. "value": {
  9957. "foo": "bar"
  9958. },
  9959. "version": 0
  9960. }
  9961. ]
  9962. }
  9963. ],
  9964. "expectedState": {
  9965. "userCallbacks": {
  9966. "acknowledgedDocs": [
  9967. ],
  9968. "rejectedDocs": [
  9969. "collection/key"
  9970. ]
  9971. }
  9972. }
  9973. }
  9974. ]
  9975. },
  9976. "Writes that fail with code deadline-exceeded are retried": {
  9977. "describeName": "Writes:",
  9978. "itName": "Writes that fail with code deadline-exceeded are retried",
  9979. "tags": [
  9980. ],
  9981. "config": {
  9982. "numClients": 1,
  9983. "useGarbageCollection": true
  9984. },
  9985. "steps": [
  9986. {
  9987. "userListen": [
  9988. 2,
  9989. {
  9990. "filters": [
  9991. ],
  9992. "orderBys": [
  9993. ],
  9994. "path": "collection/key"
  9995. }
  9996. ],
  9997. "expectedState": {
  9998. "activeTargets": {
  9999. "2": {
  10000. "queries": [
  10001. {
  10002. "filters": [
  10003. ],
  10004. "orderBys": [
  10005. ],
  10006. "path": "collection/key"
  10007. }
  10008. ],
  10009. "resumeToken": ""
  10010. }
  10011. }
  10012. }
  10013. },
  10014. {
  10015. "userSet": [
  10016. "collection/key",
  10017. {
  10018. "foo": "bar"
  10019. }
  10020. ],
  10021. "expectedSnapshotEvents": [
  10022. {
  10023. "added": [
  10024. {
  10025. "key": "collection/key",
  10026. "options": {
  10027. "hasCommittedMutations": false,
  10028. "hasLocalMutations": true
  10029. },
  10030. "value": {
  10031. "foo": "bar"
  10032. },
  10033. "version": 0
  10034. }
  10035. ],
  10036. "errorCode": 0,
  10037. "fromCache": true,
  10038. "hasPendingWrites": true,
  10039. "query": {
  10040. "filters": [
  10041. ],
  10042. "orderBys": [
  10043. ],
  10044. "path": "collection/key"
  10045. }
  10046. }
  10047. ]
  10048. },
  10049. {
  10050. "failWrite": {
  10051. "error": {
  10052. "code": 4
  10053. },
  10054. "keepInQueue": true
  10055. }
  10056. },
  10057. {
  10058. "writeAck": {
  10059. "version": 1000
  10060. },
  10061. "expectedState": {
  10062. "userCallbacks": {
  10063. "acknowledgedDocs": [
  10064. "collection/key"
  10065. ],
  10066. "rejectedDocs": [
  10067. ]
  10068. }
  10069. }
  10070. },
  10071. {
  10072. "watchAck": [
  10073. 2
  10074. ]
  10075. },
  10076. {
  10077. "watchEntity": {
  10078. "docs": [
  10079. {
  10080. "key": "collection/key",
  10081. "options": {
  10082. "hasCommittedMutations": false,
  10083. "hasLocalMutations": false
  10084. },
  10085. "value": {
  10086. "foo": "bar"
  10087. },
  10088. "version": 1000
  10089. }
  10090. ],
  10091. "targets": [
  10092. 2
  10093. ]
  10094. }
  10095. },
  10096. {
  10097. "watchCurrent": [
  10098. [
  10099. 2
  10100. ],
  10101. "resume-token-1000"
  10102. ]
  10103. },
  10104. {
  10105. "watchSnapshot": {
  10106. "targetIds": [
  10107. ],
  10108. "version": 1000
  10109. },
  10110. "expectedSnapshotEvents": [
  10111. {
  10112. "errorCode": 0,
  10113. "fromCache": false,
  10114. "hasPendingWrites": false,
  10115. "metadata": [
  10116. {
  10117. "key": "collection/key",
  10118. "options": {
  10119. "hasCommittedMutations": false,
  10120. "hasLocalMutations": false
  10121. },
  10122. "value": {
  10123. "foo": "bar"
  10124. },
  10125. "version": 1000
  10126. }
  10127. ],
  10128. "query": {
  10129. "filters": [
  10130. ],
  10131. "orderBys": [
  10132. ],
  10133. "path": "collection/key"
  10134. }
  10135. }
  10136. ]
  10137. }
  10138. ]
  10139. },
  10140. "Writes that fail with code failed-precondition are rejected": {
  10141. "describeName": "Writes:",
  10142. "itName": "Writes that fail with code failed-precondition are rejected",
  10143. "tags": [
  10144. ],
  10145. "config": {
  10146. "numClients": 1,
  10147. "useGarbageCollection": true
  10148. },
  10149. "steps": [
  10150. {
  10151. "userListen": [
  10152. 2,
  10153. {
  10154. "filters": [
  10155. ],
  10156. "orderBys": [
  10157. ],
  10158. "path": "collection/key"
  10159. }
  10160. ],
  10161. "expectedState": {
  10162. "activeTargets": {
  10163. "2": {
  10164. "queries": [
  10165. {
  10166. "filters": [
  10167. ],
  10168. "orderBys": [
  10169. ],
  10170. "path": "collection/key"
  10171. }
  10172. ],
  10173. "resumeToken": ""
  10174. }
  10175. }
  10176. }
  10177. },
  10178. {
  10179. "userSet": [
  10180. "collection/key",
  10181. {
  10182. "foo": "bar"
  10183. }
  10184. ],
  10185. "expectedSnapshotEvents": [
  10186. {
  10187. "added": [
  10188. {
  10189. "key": "collection/key",
  10190. "options": {
  10191. "hasCommittedMutations": false,
  10192. "hasLocalMutations": true
  10193. },
  10194. "value": {
  10195. "foo": "bar"
  10196. },
  10197. "version": 0
  10198. }
  10199. ],
  10200. "errorCode": 0,
  10201. "fromCache": true,
  10202. "hasPendingWrites": true,
  10203. "query": {
  10204. "filters": [
  10205. ],
  10206. "orderBys": [
  10207. ],
  10208. "path": "collection/key"
  10209. }
  10210. }
  10211. ]
  10212. },
  10213. {
  10214. "failWrite": {
  10215. "error": {
  10216. "code": 9
  10217. }
  10218. },
  10219. "expectedSnapshotEvents": [
  10220. {
  10221. "errorCode": 0,
  10222. "fromCache": true,
  10223. "hasPendingWrites": false,
  10224. "query": {
  10225. "filters": [
  10226. ],
  10227. "orderBys": [
  10228. ],
  10229. "path": "collection/key"
  10230. },
  10231. "removed": [
  10232. {
  10233. "key": "collection/key",
  10234. "options": {
  10235. "hasCommittedMutations": false,
  10236. "hasLocalMutations": true
  10237. },
  10238. "value": {
  10239. "foo": "bar"
  10240. },
  10241. "version": 0
  10242. }
  10243. ]
  10244. }
  10245. ],
  10246. "expectedState": {
  10247. "userCallbacks": {
  10248. "acknowledgedDocs": [
  10249. ],
  10250. "rejectedDocs": [
  10251. "collection/key"
  10252. ]
  10253. }
  10254. }
  10255. }
  10256. ]
  10257. },
  10258. "Writes that fail with code internal are retried": {
  10259. "describeName": "Writes:",
  10260. "itName": "Writes that fail with code internal are retried",
  10261. "tags": [
  10262. ],
  10263. "config": {
  10264. "numClients": 1,
  10265. "useGarbageCollection": true
  10266. },
  10267. "steps": [
  10268. {
  10269. "userListen": [
  10270. 2,
  10271. {
  10272. "filters": [
  10273. ],
  10274. "orderBys": [
  10275. ],
  10276. "path": "collection/key"
  10277. }
  10278. ],
  10279. "expectedState": {
  10280. "activeTargets": {
  10281. "2": {
  10282. "queries": [
  10283. {
  10284. "filters": [
  10285. ],
  10286. "orderBys": [
  10287. ],
  10288. "path": "collection/key"
  10289. }
  10290. ],
  10291. "resumeToken": ""
  10292. }
  10293. }
  10294. }
  10295. },
  10296. {
  10297. "userSet": [
  10298. "collection/key",
  10299. {
  10300. "foo": "bar"
  10301. }
  10302. ],
  10303. "expectedSnapshotEvents": [
  10304. {
  10305. "added": [
  10306. {
  10307. "key": "collection/key",
  10308. "options": {
  10309. "hasCommittedMutations": false,
  10310. "hasLocalMutations": true
  10311. },
  10312. "value": {
  10313. "foo": "bar"
  10314. },
  10315. "version": 0
  10316. }
  10317. ],
  10318. "errorCode": 0,
  10319. "fromCache": true,
  10320. "hasPendingWrites": true,
  10321. "query": {
  10322. "filters": [
  10323. ],
  10324. "orderBys": [
  10325. ],
  10326. "path": "collection/key"
  10327. }
  10328. }
  10329. ]
  10330. },
  10331. {
  10332. "failWrite": {
  10333. "error": {
  10334. "code": 13
  10335. },
  10336. "keepInQueue": true
  10337. }
  10338. },
  10339. {
  10340. "writeAck": {
  10341. "version": 1000
  10342. },
  10343. "expectedState": {
  10344. "userCallbacks": {
  10345. "acknowledgedDocs": [
  10346. "collection/key"
  10347. ],
  10348. "rejectedDocs": [
  10349. ]
  10350. }
  10351. }
  10352. },
  10353. {
  10354. "watchAck": [
  10355. 2
  10356. ]
  10357. },
  10358. {
  10359. "watchEntity": {
  10360. "docs": [
  10361. {
  10362. "key": "collection/key",
  10363. "options": {
  10364. "hasCommittedMutations": false,
  10365. "hasLocalMutations": false
  10366. },
  10367. "value": {
  10368. "foo": "bar"
  10369. },
  10370. "version": 1000
  10371. }
  10372. ],
  10373. "targets": [
  10374. 2
  10375. ]
  10376. }
  10377. },
  10378. {
  10379. "watchCurrent": [
  10380. [
  10381. 2
  10382. ],
  10383. "resume-token-1000"
  10384. ]
  10385. },
  10386. {
  10387. "watchSnapshot": {
  10388. "targetIds": [
  10389. ],
  10390. "version": 1000
  10391. },
  10392. "expectedSnapshotEvents": [
  10393. {
  10394. "errorCode": 0,
  10395. "fromCache": false,
  10396. "hasPendingWrites": false,
  10397. "metadata": [
  10398. {
  10399. "key": "collection/key",
  10400. "options": {
  10401. "hasCommittedMutations": false,
  10402. "hasLocalMutations": false
  10403. },
  10404. "value": {
  10405. "foo": "bar"
  10406. },
  10407. "version": 1000
  10408. }
  10409. ],
  10410. "query": {
  10411. "filters": [
  10412. ],
  10413. "orderBys": [
  10414. ],
  10415. "path": "collection/key"
  10416. }
  10417. }
  10418. ]
  10419. }
  10420. ]
  10421. },
  10422. "Writes that fail with code invalid-argument are rejected": {
  10423. "describeName": "Writes:",
  10424. "itName": "Writes that fail with code invalid-argument are rejected",
  10425. "tags": [
  10426. ],
  10427. "config": {
  10428. "numClients": 1,
  10429. "useGarbageCollection": true
  10430. },
  10431. "steps": [
  10432. {
  10433. "userListen": [
  10434. 2,
  10435. {
  10436. "filters": [
  10437. ],
  10438. "orderBys": [
  10439. ],
  10440. "path": "collection/key"
  10441. }
  10442. ],
  10443. "expectedState": {
  10444. "activeTargets": {
  10445. "2": {
  10446. "queries": [
  10447. {
  10448. "filters": [
  10449. ],
  10450. "orderBys": [
  10451. ],
  10452. "path": "collection/key"
  10453. }
  10454. ],
  10455. "resumeToken": ""
  10456. }
  10457. }
  10458. }
  10459. },
  10460. {
  10461. "userSet": [
  10462. "collection/key",
  10463. {
  10464. "foo": "bar"
  10465. }
  10466. ],
  10467. "expectedSnapshotEvents": [
  10468. {
  10469. "added": [
  10470. {
  10471. "key": "collection/key",
  10472. "options": {
  10473. "hasCommittedMutations": false,
  10474. "hasLocalMutations": true
  10475. },
  10476. "value": {
  10477. "foo": "bar"
  10478. },
  10479. "version": 0
  10480. }
  10481. ],
  10482. "errorCode": 0,
  10483. "fromCache": true,
  10484. "hasPendingWrites": true,
  10485. "query": {
  10486. "filters": [
  10487. ],
  10488. "orderBys": [
  10489. ],
  10490. "path": "collection/key"
  10491. }
  10492. }
  10493. ]
  10494. },
  10495. {
  10496. "failWrite": {
  10497. "error": {
  10498. "code": 3
  10499. }
  10500. },
  10501. "expectedSnapshotEvents": [
  10502. {
  10503. "errorCode": 0,
  10504. "fromCache": true,
  10505. "hasPendingWrites": false,
  10506. "query": {
  10507. "filters": [
  10508. ],
  10509. "orderBys": [
  10510. ],
  10511. "path": "collection/key"
  10512. },
  10513. "removed": [
  10514. {
  10515. "key": "collection/key",
  10516. "options": {
  10517. "hasCommittedMutations": false,
  10518. "hasLocalMutations": true
  10519. },
  10520. "value": {
  10521. "foo": "bar"
  10522. },
  10523. "version": 0
  10524. }
  10525. ]
  10526. }
  10527. ],
  10528. "expectedState": {
  10529. "userCallbacks": {
  10530. "acknowledgedDocs": [
  10531. ],
  10532. "rejectedDocs": [
  10533. "collection/key"
  10534. ]
  10535. }
  10536. }
  10537. }
  10538. ]
  10539. },
  10540. "Writes that fail with code not-found are rejected": {
  10541. "describeName": "Writes:",
  10542. "itName": "Writes that fail with code not-found are rejected",
  10543. "tags": [
  10544. ],
  10545. "config": {
  10546. "numClients": 1,
  10547. "useGarbageCollection": true
  10548. },
  10549. "steps": [
  10550. {
  10551. "userListen": [
  10552. 2,
  10553. {
  10554. "filters": [
  10555. ],
  10556. "orderBys": [
  10557. ],
  10558. "path": "collection/key"
  10559. }
  10560. ],
  10561. "expectedState": {
  10562. "activeTargets": {
  10563. "2": {
  10564. "queries": [
  10565. {
  10566. "filters": [
  10567. ],
  10568. "orderBys": [
  10569. ],
  10570. "path": "collection/key"
  10571. }
  10572. ],
  10573. "resumeToken": ""
  10574. }
  10575. }
  10576. }
  10577. },
  10578. {
  10579. "userSet": [
  10580. "collection/key",
  10581. {
  10582. "foo": "bar"
  10583. }
  10584. ],
  10585. "expectedSnapshotEvents": [
  10586. {
  10587. "added": [
  10588. {
  10589. "key": "collection/key",
  10590. "options": {
  10591. "hasCommittedMutations": false,
  10592. "hasLocalMutations": true
  10593. },
  10594. "value": {
  10595. "foo": "bar"
  10596. },
  10597. "version": 0
  10598. }
  10599. ],
  10600. "errorCode": 0,
  10601. "fromCache": true,
  10602. "hasPendingWrites": true,
  10603. "query": {
  10604. "filters": [
  10605. ],
  10606. "orderBys": [
  10607. ],
  10608. "path": "collection/key"
  10609. }
  10610. }
  10611. ]
  10612. },
  10613. {
  10614. "failWrite": {
  10615. "error": {
  10616. "code": 5
  10617. }
  10618. },
  10619. "expectedSnapshotEvents": [
  10620. {
  10621. "errorCode": 0,
  10622. "fromCache": true,
  10623. "hasPendingWrites": false,
  10624. "query": {
  10625. "filters": [
  10626. ],
  10627. "orderBys": [
  10628. ],
  10629. "path": "collection/key"
  10630. },
  10631. "removed": [
  10632. {
  10633. "key": "collection/key",
  10634. "options": {
  10635. "hasCommittedMutations": false,
  10636. "hasLocalMutations": true
  10637. },
  10638. "value": {
  10639. "foo": "bar"
  10640. },
  10641. "version": 0
  10642. }
  10643. ]
  10644. }
  10645. ],
  10646. "expectedState": {
  10647. "userCallbacks": {
  10648. "acknowledgedDocs": [
  10649. ],
  10650. "rejectedDocs": [
  10651. "collection/key"
  10652. ]
  10653. }
  10654. }
  10655. }
  10656. ]
  10657. },
  10658. "Writes that fail with code out-of-range are rejected": {
  10659. "describeName": "Writes:",
  10660. "itName": "Writes that fail with code out-of-range are rejected",
  10661. "tags": [
  10662. ],
  10663. "config": {
  10664. "numClients": 1,
  10665. "useGarbageCollection": true
  10666. },
  10667. "steps": [
  10668. {
  10669. "userListen": [
  10670. 2,
  10671. {
  10672. "filters": [
  10673. ],
  10674. "orderBys": [
  10675. ],
  10676. "path": "collection/key"
  10677. }
  10678. ],
  10679. "expectedState": {
  10680. "activeTargets": {
  10681. "2": {
  10682. "queries": [
  10683. {
  10684. "filters": [
  10685. ],
  10686. "orderBys": [
  10687. ],
  10688. "path": "collection/key"
  10689. }
  10690. ],
  10691. "resumeToken": ""
  10692. }
  10693. }
  10694. }
  10695. },
  10696. {
  10697. "userSet": [
  10698. "collection/key",
  10699. {
  10700. "foo": "bar"
  10701. }
  10702. ],
  10703. "expectedSnapshotEvents": [
  10704. {
  10705. "added": [
  10706. {
  10707. "key": "collection/key",
  10708. "options": {
  10709. "hasCommittedMutations": false,
  10710. "hasLocalMutations": true
  10711. },
  10712. "value": {
  10713. "foo": "bar"
  10714. },
  10715. "version": 0
  10716. }
  10717. ],
  10718. "errorCode": 0,
  10719. "fromCache": true,
  10720. "hasPendingWrites": true,
  10721. "query": {
  10722. "filters": [
  10723. ],
  10724. "orderBys": [
  10725. ],
  10726. "path": "collection/key"
  10727. }
  10728. }
  10729. ]
  10730. },
  10731. {
  10732. "failWrite": {
  10733. "error": {
  10734. "code": 11
  10735. }
  10736. },
  10737. "expectedSnapshotEvents": [
  10738. {
  10739. "errorCode": 0,
  10740. "fromCache": true,
  10741. "hasPendingWrites": false,
  10742. "query": {
  10743. "filters": [
  10744. ],
  10745. "orderBys": [
  10746. ],
  10747. "path": "collection/key"
  10748. },
  10749. "removed": [
  10750. {
  10751. "key": "collection/key",
  10752. "options": {
  10753. "hasCommittedMutations": false,
  10754. "hasLocalMutations": true
  10755. },
  10756. "value": {
  10757. "foo": "bar"
  10758. },
  10759. "version": 0
  10760. }
  10761. ]
  10762. }
  10763. ],
  10764. "expectedState": {
  10765. "userCallbacks": {
  10766. "acknowledgedDocs": [
  10767. ],
  10768. "rejectedDocs": [
  10769. "collection/key"
  10770. ]
  10771. }
  10772. }
  10773. }
  10774. ]
  10775. },
  10776. "Writes that fail with code permission-denied are rejected": {
  10777. "describeName": "Writes:",
  10778. "itName": "Writes that fail with code permission-denied are rejected",
  10779. "tags": [
  10780. ],
  10781. "config": {
  10782. "numClients": 1,
  10783. "useGarbageCollection": true
  10784. },
  10785. "steps": [
  10786. {
  10787. "userListen": [
  10788. 2,
  10789. {
  10790. "filters": [
  10791. ],
  10792. "orderBys": [
  10793. ],
  10794. "path": "collection/key"
  10795. }
  10796. ],
  10797. "expectedState": {
  10798. "activeTargets": {
  10799. "2": {
  10800. "queries": [
  10801. {
  10802. "filters": [
  10803. ],
  10804. "orderBys": [
  10805. ],
  10806. "path": "collection/key"
  10807. }
  10808. ],
  10809. "resumeToken": ""
  10810. }
  10811. }
  10812. }
  10813. },
  10814. {
  10815. "userSet": [
  10816. "collection/key",
  10817. {
  10818. "foo": "bar"
  10819. }
  10820. ],
  10821. "expectedSnapshotEvents": [
  10822. {
  10823. "added": [
  10824. {
  10825. "key": "collection/key",
  10826. "options": {
  10827. "hasCommittedMutations": false,
  10828. "hasLocalMutations": true
  10829. },
  10830. "value": {
  10831. "foo": "bar"
  10832. },
  10833. "version": 0
  10834. }
  10835. ],
  10836. "errorCode": 0,
  10837. "fromCache": true,
  10838. "hasPendingWrites": true,
  10839. "query": {
  10840. "filters": [
  10841. ],
  10842. "orderBys": [
  10843. ],
  10844. "path": "collection/key"
  10845. }
  10846. }
  10847. ]
  10848. },
  10849. {
  10850. "failWrite": {
  10851. "error": {
  10852. "code": 7
  10853. }
  10854. },
  10855. "expectedSnapshotEvents": [
  10856. {
  10857. "errorCode": 0,
  10858. "fromCache": true,
  10859. "hasPendingWrites": false,
  10860. "query": {
  10861. "filters": [
  10862. ],
  10863. "orderBys": [
  10864. ],
  10865. "path": "collection/key"
  10866. },
  10867. "removed": [
  10868. {
  10869. "key": "collection/key",
  10870. "options": {
  10871. "hasCommittedMutations": false,
  10872. "hasLocalMutations": true
  10873. },
  10874. "value": {
  10875. "foo": "bar"
  10876. },
  10877. "version": 0
  10878. }
  10879. ]
  10880. }
  10881. ],
  10882. "expectedState": {
  10883. "userCallbacks": {
  10884. "acknowledgedDocs": [
  10885. ],
  10886. "rejectedDocs": [
  10887. "collection/key"
  10888. ]
  10889. }
  10890. }
  10891. }
  10892. ]
  10893. },
  10894. "Writes that fail with code resource_exhausted are not rejected": {
  10895. "describeName": "Writes:",
  10896. "itName": "Writes that fail with code resource_exhausted are not rejected",
  10897. "tags": [
  10898. ],
  10899. "config": {
  10900. "numClients": 1,
  10901. "useGarbageCollection": true
  10902. },
  10903. "steps": [
  10904. {
  10905. "userListen": [
  10906. 2,
  10907. {
  10908. "filters": [
  10909. ],
  10910. "orderBys": [
  10911. ],
  10912. "path": "collection/key"
  10913. }
  10914. ],
  10915. "expectedState": {
  10916. "activeTargets": {
  10917. "2": {
  10918. "queries": [
  10919. {
  10920. "filters": [
  10921. ],
  10922. "orderBys": [
  10923. ],
  10924. "path": "collection/key"
  10925. }
  10926. ],
  10927. "resumeToken": ""
  10928. }
  10929. }
  10930. }
  10931. },
  10932. {
  10933. "userSet": [
  10934. "collection/key",
  10935. {
  10936. "foo": "bar"
  10937. }
  10938. ],
  10939. "expectedSnapshotEvents": [
  10940. {
  10941. "added": [
  10942. {
  10943. "key": "collection/key",
  10944. "options": {
  10945. "hasCommittedMutations": false,
  10946. "hasLocalMutations": true
  10947. },
  10948. "value": {
  10949. "foo": "bar"
  10950. },
  10951. "version": 0
  10952. }
  10953. ],
  10954. "errorCode": 0,
  10955. "fromCache": true,
  10956. "hasPendingWrites": true,
  10957. "query": {
  10958. "filters": [
  10959. ],
  10960. "orderBys": [
  10961. ],
  10962. "path": "collection/key"
  10963. }
  10964. }
  10965. ]
  10966. },
  10967. {
  10968. "failWrite": {
  10969. "error": {
  10970. "code": 8
  10971. },
  10972. "keepInQueue": true
  10973. }
  10974. }
  10975. ]
  10976. },
  10977. "Writes that fail with code unauthenticated are retried": {
  10978. "describeName": "Writes:",
  10979. "itName": "Writes that fail with code unauthenticated are retried",
  10980. "tags": [
  10981. ],
  10982. "config": {
  10983. "numClients": 1,
  10984. "useGarbageCollection": true
  10985. },
  10986. "steps": [
  10987. {
  10988. "userListen": [
  10989. 2,
  10990. {
  10991. "filters": [
  10992. ],
  10993. "orderBys": [
  10994. ],
  10995. "path": "collection/key"
  10996. }
  10997. ],
  10998. "expectedState": {
  10999. "activeTargets": {
  11000. "2": {
  11001. "queries": [
  11002. {
  11003. "filters": [
  11004. ],
  11005. "orderBys": [
  11006. ],
  11007. "path": "collection/key"
  11008. }
  11009. ],
  11010. "resumeToken": ""
  11011. }
  11012. }
  11013. }
  11014. },
  11015. {
  11016. "userSet": [
  11017. "collection/key",
  11018. {
  11019. "foo": "bar"
  11020. }
  11021. ],
  11022. "expectedSnapshotEvents": [
  11023. {
  11024. "added": [
  11025. {
  11026. "key": "collection/key",
  11027. "options": {
  11028. "hasCommittedMutations": false,
  11029. "hasLocalMutations": true
  11030. },
  11031. "value": {
  11032. "foo": "bar"
  11033. },
  11034. "version": 0
  11035. }
  11036. ],
  11037. "errorCode": 0,
  11038. "fromCache": true,
  11039. "hasPendingWrites": true,
  11040. "query": {
  11041. "filters": [
  11042. ],
  11043. "orderBys": [
  11044. ],
  11045. "path": "collection/key"
  11046. }
  11047. }
  11048. ]
  11049. },
  11050. {
  11051. "failWrite": {
  11052. "error": {
  11053. "code": 16
  11054. },
  11055. "keepInQueue": true
  11056. }
  11057. },
  11058. {
  11059. "writeAck": {
  11060. "version": 1000
  11061. },
  11062. "expectedState": {
  11063. "userCallbacks": {
  11064. "acknowledgedDocs": [
  11065. "collection/key"
  11066. ],
  11067. "rejectedDocs": [
  11068. ]
  11069. }
  11070. }
  11071. },
  11072. {
  11073. "watchAck": [
  11074. 2
  11075. ]
  11076. },
  11077. {
  11078. "watchEntity": {
  11079. "docs": [
  11080. {
  11081. "key": "collection/key",
  11082. "options": {
  11083. "hasCommittedMutations": false,
  11084. "hasLocalMutations": false
  11085. },
  11086. "value": {
  11087. "foo": "bar"
  11088. },
  11089. "version": 1000
  11090. }
  11091. ],
  11092. "targets": [
  11093. 2
  11094. ]
  11095. }
  11096. },
  11097. {
  11098. "watchCurrent": [
  11099. [
  11100. 2
  11101. ],
  11102. "resume-token-1000"
  11103. ]
  11104. },
  11105. {
  11106. "watchSnapshot": {
  11107. "targetIds": [
  11108. ],
  11109. "version": 1000
  11110. },
  11111. "expectedSnapshotEvents": [
  11112. {
  11113. "errorCode": 0,
  11114. "fromCache": false,
  11115. "hasPendingWrites": false,
  11116. "metadata": [
  11117. {
  11118. "key": "collection/key",
  11119. "options": {
  11120. "hasCommittedMutations": false,
  11121. "hasLocalMutations": false
  11122. },
  11123. "value": {
  11124. "foo": "bar"
  11125. },
  11126. "version": 1000
  11127. }
  11128. ],
  11129. "query": {
  11130. "filters": [
  11131. ],
  11132. "orderBys": [
  11133. ],
  11134. "path": "collection/key"
  11135. }
  11136. }
  11137. ]
  11138. }
  11139. ]
  11140. },
  11141. "Writes that fail with code unavailable are retried": {
  11142. "describeName": "Writes:",
  11143. "itName": "Writes that fail with code unavailable are retried",
  11144. "tags": [
  11145. ],
  11146. "config": {
  11147. "numClients": 1,
  11148. "useGarbageCollection": true
  11149. },
  11150. "steps": [
  11151. {
  11152. "userListen": [
  11153. 2,
  11154. {
  11155. "filters": [
  11156. ],
  11157. "orderBys": [
  11158. ],
  11159. "path": "collection/key"
  11160. }
  11161. ],
  11162. "expectedState": {
  11163. "activeTargets": {
  11164. "2": {
  11165. "queries": [
  11166. {
  11167. "filters": [
  11168. ],
  11169. "orderBys": [
  11170. ],
  11171. "path": "collection/key"
  11172. }
  11173. ],
  11174. "resumeToken": ""
  11175. }
  11176. }
  11177. }
  11178. },
  11179. {
  11180. "userSet": [
  11181. "collection/key",
  11182. {
  11183. "foo": "bar"
  11184. }
  11185. ],
  11186. "expectedSnapshotEvents": [
  11187. {
  11188. "added": [
  11189. {
  11190. "key": "collection/key",
  11191. "options": {
  11192. "hasCommittedMutations": false,
  11193. "hasLocalMutations": true
  11194. },
  11195. "value": {
  11196. "foo": "bar"
  11197. },
  11198. "version": 0
  11199. }
  11200. ],
  11201. "errorCode": 0,
  11202. "fromCache": true,
  11203. "hasPendingWrites": true,
  11204. "query": {
  11205. "filters": [
  11206. ],
  11207. "orderBys": [
  11208. ],
  11209. "path": "collection/key"
  11210. }
  11211. }
  11212. ]
  11213. },
  11214. {
  11215. "failWrite": {
  11216. "error": {
  11217. "code": 14
  11218. },
  11219. "keepInQueue": true
  11220. }
  11221. },
  11222. {
  11223. "writeAck": {
  11224. "version": 1000
  11225. },
  11226. "expectedState": {
  11227. "userCallbacks": {
  11228. "acknowledgedDocs": [
  11229. "collection/key"
  11230. ],
  11231. "rejectedDocs": [
  11232. ]
  11233. }
  11234. }
  11235. },
  11236. {
  11237. "watchAck": [
  11238. 2
  11239. ]
  11240. },
  11241. {
  11242. "watchEntity": {
  11243. "docs": [
  11244. {
  11245. "key": "collection/key",
  11246. "options": {
  11247. "hasCommittedMutations": false,
  11248. "hasLocalMutations": false
  11249. },
  11250. "value": {
  11251. "foo": "bar"
  11252. },
  11253. "version": 1000
  11254. }
  11255. ],
  11256. "targets": [
  11257. 2
  11258. ]
  11259. }
  11260. },
  11261. {
  11262. "watchCurrent": [
  11263. [
  11264. 2
  11265. ],
  11266. "resume-token-1000"
  11267. ]
  11268. },
  11269. {
  11270. "watchSnapshot": {
  11271. "targetIds": [
  11272. ],
  11273. "version": 1000
  11274. },
  11275. "expectedSnapshotEvents": [
  11276. {
  11277. "errorCode": 0,
  11278. "fromCache": false,
  11279. "hasPendingWrites": false,
  11280. "metadata": [
  11281. {
  11282. "key": "collection/key",
  11283. "options": {
  11284. "hasCommittedMutations": false,
  11285. "hasLocalMutations": false
  11286. },
  11287. "value": {
  11288. "foo": "bar"
  11289. },
  11290. "version": 1000
  11291. }
  11292. ],
  11293. "query": {
  11294. "filters": [
  11295. ],
  11296. "orderBys": [
  11297. ],
  11298. "path": "collection/key"
  11299. }
  11300. }
  11301. ]
  11302. }
  11303. ]
  11304. },
  11305. "Writes that fail with code unimplemented are rejected": {
  11306. "describeName": "Writes:",
  11307. "itName": "Writes that fail with code unimplemented are rejected",
  11308. "tags": [
  11309. ],
  11310. "config": {
  11311. "numClients": 1,
  11312. "useGarbageCollection": true
  11313. },
  11314. "steps": [
  11315. {
  11316. "userListen": [
  11317. 2,
  11318. {
  11319. "filters": [
  11320. ],
  11321. "orderBys": [
  11322. ],
  11323. "path": "collection/key"
  11324. }
  11325. ],
  11326. "expectedState": {
  11327. "activeTargets": {
  11328. "2": {
  11329. "queries": [
  11330. {
  11331. "filters": [
  11332. ],
  11333. "orderBys": [
  11334. ],
  11335. "path": "collection/key"
  11336. }
  11337. ],
  11338. "resumeToken": ""
  11339. }
  11340. }
  11341. }
  11342. },
  11343. {
  11344. "userSet": [
  11345. "collection/key",
  11346. {
  11347. "foo": "bar"
  11348. }
  11349. ],
  11350. "expectedSnapshotEvents": [
  11351. {
  11352. "added": [
  11353. {
  11354. "key": "collection/key",
  11355. "options": {
  11356. "hasCommittedMutations": false,
  11357. "hasLocalMutations": true
  11358. },
  11359. "value": {
  11360. "foo": "bar"
  11361. },
  11362. "version": 0
  11363. }
  11364. ],
  11365. "errorCode": 0,
  11366. "fromCache": true,
  11367. "hasPendingWrites": true,
  11368. "query": {
  11369. "filters": [
  11370. ],
  11371. "orderBys": [
  11372. ],
  11373. "path": "collection/key"
  11374. }
  11375. }
  11376. ]
  11377. },
  11378. {
  11379. "failWrite": {
  11380. "error": {
  11381. "code": 12
  11382. }
  11383. },
  11384. "expectedSnapshotEvents": [
  11385. {
  11386. "errorCode": 0,
  11387. "fromCache": true,
  11388. "hasPendingWrites": false,
  11389. "query": {
  11390. "filters": [
  11391. ],
  11392. "orderBys": [
  11393. ],
  11394. "path": "collection/key"
  11395. },
  11396. "removed": [
  11397. {
  11398. "key": "collection/key",
  11399. "options": {
  11400. "hasCommittedMutations": false,
  11401. "hasLocalMutations": true
  11402. },
  11403. "value": {
  11404. "foo": "bar"
  11405. },
  11406. "version": 0
  11407. }
  11408. ]
  11409. }
  11410. ],
  11411. "expectedState": {
  11412. "userCallbacks": {
  11413. "acknowledgedDocs": [
  11414. ],
  11415. "rejectedDocs": [
  11416. "collection/key"
  11417. ]
  11418. }
  11419. }
  11420. }
  11421. ]
  11422. },
  11423. "Writes that fail with code unknown are retried": {
  11424. "describeName": "Writes:",
  11425. "itName": "Writes that fail with code unknown are retried",
  11426. "tags": [
  11427. ],
  11428. "config": {
  11429. "numClients": 1,
  11430. "useGarbageCollection": true
  11431. },
  11432. "steps": [
  11433. {
  11434. "userListen": [
  11435. 2,
  11436. {
  11437. "filters": [
  11438. ],
  11439. "orderBys": [
  11440. ],
  11441. "path": "collection/key"
  11442. }
  11443. ],
  11444. "expectedState": {
  11445. "activeTargets": {
  11446. "2": {
  11447. "queries": [
  11448. {
  11449. "filters": [
  11450. ],
  11451. "orderBys": [
  11452. ],
  11453. "path": "collection/key"
  11454. }
  11455. ],
  11456. "resumeToken": ""
  11457. }
  11458. }
  11459. }
  11460. },
  11461. {
  11462. "userSet": [
  11463. "collection/key",
  11464. {
  11465. "foo": "bar"
  11466. }
  11467. ],
  11468. "expectedSnapshotEvents": [
  11469. {
  11470. "added": [
  11471. {
  11472. "key": "collection/key",
  11473. "options": {
  11474. "hasCommittedMutations": false,
  11475. "hasLocalMutations": true
  11476. },
  11477. "value": {
  11478. "foo": "bar"
  11479. },
  11480. "version": 0
  11481. }
  11482. ],
  11483. "errorCode": 0,
  11484. "fromCache": true,
  11485. "hasPendingWrites": true,
  11486. "query": {
  11487. "filters": [
  11488. ],
  11489. "orderBys": [
  11490. ],
  11491. "path": "collection/key"
  11492. }
  11493. }
  11494. ]
  11495. },
  11496. {
  11497. "failWrite": {
  11498. "error": {
  11499. "code": 2
  11500. },
  11501. "keepInQueue": true
  11502. }
  11503. },
  11504. {
  11505. "writeAck": {
  11506. "version": 1000
  11507. },
  11508. "expectedState": {
  11509. "userCallbacks": {
  11510. "acknowledgedDocs": [
  11511. "collection/key"
  11512. ],
  11513. "rejectedDocs": [
  11514. ]
  11515. }
  11516. }
  11517. },
  11518. {
  11519. "watchAck": [
  11520. 2
  11521. ]
  11522. },
  11523. {
  11524. "watchEntity": {
  11525. "docs": [
  11526. {
  11527. "key": "collection/key",
  11528. "options": {
  11529. "hasCommittedMutations": false,
  11530. "hasLocalMutations": false
  11531. },
  11532. "value": {
  11533. "foo": "bar"
  11534. },
  11535. "version": 1000
  11536. }
  11537. ],
  11538. "targets": [
  11539. 2
  11540. ]
  11541. }
  11542. },
  11543. {
  11544. "watchCurrent": [
  11545. [
  11546. 2
  11547. ],
  11548. "resume-token-1000"
  11549. ]
  11550. },
  11551. {
  11552. "watchSnapshot": {
  11553. "targetIds": [
  11554. ],
  11555. "version": 1000
  11556. },
  11557. "expectedSnapshotEvents": [
  11558. {
  11559. "errorCode": 0,
  11560. "fromCache": false,
  11561. "hasPendingWrites": false,
  11562. "metadata": [
  11563. {
  11564. "key": "collection/key",
  11565. "options": {
  11566. "hasCommittedMutations": false,
  11567. "hasLocalMutations": false
  11568. },
  11569. "value": {
  11570. "foo": "bar"
  11571. },
  11572. "version": 1000
  11573. }
  11574. ],
  11575. "query": {
  11576. "filters": [
  11577. ],
  11578. "orderBys": [
  11579. ],
  11580. "path": "collection/key"
  11581. }
  11582. }
  11583. ]
  11584. }
  11585. ]
  11586. }
  11587. }