write_spec_test.json 264 KB

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