recovery_spec_test.json 110 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345
  1. {
  2. "Can re-add failed target": {
  3. "describeName": "Persistence Recovery",
  4. "itName": "Can re-add failed target",
  5. "tags": [
  6. "no-ios",
  7. "no-android"
  8. ],
  9. "config": {
  10. "numClients": 1,
  11. "useGarbageCollection": true
  12. },
  13. "steps": [
  14. {
  15. "userListen": {
  16. "query": {
  17. "filters": [
  18. ],
  19. "orderBys": [
  20. ],
  21. "path": "collection1"
  22. },
  23. "targetId": 2
  24. },
  25. "expectedState": {
  26. "activeTargets": {
  27. "2": {
  28. "queries": [
  29. {
  30. "filters": [
  31. ],
  32. "orderBys": [
  33. ],
  34. "path": "collection1"
  35. }
  36. ],
  37. "resumeToken": ""
  38. }
  39. }
  40. }
  41. },
  42. {
  43. "watchAck": [
  44. 2
  45. ]
  46. },
  47. {
  48. "watchEntity": {
  49. "docs": [
  50. ],
  51. "targets": [
  52. 2
  53. ]
  54. }
  55. },
  56. {
  57. "watchCurrent": [
  58. [
  59. 2
  60. ],
  61. "resume-token-1"
  62. ]
  63. },
  64. {
  65. "watchSnapshot": {
  66. "targetIds": [
  67. ],
  68. "version": 1
  69. },
  70. "expectedSnapshotEvents": [
  71. {
  72. "errorCode": 0,
  73. "fromCache": false,
  74. "hasPendingWrites": false,
  75. "query": {
  76. "filters": [
  77. ],
  78. "orderBys": [
  79. ],
  80. "path": "collection1"
  81. }
  82. }
  83. ]
  84. },
  85. {
  86. "failDatabase": [
  87. "Allocate target"
  88. ]
  89. },
  90. {
  91. "userListen": {
  92. "query": {
  93. "filters": [
  94. ],
  95. "orderBys": [
  96. ],
  97. "path": "collection2"
  98. },
  99. "targetId": 0
  100. },
  101. "expectedSnapshotEvents": [
  102. {
  103. "errorCode": 14,
  104. "fromCache": false,
  105. "hasPendingWrites": false,
  106. "query": {
  107. "filters": [
  108. ],
  109. "orderBys": [
  110. ],
  111. "path": "collection2"
  112. }
  113. }
  114. ]
  115. },
  116. {
  117. "failDatabase": false
  118. },
  119. {
  120. "userListen": {
  121. "query": {
  122. "filters": [
  123. ],
  124. "orderBys": [
  125. ],
  126. "path": "collection2"
  127. },
  128. "targetId": 4
  129. },
  130. "expectedState": {
  131. "activeTargets": {
  132. "2": {
  133. "queries": [
  134. {
  135. "filters": [
  136. ],
  137. "orderBys": [
  138. ],
  139. "path": "collection1"
  140. }
  141. ],
  142. "resumeToken": ""
  143. },
  144. "4": {
  145. "queries": [
  146. {
  147. "filters": [
  148. ],
  149. "orderBys": [
  150. ],
  151. "path": "collection2"
  152. }
  153. ],
  154. "resumeToken": ""
  155. }
  156. }
  157. }
  158. },
  159. {
  160. "watchAck": [
  161. 4
  162. ]
  163. },
  164. {
  165. "watchEntity": {
  166. "docs": [
  167. ],
  168. "targets": [
  169. 4
  170. ]
  171. }
  172. },
  173. {
  174. "watchCurrent": [
  175. [
  176. 4
  177. ],
  178. "resume-token-1"
  179. ]
  180. },
  181. {
  182. "watchSnapshot": {
  183. "targetIds": [
  184. ],
  185. "version": 1
  186. },
  187. "expectedSnapshotEvents": [
  188. {
  189. "errorCode": 0,
  190. "fromCache": false,
  191. "hasPendingWrites": false,
  192. "query": {
  193. "filters": [
  194. ],
  195. "orderBys": [
  196. ],
  197. "path": "collection2"
  198. }
  199. }
  200. ]
  201. }
  202. ]
  203. },
  204. "Can re-listen to query when unlisten fails": {
  205. "describeName": "Persistence Recovery",
  206. "itName": "Can re-listen to query when unlisten fails",
  207. "tags": [
  208. "no-ios",
  209. "no-android"
  210. ],
  211. "config": {
  212. "numClients": 1,
  213. "useGarbageCollection": false
  214. },
  215. "steps": [
  216. {
  217. "userListen": {
  218. "query": {
  219. "filters": [
  220. ],
  221. "orderBys": [
  222. ],
  223. "path": "collection"
  224. },
  225. "targetId": 2
  226. },
  227. "expectedState": {
  228. "activeTargets": {
  229. "2": {
  230. "queries": [
  231. {
  232. "filters": [
  233. ],
  234. "orderBys": [
  235. ],
  236. "path": "collection"
  237. }
  238. ],
  239. "resumeToken": ""
  240. }
  241. }
  242. }
  243. },
  244. {
  245. "watchAck": [
  246. 2
  247. ]
  248. },
  249. {
  250. "watchEntity": {
  251. "docs": [
  252. {
  253. "key": "collection/key1",
  254. "options": {
  255. "hasCommittedMutations": false,
  256. "hasLocalMutations": false
  257. },
  258. "value": {
  259. "foo": "a"
  260. },
  261. "version": 1
  262. }
  263. ],
  264. "targets": [
  265. 2
  266. ]
  267. }
  268. },
  269. {
  270. "watchCurrent": [
  271. [
  272. 2
  273. ],
  274. "resume-token-1000"
  275. ]
  276. },
  277. {
  278. "watchSnapshot": {
  279. "targetIds": [
  280. ],
  281. "version": 1000
  282. },
  283. "expectedSnapshotEvents": [
  284. {
  285. "added": [
  286. {
  287. "key": "collection/key1",
  288. "options": {
  289. "hasCommittedMutations": false,
  290. "hasLocalMutations": false
  291. },
  292. "value": {
  293. "foo": "a"
  294. },
  295. "version": 1
  296. }
  297. ],
  298. "errorCode": 0,
  299. "fromCache": false,
  300. "hasPendingWrites": false,
  301. "query": {
  302. "filters": [
  303. ],
  304. "orderBys": [
  305. ],
  306. "path": "collection"
  307. }
  308. }
  309. ]
  310. },
  311. {
  312. "failDatabase": [
  313. "Release target"
  314. ]
  315. },
  316. {
  317. "userUnlisten": [
  318. 2,
  319. {
  320. "filters": [
  321. ],
  322. "orderBys": [
  323. ],
  324. "path": "collection"
  325. }
  326. ],
  327. "expectedState": {
  328. "activeTargets": {
  329. }
  330. }
  331. },
  332. {
  333. "watchRemove": {
  334. "targetIds": [
  335. 2
  336. ]
  337. }
  338. },
  339. {
  340. "failDatabase": false
  341. },
  342. {
  343. "userListen": {
  344. "query": {
  345. "filters": [
  346. ],
  347. "orderBys": [
  348. ],
  349. "path": "collection"
  350. },
  351. "targetId": 2
  352. },
  353. "expectedSnapshotEvents": [
  354. {
  355. "added": [
  356. {
  357. "key": "collection/key1",
  358. "options": {
  359. "hasCommittedMutations": false,
  360. "hasLocalMutations": false
  361. },
  362. "value": {
  363. "foo": "a"
  364. },
  365. "version": 1
  366. }
  367. ],
  368. "errorCode": 0,
  369. "fromCache": true,
  370. "hasPendingWrites": false,
  371. "query": {
  372. "filters": [
  373. ],
  374. "orderBys": [
  375. ],
  376. "path": "collection"
  377. }
  378. }
  379. ],
  380. "expectedState": {
  381. "activeTargets": {
  382. "2": {
  383. "queries": [
  384. {
  385. "filters": [
  386. ],
  387. "orderBys": [
  388. ],
  389. "path": "collection"
  390. }
  391. ],
  392. "resumeToken": "resume-token-1000"
  393. }
  394. }
  395. }
  396. },
  397. {
  398. "watchAck": [
  399. 2
  400. ]
  401. },
  402. {
  403. "watchEntity": {
  404. "docs": [
  405. {
  406. "key": "collection/key2",
  407. "options": {
  408. "hasCommittedMutations": false,
  409. "hasLocalMutations": false
  410. },
  411. "value": {
  412. "foo": "b"
  413. },
  414. "version": 2
  415. }
  416. ],
  417. "targets": [
  418. 2
  419. ]
  420. }
  421. },
  422. {
  423. "watchCurrent": [
  424. [
  425. 2
  426. ],
  427. "resume-token-2000"
  428. ]
  429. },
  430. {
  431. "watchSnapshot": {
  432. "targetIds": [
  433. ],
  434. "version": 2000
  435. },
  436. "expectedSnapshotEvents": [
  437. {
  438. "added": [
  439. {
  440. "key": "collection/key2",
  441. "options": {
  442. "hasCommittedMutations": false,
  443. "hasLocalMutations": false
  444. },
  445. "value": {
  446. "foo": "b"
  447. },
  448. "version": 2
  449. }
  450. ],
  451. "errorCode": 0,
  452. "fromCache": false,
  453. "hasPendingWrites": false,
  454. "query": {
  455. "filters": [
  456. ],
  457. "orderBys": [
  458. ],
  459. "path": "collection"
  460. }
  461. }
  462. ]
  463. },
  464. {
  465. "userUnlisten": [
  466. 2,
  467. {
  468. "filters": [
  469. ],
  470. "orderBys": [
  471. ],
  472. "path": "collection"
  473. }
  474. ],
  475. "expectedState": {
  476. "activeTargets": {
  477. }
  478. }
  479. }
  480. ]
  481. },
  482. "Clients fail to lookup mutations (with recovery)": {
  483. "describeName": "Persistence Recovery",
  484. "itName": "Clients fail to lookup mutations (with recovery)",
  485. "tags": [
  486. "multi-client",
  487. "no-ios",
  488. "no-android"
  489. ],
  490. "config": {
  491. "numClients": 2,
  492. "useGarbageCollection": false
  493. },
  494. "steps": [
  495. {
  496. "clientIndex": 0,
  497. "drainQueue": true,
  498. "expectedState": {
  499. "isPrimary": true
  500. }
  501. },
  502. {
  503. "clientIndex": 0,
  504. "failDatabase": [
  505. "Lookup mutation documents"
  506. ]
  507. },
  508. {
  509. "clientIndex": 1,
  510. "drainQueue": true,
  511. "expectedState": {
  512. "isPrimary": false
  513. }
  514. },
  515. {
  516. "clientIndex": 1,
  517. "userSet": [
  518. "collection/a",
  519. {
  520. "v": 1
  521. }
  522. ]
  523. },
  524. {
  525. "clientIndex": 1,
  526. "failDatabase": [
  527. "Lookup mutation documents"
  528. ]
  529. },
  530. {
  531. "clientIndex": 0,
  532. "drainQueue": true
  533. },
  534. {
  535. "clientIndex": 0,
  536. "failDatabase": false
  537. },
  538. {
  539. "clientIndex": 0,
  540. "runTimer": "async_queue_retry"
  541. },
  542. {
  543. "clientIndex": 0,
  544. "writeAck": {
  545. "version": 1
  546. }
  547. },
  548. {
  549. "clientIndex": 1,
  550. "drainQueue": true
  551. },
  552. {
  553. "clientIndex": 1,
  554. "failDatabase": false
  555. },
  556. {
  557. "clientIndex": 1,
  558. "runTimer": "async_queue_retry",
  559. "expectedState": {
  560. "userCallbacks": {
  561. "acknowledgedDocs": [
  562. "collection/a"
  563. ],
  564. "rejectedDocs": [
  565. ]
  566. }
  567. }
  568. }
  569. ]
  570. },
  571. "Does not surface non-persisted writes": {
  572. "describeName": "Persistence Recovery",
  573. "itName": "Does not surface non-persisted writes",
  574. "tags": [
  575. "no-ios",
  576. "no-android"
  577. ],
  578. "config": {
  579. "numClients": 1,
  580. "useGarbageCollection": true
  581. },
  582. "steps": [
  583. {
  584. "userListen": {
  585. "query": {
  586. "filters": [
  587. ],
  588. "orderBys": [
  589. ],
  590. "path": "collection"
  591. },
  592. "targetId": 2
  593. },
  594. "expectedState": {
  595. "activeTargets": {
  596. "2": {
  597. "queries": [
  598. {
  599. "filters": [
  600. ],
  601. "orderBys": [
  602. ],
  603. "path": "collection"
  604. }
  605. ],
  606. "resumeToken": ""
  607. }
  608. }
  609. }
  610. },
  611. {
  612. "userSet": [
  613. "collection/key1",
  614. {
  615. "foo": "a"
  616. }
  617. ],
  618. "expectedSnapshotEvents": [
  619. {
  620. "added": [
  621. {
  622. "key": "collection/key1",
  623. "options": {
  624. "hasCommittedMutations": false,
  625. "hasLocalMutations": true
  626. },
  627. "value": {
  628. "foo": "a"
  629. },
  630. "version": 0
  631. }
  632. ],
  633. "errorCode": 0,
  634. "fromCache": true,
  635. "hasPendingWrites": true,
  636. "query": {
  637. "filters": [
  638. ],
  639. "orderBys": [
  640. ],
  641. "path": "collection"
  642. }
  643. }
  644. ]
  645. },
  646. {
  647. "failDatabase": [
  648. "Locally write mutations"
  649. ]
  650. },
  651. {
  652. "userSet": [
  653. "collection/key2",
  654. {
  655. "foo": "b"
  656. }
  657. ],
  658. "expectedState": {
  659. "userCallbacks": {
  660. "acknowledgedDocs": [
  661. ],
  662. "rejectedDocs": [
  663. "collection/key2"
  664. ]
  665. }
  666. }
  667. },
  668. {
  669. "failDatabase": false
  670. },
  671. {
  672. "userSet": [
  673. "collection/key3",
  674. {
  675. "foo": "c"
  676. }
  677. ],
  678. "expectedSnapshotEvents": [
  679. {
  680. "added": [
  681. {
  682. "key": "collection/key3",
  683. "options": {
  684. "hasCommittedMutations": false,
  685. "hasLocalMutations": true
  686. },
  687. "value": {
  688. "foo": "c"
  689. },
  690. "version": 0
  691. }
  692. ],
  693. "errorCode": 0,
  694. "fromCache": true,
  695. "hasPendingWrites": true,
  696. "query": {
  697. "filters": [
  698. ],
  699. "orderBys": [
  700. ],
  701. "path": "collection"
  702. }
  703. }
  704. ]
  705. },
  706. {
  707. "writeAck": {
  708. "version": 1
  709. },
  710. "expectedState": {
  711. "userCallbacks": {
  712. "acknowledgedDocs": [
  713. "collection/key1"
  714. ],
  715. "rejectedDocs": [
  716. ]
  717. }
  718. }
  719. },
  720. {
  721. "writeAck": {
  722. "version": 2
  723. },
  724. "expectedState": {
  725. "userCallbacks": {
  726. "acknowledgedDocs": [
  727. "collection/key3"
  728. ],
  729. "rejectedDocs": [
  730. ]
  731. }
  732. }
  733. },
  734. {
  735. "watchAck": [
  736. 2
  737. ]
  738. },
  739. {
  740. "watchEntity": {
  741. "docs": [
  742. {
  743. "key": "collection/key1",
  744. "options": {
  745. "hasCommittedMutations": false,
  746. "hasLocalMutations": false
  747. },
  748. "value": {
  749. "foo": "a"
  750. },
  751. "version": 1
  752. },
  753. {
  754. "key": "collection/key3",
  755. "options": {
  756. "hasCommittedMutations": false,
  757. "hasLocalMutations": false
  758. },
  759. "value": {
  760. "foo": "c"
  761. },
  762. "version": 2
  763. }
  764. ],
  765. "targets": [
  766. 2
  767. ]
  768. }
  769. },
  770. {
  771. "watchCurrent": [
  772. [
  773. 2
  774. ],
  775. "resume-token-2"
  776. ]
  777. },
  778. {
  779. "watchSnapshot": {
  780. "targetIds": [
  781. ],
  782. "version": 2
  783. },
  784. "expectedSnapshotEvents": [
  785. {
  786. "errorCode": 0,
  787. "fromCache": false,
  788. "hasPendingWrites": false,
  789. "metadata": [
  790. {
  791. "key": "collection/key1",
  792. "options": {
  793. "hasCommittedMutations": false,
  794. "hasLocalMutations": false
  795. },
  796. "value": {
  797. "foo": "a"
  798. },
  799. "version": 1
  800. },
  801. {
  802. "key": "collection/key3",
  803. "options": {
  804. "hasCommittedMutations": false,
  805. "hasLocalMutations": false
  806. },
  807. "value": {
  808. "foo": "c"
  809. },
  810. "version": 2
  811. }
  812. ],
  813. "query": {
  814. "filters": [
  815. ],
  816. "orderBys": [
  817. ],
  818. "path": "collection"
  819. }
  820. }
  821. ]
  822. }
  823. ]
  824. },
  825. "Excludes documents from future queries even if notifyLocalViewChanges fails": {
  826. "describeName": "Persistence Recovery",
  827. "itName": "Excludes documents from future queries even if notifyLocalViewChanges fails",
  828. "tags": [
  829. "no-ios",
  830. "no-android"
  831. ],
  832. "config": {
  833. "numClients": 1,
  834. "useGarbageCollection": false
  835. },
  836. "steps": [
  837. {
  838. "userListen": {
  839. "query": {
  840. "filters": [
  841. ],
  842. "orderBys": [
  843. ],
  844. "path": "collection"
  845. },
  846. "targetId": 2
  847. },
  848. "expectedState": {
  849. "activeTargets": {
  850. "2": {
  851. "queries": [
  852. {
  853. "filters": [
  854. ],
  855. "orderBys": [
  856. ],
  857. "path": "collection"
  858. }
  859. ],
  860. "resumeToken": ""
  861. }
  862. }
  863. }
  864. },
  865. {
  866. "watchAck": [
  867. 2
  868. ]
  869. },
  870. {
  871. "watchEntity": {
  872. "docs": [
  873. {
  874. "key": "collection/key1",
  875. "options": {
  876. "hasCommittedMutations": false,
  877. "hasLocalMutations": false
  878. },
  879. "value": {
  880. "foo": "a"
  881. },
  882. "version": 1000
  883. }
  884. ],
  885. "targets": [
  886. 2
  887. ]
  888. }
  889. },
  890. {
  891. "watchCurrent": [
  892. [
  893. 2
  894. ],
  895. "resume-token-1000"
  896. ]
  897. },
  898. {
  899. "watchSnapshot": {
  900. "targetIds": [
  901. ],
  902. "version": 1000
  903. },
  904. "expectedSnapshotEvents": [
  905. {
  906. "added": [
  907. {
  908. "key": "collection/key1",
  909. "options": {
  910. "hasCommittedMutations": false,
  911. "hasLocalMutations": false
  912. },
  913. "value": {
  914. "foo": "a"
  915. },
  916. "version": 1000
  917. }
  918. ],
  919. "errorCode": 0,
  920. "fromCache": false,
  921. "hasPendingWrites": false,
  922. "query": {
  923. "filters": [
  924. ],
  925. "orderBys": [
  926. ],
  927. "path": "collection"
  928. }
  929. }
  930. ]
  931. },
  932. {
  933. "failDatabase": [
  934. "notifyLocalViewChanges"
  935. ]
  936. },
  937. {
  938. "watchEntity": {
  939. "docs": [
  940. {
  941. "key": "collection/key1",
  942. "value": null,
  943. "version": 2000
  944. }
  945. ],
  946. "removedTargets": [
  947. 2
  948. ]
  949. }
  950. },
  951. {
  952. "watchSnapshot": {
  953. "targetIds": [
  954. ],
  955. "version": 2000
  956. },
  957. "expectedSnapshotEvents": [
  958. {
  959. "errorCode": 0,
  960. "fromCache": false,
  961. "hasPendingWrites": false,
  962. "query": {
  963. "filters": [
  964. ],
  965. "orderBys": [
  966. ],
  967. "path": "collection"
  968. },
  969. "removed": [
  970. {
  971. "key": "collection/key1",
  972. "options": {
  973. "hasCommittedMutations": false,
  974. "hasLocalMutations": false
  975. },
  976. "value": {
  977. "foo": "a"
  978. },
  979. "version": 1000
  980. }
  981. ]
  982. }
  983. ]
  984. },
  985. {
  986. "failDatabase": false
  987. },
  988. {
  989. "userUnlisten": [
  990. 2,
  991. {
  992. "filters": [
  993. ],
  994. "orderBys": [
  995. ],
  996. "path": "collection"
  997. }
  998. ],
  999. "expectedState": {
  1000. "activeTargets": {
  1001. }
  1002. }
  1003. },
  1004. {
  1005. "userListen": {
  1006. "query": {
  1007. "filters": [
  1008. ],
  1009. "orderBys": [
  1010. ],
  1011. "path": "collection"
  1012. },
  1013. "targetId": 2
  1014. },
  1015. "expectedSnapshotEvents": [
  1016. {
  1017. "errorCode": 0,
  1018. "fromCache": true,
  1019. "hasPendingWrites": false,
  1020. "query": {
  1021. "filters": [
  1022. ],
  1023. "orderBys": [
  1024. ],
  1025. "path": "collection"
  1026. }
  1027. }
  1028. ],
  1029. "expectedState": {
  1030. "activeTargets": {
  1031. "2": {
  1032. "queries": [
  1033. {
  1034. "filters": [
  1035. ],
  1036. "orderBys": [
  1037. ],
  1038. "path": "collection"
  1039. }
  1040. ],
  1041. "resumeToken": "resume-token-1000"
  1042. }
  1043. }
  1044. }
  1045. }
  1046. ]
  1047. },
  1048. "Fails targets that cannot be allocated": {
  1049. "describeName": "Persistence Recovery",
  1050. "itName": "Fails targets that cannot be allocated",
  1051. "tags": [
  1052. "no-ios",
  1053. "no-android"
  1054. ],
  1055. "config": {
  1056. "numClients": 1,
  1057. "useGarbageCollection": true
  1058. },
  1059. "steps": [
  1060. {
  1061. "userListen": {
  1062. "query": {
  1063. "filters": [
  1064. ],
  1065. "orderBys": [
  1066. ],
  1067. "path": "collection1"
  1068. },
  1069. "targetId": 2
  1070. },
  1071. "expectedState": {
  1072. "activeTargets": {
  1073. "2": {
  1074. "queries": [
  1075. {
  1076. "filters": [
  1077. ],
  1078. "orderBys": [
  1079. ],
  1080. "path": "collection1"
  1081. }
  1082. ],
  1083. "resumeToken": ""
  1084. }
  1085. }
  1086. }
  1087. },
  1088. {
  1089. "watchAck": [
  1090. 2
  1091. ]
  1092. },
  1093. {
  1094. "watchEntity": {
  1095. "docs": [
  1096. ],
  1097. "targets": [
  1098. 2
  1099. ]
  1100. }
  1101. },
  1102. {
  1103. "watchCurrent": [
  1104. [
  1105. 2
  1106. ],
  1107. "resume-token-1"
  1108. ]
  1109. },
  1110. {
  1111. "watchSnapshot": {
  1112. "targetIds": [
  1113. ],
  1114. "version": 1
  1115. },
  1116. "expectedSnapshotEvents": [
  1117. {
  1118. "errorCode": 0,
  1119. "fromCache": false,
  1120. "hasPendingWrites": false,
  1121. "query": {
  1122. "filters": [
  1123. ],
  1124. "orderBys": [
  1125. ],
  1126. "path": "collection1"
  1127. }
  1128. }
  1129. ]
  1130. },
  1131. {
  1132. "failDatabase": [
  1133. "Allocate target"
  1134. ]
  1135. },
  1136. {
  1137. "userListen": {
  1138. "query": {
  1139. "filters": [
  1140. ],
  1141. "orderBys": [
  1142. ],
  1143. "path": "collection2"
  1144. },
  1145. "targetId": 0
  1146. },
  1147. "expectedSnapshotEvents": [
  1148. {
  1149. "errorCode": 14,
  1150. "fromCache": false,
  1151. "hasPendingWrites": false,
  1152. "query": {
  1153. "filters": [
  1154. ],
  1155. "orderBys": [
  1156. ],
  1157. "path": "collection2"
  1158. }
  1159. }
  1160. ]
  1161. },
  1162. {
  1163. "failDatabase": false
  1164. },
  1165. {
  1166. "userListen": {
  1167. "query": {
  1168. "filters": [
  1169. ],
  1170. "orderBys": [
  1171. ],
  1172. "path": "collection3"
  1173. },
  1174. "targetId": 4
  1175. },
  1176. "expectedState": {
  1177. "activeTargets": {
  1178. "2": {
  1179. "queries": [
  1180. {
  1181. "filters": [
  1182. ],
  1183. "orderBys": [
  1184. ],
  1185. "path": "collection1"
  1186. }
  1187. ],
  1188. "resumeToken": ""
  1189. },
  1190. "4": {
  1191. "queries": [
  1192. {
  1193. "filters": [
  1194. ],
  1195. "orderBys": [
  1196. ],
  1197. "path": "collection3"
  1198. }
  1199. ],
  1200. "resumeToken": ""
  1201. }
  1202. }
  1203. }
  1204. },
  1205. {
  1206. "watchAck": [
  1207. 4
  1208. ]
  1209. },
  1210. {
  1211. "watchEntity": {
  1212. "docs": [
  1213. ],
  1214. "targets": [
  1215. 4
  1216. ]
  1217. }
  1218. },
  1219. {
  1220. "watchCurrent": [
  1221. [
  1222. 4
  1223. ],
  1224. "resume-token-1"
  1225. ]
  1226. },
  1227. {
  1228. "watchSnapshot": {
  1229. "targetIds": [
  1230. ],
  1231. "version": 1
  1232. },
  1233. "expectedSnapshotEvents": [
  1234. {
  1235. "errorCode": 0,
  1236. "fromCache": false,
  1237. "hasPendingWrites": false,
  1238. "query": {
  1239. "filters": [
  1240. ],
  1241. "orderBys": [
  1242. ],
  1243. "path": "collection3"
  1244. }
  1245. }
  1246. ]
  1247. }
  1248. ]
  1249. },
  1250. "Handles rejections that cannot be persisted": {
  1251. "describeName": "Persistence Recovery",
  1252. "itName": "Handles rejections that cannot be persisted",
  1253. "tags": [
  1254. "no-ios",
  1255. "no-android"
  1256. ],
  1257. "config": {
  1258. "numClients": 1,
  1259. "useGarbageCollection": false
  1260. },
  1261. "steps": [
  1262. {
  1263. "userListen": {
  1264. "query": {
  1265. "filters": [
  1266. ],
  1267. "orderBys": [
  1268. ],
  1269. "path": "collection/key1"
  1270. },
  1271. "targetId": 2
  1272. },
  1273. "expectedState": {
  1274. "activeTargets": {
  1275. "2": {
  1276. "queries": [
  1277. {
  1278. "filters": [
  1279. ],
  1280. "orderBys": [
  1281. ],
  1282. "path": "collection/key1"
  1283. }
  1284. ],
  1285. "resumeToken": ""
  1286. }
  1287. }
  1288. }
  1289. },
  1290. {
  1291. "watchAck": [
  1292. 2
  1293. ]
  1294. },
  1295. {
  1296. "watchEntity": {
  1297. "docs": [
  1298. {
  1299. "key": "collection/key1",
  1300. "options": {
  1301. "hasCommittedMutations": false,
  1302. "hasLocalMutations": false
  1303. },
  1304. "value": {
  1305. "foo": "a"
  1306. },
  1307. "version": 1000
  1308. }
  1309. ],
  1310. "targets": [
  1311. 2
  1312. ]
  1313. }
  1314. },
  1315. {
  1316. "watchCurrent": [
  1317. [
  1318. 2
  1319. ],
  1320. "resume-token-1000"
  1321. ]
  1322. },
  1323. {
  1324. "watchSnapshot": {
  1325. "targetIds": [
  1326. ],
  1327. "version": 1000
  1328. },
  1329. "expectedSnapshotEvents": [
  1330. {
  1331. "added": [
  1332. {
  1333. "key": "collection/key1",
  1334. "options": {
  1335. "hasCommittedMutations": false,
  1336. "hasLocalMutations": false
  1337. },
  1338. "value": {
  1339. "foo": "a"
  1340. },
  1341. "version": 1000
  1342. }
  1343. ],
  1344. "errorCode": 0,
  1345. "fromCache": false,
  1346. "hasPendingWrites": false,
  1347. "query": {
  1348. "filters": [
  1349. ],
  1350. "orderBys": [
  1351. ],
  1352. "path": "collection/key1"
  1353. }
  1354. }
  1355. ]
  1356. },
  1357. {
  1358. "userListen": {
  1359. "query": {
  1360. "filters": [
  1361. ],
  1362. "orderBys": [
  1363. ],
  1364. "path": "collection/key2"
  1365. },
  1366. "targetId": 4
  1367. },
  1368. "expectedState": {
  1369. "activeTargets": {
  1370. "2": {
  1371. "queries": [
  1372. {
  1373. "filters": [
  1374. ],
  1375. "orderBys": [
  1376. ],
  1377. "path": "collection/key1"
  1378. }
  1379. ],
  1380. "resumeToken": ""
  1381. },
  1382. "4": {
  1383. "queries": [
  1384. {
  1385. "filters": [
  1386. ],
  1387. "orderBys": [
  1388. ],
  1389. "path": "collection/key2"
  1390. }
  1391. ],
  1392. "resumeToken": ""
  1393. }
  1394. }
  1395. }
  1396. },
  1397. {
  1398. "watchAck": [
  1399. 4
  1400. ]
  1401. },
  1402. {
  1403. "watchEntity": {
  1404. "docs": [
  1405. {
  1406. "key": "collection/key2",
  1407. "options": {
  1408. "hasCommittedMutations": false,
  1409. "hasLocalMutations": false
  1410. },
  1411. "value": {
  1412. "foo": "b"
  1413. },
  1414. "version": 2000
  1415. }
  1416. ],
  1417. "targets": [
  1418. 4
  1419. ]
  1420. }
  1421. },
  1422. {
  1423. "watchCurrent": [
  1424. [
  1425. 4
  1426. ],
  1427. "resume-token-2000"
  1428. ]
  1429. },
  1430. {
  1431. "watchSnapshot": {
  1432. "targetIds": [
  1433. ],
  1434. "version": 2000
  1435. },
  1436. "expectedSnapshotEvents": [
  1437. {
  1438. "added": [
  1439. {
  1440. "key": "collection/key2",
  1441. "options": {
  1442. "hasCommittedMutations": false,
  1443. "hasLocalMutations": false
  1444. },
  1445. "value": {
  1446. "foo": "b"
  1447. },
  1448. "version": 2000
  1449. }
  1450. ],
  1451. "errorCode": 0,
  1452. "fromCache": false,
  1453. "hasPendingWrites": false,
  1454. "query": {
  1455. "filters": [
  1456. ],
  1457. "orderBys": [
  1458. ],
  1459. "path": "collection/key2"
  1460. }
  1461. }
  1462. ]
  1463. },
  1464. {
  1465. "failDatabase": [
  1466. "Release target",
  1467. "Get last remote snapshot version"
  1468. ]
  1469. },
  1470. {
  1471. "watchRemove": {
  1472. "cause": {
  1473. "code": 7
  1474. },
  1475. "targetIds": [
  1476. 2
  1477. ]
  1478. },
  1479. "expectedSnapshotEvents": [
  1480. {
  1481. "errorCode": 7,
  1482. "fromCache": false,
  1483. "hasPendingWrites": false,
  1484. "query": {
  1485. "filters": [
  1486. ],
  1487. "orderBys": [
  1488. ],
  1489. "path": "collection/key1"
  1490. }
  1491. }
  1492. ],
  1493. "expectedState": {
  1494. "activeTargets": {
  1495. "4": {
  1496. "queries": [
  1497. {
  1498. "filters": [
  1499. ],
  1500. "orderBys": [
  1501. ],
  1502. "path": "collection/key2"
  1503. }
  1504. ],
  1505. "resumeToken": ""
  1506. }
  1507. }
  1508. }
  1509. },
  1510. {
  1511. "failDatabase": false
  1512. },
  1513. {
  1514. "watchRemove": {
  1515. "cause": {
  1516. "code": 7
  1517. },
  1518. "targetIds": [
  1519. 4
  1520. ]
  1521. },
  1522. "expectedSnapshotEvents": [
  1523. {
  1524. "errorCode": 7,
  1525. "fromCache": false,
  1526. "hasPendingWrites": false,
  1527. "query": {
  1528. "filters": [
  1529. ],
  1530. "orderBys": [
  1531. ],
  1532. "path": "collection/key2"
  1533. }
  1534. }
  1535. ],
  1536. "expectedState": {
  1537. "activeTargets": {
  1538. }
  1539. }
  1540. },
  1541. {
  1542. "userListen": {
  1543. "query": {
  1544. "filters": [
  1545. ],
  1546. "orderBys": [
  1547. ],
  1548. "path": "collection/key1"
  1549. },
  1550. "targetId": 2
  1551. },
  1552. "expectedSnapshotEvents": [
  1553. {
  1554. "added": [
  1555. {
  1556. "key": "collection/key1",
  1557. "options": {
  1558. "hasCommittedMutations": false,
  1559. "hasLocalMutations": false
  1560. },
  1561. "value": {
  1562. "foo": "a"
  1563. },
  1564. "version": 1000
  1565. }
  1566. ],
  1567. "errorCode": 0,
  1568. "fromCache": true,
  1569. "hasPendingWrites": false,
  1570. "query": {
  1571. "filters": [
  1572. ],
  1573. "orderBys": [
  1574. ],
  1575. "path": "collection/key1"
  1576. }
  1577. }
  1578. ],
  1579. "expectedState": {
  1580. "activeTargets": {
  1581. "2": {
  1582. "queries": [
  1583. {
  1584. "filters": [
  1585. ],
  1586. "orderBys": [
  1587. ],
  1588. "path": "collection/key1"
  1589. }
  1590. ],
  1591. "resumeToken": "resume-token-1000"
  1592. }
  1593. }
  1594. }
  1595. },
  1596. {
  1597. "watchAck": [
  1598. 2
  1599. ]
  1600. },
  1601. {
  1602. "watchEntity": {
  1603. "docs": [
  1604. {
  1605. "key": "collection/key1",
  1606. "options": {
  1607. "hasCommittedMutations": false,
  1608. "hasLocalMutations": false
  1609. },
  1610. "value": {
  1611. "foo": "a",
  1612. "updated": true
  1613. },
  1614. "version": 4000
  1615. }
  1616. ],
  1617. "targets": [
  1618. 2
  1619. ]
  1620. }
  1621. },
  1622. {
  1623. "watchCurrent": [
  1624. [
  1625. 2
  1626. ],
  1627. "resume-token-4000"
  1628. ]
  1629. },
  1630. {
  1631. "watchSnapshot": {
  1632. "targetIds": [
  1633. ],
  1634. "version": 4000
  1635. },
  1636. "expectedSnapshotEvents": [
  1637. {
  1638. "errorCode": 0,
  1639. "fromCache": false,
  1640. "hasPendingWrites": false,
  1641. "modified": [
  1642. {
  1643. "key": "collection/key1",
  1644. "options": {
  1645. "hasCommittedMutations": false,
  1646. "hasLocalMutations": false
  1647. },
  1648. "value": {
  1649. "foo": "a",
  1650. "updated": true
  1651. },
  1652. "version": 4000
  1653. }
  1654. ],
  1655. "query": {
  1656. "filters": [
  1657. ],
  1658. "orderBys": [
  1659. ],
  1660. "path": "collection/key1"
  1661. }
  1662. }
  1663. ]
  1664. }
  1665. ]
  1666. },
  1667. "Ignores intermittent lease refresh failures (with recovery)": {
  1668. "describeName": "Persistence Recovery",
  1669. "itName": "Ignores intermittent lease refresh failures (with recovery)",
  1670. "tags": [
  1671. "multi-client",
  1672. "no-ios",
  1673. "no-android"
  1674. ],
  1675. "config": {
  1676. "numClients": 2,
  1677. "useGarbageCollection": false
  1678. },
  1679. "steps": [
  1680. {
  1681. "clientIndex": 0,
  1682. "drainQueue": true,
  1683. "expectedState": {
  1684. "isPrimary": true
  1685. }
  1686. },
  1687. {
  1688. "clientIndex": 1,
  1689. "drainQueue": true,
  1690. "expectedState": {
  1691. "isPrimary": false
  1692. }
  1693. },
  1694. {
  1695. "clientIndex": 0,
  1696. "drainQueue": true
  1697. },
  1698. {
  1699. "clientIndex": 0,
  1700. "failDatabase": [
  1701. "updateClientMetadataAndTryBecomePrimary"
  1702. ]
  1703. },
  1704. {
  1705. "clientIndex": 0,
  1706. "runTimer": "client_metadata_refresh"
  1707. },
  1708. {
  1709. "clientIndex": 1,
  1710. "drainQueue": true
  1711. },
  1712. {
  1713. "clientIndex": 1,
  1714. "failDatabase": [
  1715. "updateClientMetadataAndTryBecomePrimary"
  1716. ]
  1717. },
  1718. {
  1719. "clientIndex": 1,
  1720. "runTimer": "client_metadata_refresh"
  1721. },
  1722. {
  1723. "clientIndex": 0,
  1724. "drainQueue": true
  1725. },
  1726. {
  1727. "clientIndex": 0,
  1728. "failDatabase": false
  1729. },
  1730. {
  1731. "clientIndex": 0,
  1732. "runTimer": "client_metadata_refresh",
  1733. "expectedState": {
  1734. "isPrimary": true
  1735. }
  1736. },
  1737. {
  1738. "clientIndex": 1,
  1739. "drainQueue": true
  1740. },
  1741. {
  1742. "clientIndex": 1,
  1743. "failDatabase": false
  1744. },
  1745. {
  1746. "clientIndex": 1,
  1747. "runTimer": "client_metadata_refresh",
  1748. "expectedState": {
  1749. "isPrimary": false
  1750. }
  1751. },
  1752. {
  1753. "clientIndex": 1,
  1754. "drainQueue": true
  1755. },
  1756. {
  1757. "clientIndex": 1,
  1758. "failDatabase": [
  1759. "updateClientMetadataAndTryBecomePrimary"
  1760. ]
  1761. },
  1762. {
  1763. "clientIndex": 1,
  1764. "runTimer": "client_metadata_refresh"
  1765. },
  1766. {
  1767. "clientIndex": 0,
  1768. "drainQueue": true
  1769. },
  1770. {
  1771. "clientIndex": 0,
  1772. "failDatabase": [
  1773. "updateClientMetadataAndTryBecomePrimary"
  1774. ]
  1775. },
  1776. {
  1777. "clientIndex": 0,
  1778. "runTimer": "client_metadata_refresh"
  1779. },
  1780. {
  1781. "clientIndex": 1,
  1782. "drainQueue": true
  1783. },
  1784. {
  1785. "clientIndex": 1,
  1786. "failDatabase": false
  1787. },
  1788. {
  1789. "clientIndex": 1,
  1790. "runTimer": "client_metadata_refresh",
  1791. "expectedState": {
  1792. "isPrimary": false
  1793. }
  1794. },
  1795. {
  1796. "clientIndex": 0,
  1797. "drainQueue": true
  1798. },
  1799. {
  1800. "clientIndex": 0,
  1801. "failDatabase": false
  1802. },
  1803. {
  1804. "clientIndex": 0,
  1805. "runTimer": "client_metadata_refresh",
  1806. "expectedState": {
  1807. "isPrimary": true
  1808. }
  1809. }
  1810. ]
  1811. },
  1812. "Multiple user changes during transaction failure (with recovery)": {
  1813. "describeName": "Persistence Recovery",
  1814. "itName": "Multiple user changes during transaction failure (with recovery)",
  1815. "tags": [
  1816. "durable-persistence",
  1817. "no-ios",
  1818. "no-android"
  1819. ],
  1820. "config": {
  1821. "numClients": 1,
  1822. "useGarbageCollection": true
  1823. },
  1824. "steps": [
  1825. {
  1826. "changeUser": "user1"
  1827. },
  1828. {
  1829. "userSet": [
  1830. "collection/key1",
  1831. {
  1832. "foo": "a"
  1833. }
  1834. ]
  1835. },
  1836. {
  1837. "userListen": {
  1838. "query": {
  1839. "filters": [
  1840. ],
  1841. "orderBys": [
  1842. ],
  1843. "path": "collection"
  1844. },
  1845. "targetId": 2
  1846. },
  1847. "expectedSnapshotEvents": [
  1848. {
  1849. "added": [
  1850. {
  1851. "key": "collection/key1",
  1852. "options": {
  1853. "hasCommittedMutations": false,
  1854. "hasLocalMutations": true
  1855. },
  1856. "value": {
  1857. "foo": "a"
  1858. },
  1859. "version": 0
  1860. }
  1861. ],
  1862. "errorCode": 0,
  1863. "fromCache": true,
  1864. "hasPendingWrites": true,
  1865. "query": {
  1866. "filters": [
  1867. ],
  1868. "orderBys": [
  1869. ],
  1870. "path": "collection"
  1871. }
  1872. }
  1873. ],
  1874. "expectedState": {
  1875. "activeTargets": {
  1876. "2": {
  1877. "queries": [
  1878. {
  1879. "filters": [
  1880. ],
  1881. "orderBys": [
  1882. ],
  1883. "path": "collection"
  1884. }
  1885. ],
  1886. "resumeToken": ""
  1887. }
  1888. }
  1889. }
  1890. },
  1891. {
  1892. "failDatabase": [
  1893. "Handle user change"
  1894. ]
  1895. },
  1896. {
  1897. "changeUser": "user2",
  1898. "expectedState": {
  1899. "activeTargets": {
  1900. }
  1901. }
  1902. },
  1903. {
  1904. "changeUser": "user1"
  1905. },
  1906. {
  1907. "failDatabase": false
  1908. },
  1909. {
  1910. "runTimer": "async_queue_retry",
  1911. "expectedSnapshotEvents": [
  1912. {
  1913. "errorCode": 0,
  1914. "fromCache": true,
  1915. "hasPendingWrites": false,
  1916. "query": {
  1917. "filters": [
  1918. ],
  1919. "orderBys": [
  1920. ],
  1921. "path": "collection"
  1922. },
  1923. "removed": [
  1924. {
  1925. "key": "collection/key1",
  1926. "options": {
  1927. "hasCommittedMutations": false,
  1928. "hasLocalMutations": true
  1929. },
  1930. "value": {
  1931. "foo": "a"
  1932. },
  1933. "version": 0
  1934. }
  1935. ]
  1936. }
  1937. ],
  1938. "expectedState": {
  1939. "activeTargets": {
  1940. "2": {
  1941. "queries": [
  1942. {
  1943. "filters": [
  1944. ],
  1945. "orderBys": [
  1946. ],
  1947. "path": "collection"
  1948. }
  1949. ],
  1950. "resumeToken": ""
  1951. }
  1952. }
  1953. }
  1954. },
  1955. {
  1956. "runTimer": "async_queue_retry",
  1957. "expectedSnapshotEvents": [
  1958. {
  1959. "added": [
  1960. {
  1961. "key": "collection/key1",
  1962. "options": {
  1963. "hasCommittedMutations": false,
  1964. "hasLocalMutations": true
  1965. },
  1966. "value": {
  1967. "foo": "a"
  1968. },
  1969. "version": 0
  1970. }
  1971. ],
  1972. "errorCode": 0,
  1973. "fromCache": true,
  1974. "hasPendingWrites": true,
  1975. "query": {
  1976. "filters": [
  1977. ],
  1978. "orderBys": [
  1979. ],
  1980. "path": "collection"
  1981. }
  1982. }
  1983. ]
  1984. }
  1985. ]
  1986. },
  1987. "Query is listened to by primary (with recovery)": {
  1988. "describeName": "Persistence Recovery",
  1989. "itName": "Query is listened to by primary (with recovery)",
  1990. "tags": [
  1991. "multi-client",
  1992. "no-ios",
  1993. "no-android"
  1994. ],
  1995. "config": {
  1996. "numClients": 2,
  1997. "useGarbageCollection": false
  1998. },
  1999. "steps": [
  2000. {
  2001. "clientIndex": 0,
  2002. "drainQueue": true,
  2003. "expectedState": {
  2004. "isPrimary": true
  2005. }
  2006. },
  2007. {
  2008. "clientIndex": 0,
  2009. "failDatabase": [
  2010. "Allocate target",
  2011. "Get target data"
  2012. ]
  2013. },
  2014. {
  2015. "clientIndex": 1,
  2016. "drainQueue": true
  2017. },
  2018. {
  2019. "clientIndex": 1,
  2020. "userListen": {
  2021. "query": {
  2022. "filters": [
  2023. ],
  2024. "orderBys": [
  2025. ],
  2026. "path": "collection"
  2027. },
  2028. "targetId": 2
  2029. },
  2030. "expectedState": {
  2031. "activeTargets": {
  2032. "2": {
  2033. "queries": [
  2034. {
  2035. "filters": [
  2036. ],
  2037. "orderBys": [
  2038. ],
  2039. "path": "collection"
  2040. }
  2041. ],
  2042. "resumeToken": ""
  2043. }
  2044. }
  2045. }
  2046. },
  2047. {
  2048. "clientIndex": 0,
  2049. "drainQueue": true
  2050. },
  2051. {
  2052. "clientIndex": 0,
  2053. "failDatabase": false
  2054. },
  2055. {
  2056. "clientIndex": 0,
  2057. "runTimer": "async_queue_retry",
  2058. "expectedState": {
  2059. "activeTargets": {
  2060. "2": {
  2061. "queries": [
  2062. {
  2063. "filters": [
  2064. ],
  2065. "orderBys": [
  2066. ],
  2067. "path": "collection"
  2068. }
  2069. ],
  2070. "resumeToken": ""
  2071. }
  2072. }
  2073. }
  2074. },
  2075. {
  2076. "clientIndex": 0,
  2077. "failDatabase": [
  2078. "Release target"
  2079. ]
  2080. },
  2081. {
  2082. "clientIndex": 1,
  2083. "drainQueue": true
  2084. },
  2085. {
  2086. "clientIndex": 1,
  2087. "userUnlisten": [
  2088. 2,
  2089. {
  2090. "filters": [
  2091. ],
  2092. "orderBys": [
  2093. ],
  2094. "path": "collection"
  2095. }
  2096. ],
  2097. "expectedState": {
  2098. "activeTargets": {
  2099. }
  2100. }
  2101. },
  2102. {
  2103. "clientIndex": 0,
  2104. "drainQueue": true,
  2105. "expectedState": {
  2106. "activeTargets": {
  2107. "2": {
  2108. "queries": [
  2109. {
  2110. "filters": [
  2111. ],
  2112. "orderBys": [
  2113. ],
  2114. "path": "collection"
  2115. }
  2116. ],
  2117. "resumeToken": ""
  2118. }
  2119. }
  2120. }
  2121. },
  2122. {
  2123. "clientIndex": 0,
  2124. "failDatabase": false
  2125. },
  2126. {
  2127. "clientIndex": 0,
  2128. "runTimer": "async_queue_retry",
  2129. "expectedState": {
  2130. "activeTargets": {
  2131. }
  2132. }
  2133. }
  2134. ]
  2135. },
  2136. "Query raises events in secondary client (with recovery)": {
  2137. "describeName": "Persistence Recovery",
  2138. "itName": "Query raises events in secondary client (with recovery)",
  2139. "tags": [
  2140. "multi-client",
  2141. "no-ios",
  2142. "no-android"
  2143. ],
  2144. "config": {
  2145. "numClients": 2,
  2146. "useGarbageCollection": false
  2147. },
  2148. "steps": [
  2149. {
  2150. "clientIndex": 0,
  2151. "drainQueue": true,
  2152. "expectedState": {
  2153. "isPrimary": true
  2154. }
  2155. },
  2156. {
  2157. "clientIndex": 1,
  2158. "drainQueue": true,
  2159. "expectedState": {
  2160. "isPrimary": false
  2161. }
  2162. },
  2163. {
  2164. "clientIndex": 1,
  2165. "userListen": {
  2166. "query": {
  2167. "filters": [
  2168. ],
  2169. "orderBys": [
  2170. ],
  2171. "path": "collection"
  2172. },
  2173. "targetId": 2
  2174. },
  2175. "expectedState": {
  2176. "activeTargets": {
  2177. "2": {
  2178. "queries": [
  2179. {
  2180. "filters": [
  2181. ],
  2182. "orderBys": [
  2183. ],
  2184. "path": "collection"
  2185. }
  2186. ],
  2187. "resumeToken": ""
  2188. }
  2189. }
  2190. }
  2191. },
  2192. {
  2193. "clientIndex": 1,
  2194. "failDatabase": [
  2195. "Get new document changes"
  2196. ]
  2197. },
  2198. {
  2199. "clientIndex": 0,
  2200. "drainQueue": true,
  2201. "expectedState": {
  2202. "activeTargets": {
  2203. "2": {
  2204. "queries": [
  2205. {
  2206. "filters": [
  2207. ],
  2208. "orderBys": [
  2209. ],
  2210. "path": "collection"
  2211. }
  2212. ],
  2213. "resumeToken": ""
  2214. }
  2215. }
  2216. }
  2217. },
  2218. {
  2219. "clientIndex": 0,
  2220. "watchAck": [
  2221. 2
  2222. ]
  2223. },
  2224. {
  2225. "clientIndex": 0,
  2226. "watchEntity": {
  2227. "docs": [
  2228. {
  2229. "key": "collection/doc",
  2230. "options": {
  2231. "hasCommittedMutations": false,
  2232. "hasLocalMutations": false
  2233. },
  2234. "value": {
  2235. "foo": "a"
  2236. },
  2237. "version": 1
  2238. }
  2239. ],
  2240. "targets": [
  2241. 2
  2242. ]
  2243. }
  2244. },
  2245. {
  2246. "clientIndex": 0,
  2247. "watchCurrent": [
  2248. [
  2249. 2
  2250. ],
  2251. "resume-token-1000"
  2252. ]
  2253. },
  2254. {
  2255. "clientIndex": 0,
  2256. "watchSnapshot": {
  2257. "targetIds": [
  2258. ],
  2259. "version": 1000
  2260. }
  2261. },
  2262. {
  2263. "clientIndex": 1,
  2264. "drainQueue": true
  2265. },
  2266. {
  2267. "clientIndex": 1,
  2268. "failDatabase": false
  2269. },
  2270. {
  2271. "clientIndex": 1,
  2272. "runTimer": "async_queue_retry",
  2273. "expectedSnapshotEvents": [
  2274. {
  2275. "added": [
  2276. {
  2277. "key": "collection/doc",
  2278. "options": {
  2279. "hasCommittedMutations": false,
  2280. "hasLocalMutations": false
  2281. },
  2282. "value": {
  2283. "foo": "a"
  2284. },
  2285. "version": 1
  2286. }
  2287. ],
  2288. "errorCode": 0,
  2289. "fromCache": false,
  2290. "hasPendingWrites": false,
  2291. "query": {
  2292. "filters": [
  2293. ],
  2294. "orderBys": [
  2295. ],
  2296. "path": "collection"
  2297. }
  2298. }
  2299. ]
  2300. }
  2301. ]
  2302. },
  2303. "Query with active view recovers after primary tab failover (with recovery)": {
  2304. "describeName": "Persistence Recovery",
  2305. "itName": "Query with active view recovers after primary tab failover (with recovery)",
  2306. "tags": [
  2307. "multi-client",
  2308. "no-ios",
  2309. "no-android"
  2310. ],
  2311. "config": {
  2312. "numClients": 2,
  2313. "useGarbageCollection": false
  2314. },
  2315. "steps": [
  2316. {
  2317. "clientIndex": 0,
  2318. "drainQueue": true,
  2319. "expectedState": {
  2320. "isPrimary": true
  2321. }
  2322. },
  2323. {
  2324. "clientIndex": 1,
  2325. "drainQueue": true
  2326. },
  2327. {
  2328. "clientIndex": 1,
  2329. "userListen": {
  2330. "query": {
  2331. "filters": [
  2332. ],
  2333. "orderBys": [
  2334. ],
  2335. "path": "collection"
  2336. },
  2337. "targetId": 2
  2338. },
  2339. "expectedState": {
  2340. "activeTargets": {
  2341. "2": {
  2342. "queries": [
  2343. {
  2344. "filters": [
  2345. ],
  2346. "orderBys": [
  2347. ],
  2348. "path": "collection"
  2349. }
  2350. ],
  2351. "resumeToken": ""
  2352. }
  2353. }
  2354. }
  2355. },
  2356. {
  2357. "clientIndex": 0,
  2358. "drainQueue": true,
  2359. "expectedState": {
  2360. "activeTargets": {
  2361. "2": {
  2362. "queries": [
  2363. {
  2364. "filters": [
  2365. ],
  2366. "orderBys": [
  2367. ],
  2368. "path": "collection"
  2369. }
  2370. ],
  2371. "resumeToken": ""
  2372. }
  2373. }
  2374. }
  2375. },
  2376. {
  2377. "clientIndex": 0,
  2378. "watchAck": [
  2379. 2
  2380. ]
  2381. },
  2382. {
  2383. "clientIndex": 0,
  2384. "watchEntity": {
  2385. "docs": [
  2386. {
  2387. "key": "collection/a",
  2388. "options": {
  2389. "hasCommittedMutations": false,
  2390. "hasLocalMutations": false
  2391. },
  2392. "value": {
  2393. "key": "a"
  2394. },
  2395. "version": 1000
  2396. }
  2397. ],
  2398. "targets": [
  2399. 2
  2400. ]
  2401. }
  2402. },
  2403. {
  2404. "clientIndex": 0,
  2405. "watchCurrent": [
  2406. [
  2407. 2
  2408. ],
  2409. "resume-token-1000"
  2410. ]
  2411. },
  2412. {
  2413. "clientIndex": 0,
  2414. "watchSnapshot": {
  2415. "targetIds": [
  2416. ],
  2417. "version": 1000
  2418. }
  2419. },
  2420. {
  2421. "clientIndex": 0,
  2422. "shutdown": true,
  2423. "expectedState": {
  2424. "activeLimboDocs": [
  2425. ],
  2426. "activeTargets": {
  2427. },
  2428. "enqueuedLimboDocs": [
  2429. ]
  2430. }
  2431. },
  2432. {
  2433. "clientIndex": 1,
  2434. "drainQueue": true,
  2435. "expectedSnapshotEvents": [
  2436. {
  2437. "added": [
  2438. {
  2439. "key": "collection/a",
  2440. "options": {
  2441. "hasCommittedMutations": false,
  2442. "hasLocalMutations": false
  2443. },
  2444. "value": {
  2445. "key": "a"
  2446. },
  2447. "version": 1000
  2448. }
  2449. ],
  2450. "errorCode": 0,
  2451. "fromCache": false,
  2452. "hasPendingWrites": false,
  2453. "query": {
  2454. "filters": [
  2455. ],
  2456. "orderBys": [
  2457. ],
  2458. "path": "collection"
  2459. }
  2460. }
  2461. ]
  2462. },
  2463. {
  2464. "clientIndex": 1,
  2465. "failDatabase": [
  2466. "Allocate target"
  2467. ]
  2468. },
  2469. {
  2470. "clientIndex": 1,
  2471. "runTimer": "client_metadata_refresh",
  2472. "expectedState": {
  2473. "isPrimary": false
  2474. }
  2475. },
  2476. {
  2477. "clientIndex": 1,
  2478. "failDatabase": false
  2479. },
  2480. {
  2481. "clientIndex": 1,
  2482. "runTimer": "async_queue_retry",
  2483. "expectedState": {
  2484. "activeTargets": {
  2485. "2": {
  2486. "queries": [
  2487. {
  2488. "filters": [
  2489. ],
  2490. "orderBys": [
  2491. ],
  2492. "path": "collection"
  2493. }
  2494. ],
  2495. "resumeToken": "resume-token-1000"
  2496. }
  2497. },
  2498. "isPrimary": true
  2499. }
  2500. },
  2501. {
  2502. "clientIndex": 1,
  2503. "watchAck": [
  2504. 2
  2505. ]
  2506. },
  2507. {
  2508. "clientIndex": 1,
  2509. "watchEntity": {
  2510. "docs": [
  2511. {
  2512. "key": "collection/b",
  2513. "options": {
  2514. "hasCommittedMutations": false,
  2515. "hasLocalMutations": false
  2516. },
  2517. "value": {
  2518. "key": "b"
  2519. },
  2520. "version": 2000
  2521. }
  2522. ],
  2523. "targets": [
  2524. 2
  2525. ]
  2526. }
  2527. },
  2528. {
  2529. "clientIndex": 1,
  2530. "watchCurrent": [
  2531. [
  2532. 2
  2533. ],
  2534. "resume-token-2000"
  2535. ]
  2536. },
  2537. {
  2538. "clientIndex": 1,
  2539. "watchSnapshot": {
  2540. "targetIds": [
  2541. ],
  2542. "version": 2000
  2543. },
  2544. "expectedSnapshotEvents": [
  2545. {
  2546. "added": [
  2547. {
  2548. "key": "collection/b",
  2549. "options": {
  2550. "hasCommittedMutations": false,
  2551. "hasLocalMutations": false
  2552. },
  2553. "value": {
  2554. "key": "b"
  2555. },
  2556. "version": 2000
  2557. }
  2558. ],
  2559. "errorCode": 0,
  2560. "fromCache": false,
  2561. "hasPendingWrites": false,
  2562. "query": {
  2563. "filters": [
  2564. ],
  2565. "orderBys": [
  2566. ],
  2567. "path": "collection"
  2568. }
  2569. }
  2570. ]
  2571. }
  2572. ]
  2573. },
  2574. "Query without active view recovers after primary tab failover (with recovery)": {
  2575. "describeName": "Persistence Recovery",
  2576. "itName": "Query without active view recovers after primary tab failover (with recovery)",
  2577. "tags": [
  2578. "multi-client",
  2579. "no-ios",
  2580. "no-android"
  2581. ],
  2582. "config": {
  2583. "numClients": 3,
  2584. "useGarbageCollection": false
  2585. },
  2586. "steps": [
  2587. {
  2588. "clientIndex": 0,
  2589. "drainQueue": true,
  2590. "expectedState": {
  2591. "isPrimary": true
  2592. }
  2593. },
  2594. {
  2595. "clientIndex": 1,
  2596. "drainQueue": true
  2597. },
  2598. {
  2599. "clientIndex": 2,
  2600. "drainQueue": true
  2601. },
  2602. {
  2603. "clientIndex": 2,
  2604. "userListen": {
  2605. "query": {
  2606. "filters": [
  2607. ],
  2608. "orderBys": [
  2609. ],
  2610. "path": "collection"
  2611. },
  2612. "targetId": 2
  2613. },
  2614. "expectedState": {
  2615. "activeTargets": {
  2616. "2": {
  2617. "queries": [
  2618. {
  2619. "filters": [
  2620. ],
  2621. "orderBys": [
  2622. ],
  2623. "path": "collection"
  2624. }
  2625. ],
  2626. "resumeToken": ""
  2627. }
  2628. }
  2629. }
  2630. },
  2631. {
  2632. "clientIndex": 0,
  2633. "drainQueue": true,
  2634. "expectedState": {
  2635. "activeTargets": {
  2636. "2": {
  2637. "queries": [
  2638. {
  2639. "filters": [
  2640. ],
  2641. "orderBys": [
  2642. ],
  2643. "path": "collection"
  2644. }
  2645. ],
  2646. "resumeToken": ""
  2647. }
  2648. }
  2649. }
  2650. },
  2651. {
  2652. "clientIndex": 0,
  2653. "watchAck": [
  2654. 2
  2655. ]
  2656. },
  2657. {
  2658. "clientIndex": 0,
  2659. "watchEntity": {
  2660. "docs": [
  2661. {
  2662. "key": "collection/a",
  2663. "options": {
  2664. "hasCommittedMutations": false,
  2665. "hasLocalMutations": false
  2666. },
  2667. "value": {
  2668. "key": "a"
  2669. },
  2670. "version": 1000
  2671. }
  2672. ],
  2673. "targets": [
  2674. 2
  2675. ]
  2676. }
  2677. },
  2678. {
  2679. "clientIndex": 0,
  2680. "watchCurrent": [
  2681. [
  2682. 2
  2683. ],
  2684. "resume-token-1000"
  2685. ]
  2686. },
  2687. {
  2688. "clientIndex": 0,
  2689. "watchSnapshot": {
  2690. "targetIds": [
  2691. ],
  2692. "version": 1000
  2693. }
  2694. },
  2695. {
  2696. "clientIndex": 2,
  2697. "drainQueue": true,
  2698. "expectedSnapshotEvents": [
  2699. {
  2700. "added": [
  2701. {
  2702. "key": "collection/a",
  2703. "options": {
  2704. "hasCommittedMutations": false,
  2705. "hasLocalMutations": false
  2706. },
  2707. "value": {
  2708. "key": "a"
  2709. },
  2710. "version": 1000
  2711. }
  2712. ],
  2713. "errorCode": 0,
  2714. "fromCache": false,
  2715. "hasPendingWrites": false,
  2716. "query": {
  2717. "filters": [
  2718. ],
  2719. "orderBys": [
  2720. ],
  2721. "path": "collection"
  2722. }
  2723. }
  2724. ]
  2725. },
  2726. {
  2727. "clientIndex": 0,
  2728. "drainQueue": true
  2729. },
  2730. {
  2731. "clientIndex": 0,
  2732. "shutdown": true,
  2733. "expectedState": {
  2734. "activeLimboDocs": [
  2735. ],
  2736. "activeTargets": {
  2737. },
  2738. "enqueuedLimboDocs": [
  2739. ]
  2740. }
  2741. },
  2742. {
  2743. "clientIndex": 1,
  2744. "drainQueue": true
  2745. },
  2746. {
  2747. "clientIndex": 1,
  2748. "failDatabase": [
  2749. "Allocate target"
  2750. ]
  2751. },
  2752. {
  2753. "clientIndex": 1,
  2754. "runTimer": "client_metadata_refresh",
  2755. "expectedState": {
  2756. "isPrimary": false
  2757. }
  2758. },
  2759. {
  2760. "clientIndex": 1,
  2761. "failDatabase": false
  2762. },
  2763. {
  2764. "clientIndex": 1,
  2765. "runTimer": "async_queue_retry",
  2766. "expectedState": {
  2767. "activeTargets": {
  2768. "2": {
  2769. "queries": [
  2770. {
  2771. "filters": [
  2772. ],
  2773. "orderBys": [
  2774. ],
  2775. "path": "collection"
  2776. }
  2777. ],
  2778. "resumeToken": "resume-token-1000"
  2779. }
  2780. },
  2781. "isPrimary": true
  2782. }
  2783. },
  2784. {
  2785. "clientIndex": 1,
  2786. "watchAck": [
  2787. 2
  2788. ]
  2789. },
  2790. {
  2791. "clientIndex": 1,
  2792. "watchEntity": {
  2793. "docs": [
  2794. {
  2795. "key": "collection/b",
  2796. "options": {
  2797. "hasCommittedMutations": false,
  2798. "hasLocalMutations": false
  2799. },
  2800. "value": {
  2801. "key": "b"
  2802. },
  2803. "version": 2000
  2804. }
  2805. ],
  2806. "targets": [
  2807. 2
  2808. ]
  2809. }
  2810. },
  2811. {
  2812. "clientIndex": 1,
  2813. "watchCurrent": [
  2814. [
  2815. 2
  2816. ],
  2817. "resume-token-2000"
  2818. ]
  2819. },
  2820. {
  2821. "clientIndex": 1,
  2822. "watchSnapshot": {
  2823. "targetIds": [
  2824. ],
  2825. "version": 2000
  2826. }
  2827. },
  2828. {
  2829. "clientIndex": 2,
  2830. "drainQueue": true,
  2831. "expectedSnapshotEvents": [
  2832. {
  2833. "added": [
  2834. {
  2835. "key": "collection/b",
  2836. "options": {
  2837. "hasCommittedMutations": false,
  2838. "hasLocalMutations": false
  2839. },
  2840. "value": {
  2841. "key": "b"
  2842. },
  2843. "version": 2000
  2844. }
  2845. ],
  2846. "errorCode": 0,
  2847. "fromCache": false,
  2848. "hasPendingWrites": false,
  2849. "query": {
  2850. "filters": [
  2851. ],
  2852. "orderBys": [
  2853. ],
  2854. "path": "collection"
  2855. }
  2856. }
  2857. ]
  2858. }
  2859. ]
  2860. },
  2861. "Recovers when Limbo acknowledgement cannot be persisted": {
  2862. "describeName": "Persistence Recovery",
  2863. "itName": "Recovers when Limbo acknowledgement cannot be persisted",
  2864. "tags": [
  2865. "no-ios",
  2866. "no-android"
  2867. ],
  2868. "config": {
  2869. "numClients": 1,
  2870. "useGarbageCollection": false
  2871. },
  2872. "steps": [
  2873. {
  2874. "userListen": {
  2875. "query": {
  2876. "filters": [
  2877. ],
  2878. "orderBys": [
  2879. ],
  2880. "path": "collection"
  2881. },
  2882. "targetId": 2
  2883. },
  2884. "expectedState": {
  2885. "activeTargets": {
  2886. "2": {
  2887. "queries": [
  2888. {
  2889. "filters": [
  2890. ],
  2891. "orderBys": [
  2892. ],
  2893. "path": "collection"
  2894. }
  2895. ],
  2896. "resumeToken": ""
  2897. }
  2898. }
  2899. }
  2900. },
  2901. {
  2902. "watchAck": [
  2903. 2
  2904. ]
  2905. },
  2906. {
  2907. "watchEntity": {
  2908. "docs": [
  2909. {
  2910. "key": "collection/key1",
  2911. "options": {
  2912. "hasCommittedMutations": false,
  2913. "hasLocalMutations": false
  2914. },
  2915. "value": {
  2916. "included": true
  2917. },
  2918. "version": 1
  2919. }
  2920. ],
  2921. "targets": [
  2922. 2
  2923. ]
  2924. }
  2925. },
  2926. {
  2927. "watchCurrent": [
  2928. [
  2929. 2
  2930. ],
  2931. "resume-token-1000"
  2932. ]
  2933. },
  2934. {
  2935. "watchSnapshot": {
  2936. "targetIds": [
  2937. ],
  2938. "version": 1000
  2939. },
  2940. "expectedSnapshotEvents": [
  2941. {
  2942. "added": [
  2943. {
  2944. "key": "collection/key1",
  2945. "options": {
  2946. "hasCommittedMutations": false,
  2947. "hasLocalMutations": false
  2948. },
  2949. "value": {
  2950. "included": true
  2951. },
  2952. "version": 1
  2953. }
  2954. ],
  2955. "errorCode": 0,
  2956. "fromCache": false,
  2957. "hasPendingWrites": false,
  2958. "query": {
  2959. "filters": [
  2960. ],
  2961. "orderBys": [
  2962. ],
  2963. "path": "collection"
  2964. }
  2965. }
  2966. ]
  2967. },
  2968. {
  2969. "userUnlisten": [
  2970. 2,
  2971. {
  2972. "filters": [
  2973. ],
  2974. "orderBys": [
  2975. ],
  2976. "path": "collection"
  2977. }
  2978. ],
  2979. "expectedState": {
  2980. "activeTargets": {
  2981. }
  2982. }
  2983. },
  2984. {
  2985. "userListen": {
  2986. "query": {
  2987. "filters": [
  2988. [
  2989. "included",
  2990. "==",
  2991. true
  2992. ]
  2993. ],
  2994. "orderBys": [
  2995. ],
  2996. "path": "collection"
  2997. },
  2998. "targetId": 4
  2999. },
  3000. "expectedSnapshotEvents": [
  3001. {
  3002. "added": [
  3003. {
  3004. "key": "collection/key1",
  3005. "options": {
  3006. "hasCommittedMutations": false,
  3007. "hasLocalMutations": false
  3008. },
  3009. "value": {
  3010. "included": true
  3011. },
  3012. "version": 1
  3013. }
  3014. ],
  3015. "errorCode": 0,
  3016. "fromCache": true,
  3017. "hasPendingWrites": false,
  3018. "query": {
  3019. "filters": [
  3020. [
  3021. "included",
  3022. "==",
  3023. true
  3024. ]
  3025. ],
  3026. "orderBys": [
  3027. ],
  3028. "path": "collection"
  3029. }
  3030. }
  3031. ],
  3032. "expectedState": {
  3033. "activeTargets": {
  3034. "4": {
  3035. "queries": [
  3036. {
  3037. "filters": [
  3038. [
  3039. "included",
  3040. "==",
  3041. true
  3042. ]
  3043. ],
  3044. "orderBys": [
  3045. ],
  3046. "path": "collection"
  3047. }
  3048. ],
  3049. "resumeToken": ""
  3050. }
  3051. }
  3052. }
  3053. },
  3054. {
  3055. "watchAck": [
  3056. 4
  3057. ]
  3058. },
  3059. {
  3060. "watchEntity": {
  3061. "docs": [
  3062. ],
  3063. "targets": [
  3064. 4
  3065. ]
  3066. }
  3067. },
  3068. {
  3069. "watchCurrent": [
  3070. [
  3071. 4
  3072. ],
  3073. "resume-token-2000"
  3074. ]
  3075. },
  3076. {
  3077. "watchSnapshot": {
  3078. "targetIds": [
  3079. ],
  3080. "version": 2000
  3081. },
  3082. "expectedState": {
  3083. "activeLimboDocs": [
  3084. "collection/key1"
  3085. ],
  3086. "activeTargets": {
  3087. "1": {
  3088. "queries": [
  3089. {
  3090. "filters": [
  3091. ],
  3092. "orderBys": [
  3093. ],
  3094. "path": "collection/key1"
  3095. }
  3096. ],
  3097. "resumeToken": ""
  3098. },
  3099. "4": {
  3100. "queries": [
  3101. {
  3102. "filters": [
  3103. [
  3104. "included",
  3105. "==",
  3106. true
  3107. ]
  3108. ],
  3109. "orderBys": [
  3110. ],
  3111. "path": "collection"
  3112. }
  3113. ],
  3114. "resumeToken": ""
  3115. }
  3116. }
  3117. }
  3118. },
  3119. {
  3120. "failDatabase": [
  3121. "Get last remote snapshot version"
  3122. ]
  3123. },
  3124. {
  3125. "watchAck": [
  3126. 1
  3127. ]
  3128. },
  3129. {
  3130. "watchEntity": {
  3131. "docs": [
  3132. {
  3133. "key": "collection/key1",
  3134. "options": {
  3135. "hasCommittedMutations": false,
  3136. "hasLocalMutations": false
  3137. },
  3138. "value": {
  3139. "included": false
  3140. },
  3141. "version": 1500
  3142. }
  3143. ],
  3144. "targets": [
  3145. 1
  3146. ]
  3147. }
  3148. },
  3149. {
  3150. "watchCurrent": [
  3151. [
  3152. 1
  3153. ],
  3154. "resume-token-3000"
  3155. ]
  3156. },
  3157. {
  3158. "watchSnapshot": {
  3159. "targetIds": [
  3160. ],
  3161. "version": 3000
  3162. },
  3163. "expectedState": {
  3164. "activeTargets": {
  3165. }
  3166. }
  3167. },
  3168. {
  3169. "failDatabase": false
  3170. },
  3171. {
  3172. "runTimer": "async_queue_retry",
  3173. "expectedState": {
  3174. "activeTargets": {
  3175. "1": {
  3176. "queries": [
  3177. {
  3178. "filters": [
  3179. ],
  3180. "orderBys": [
  3181. ],
  3182. "path": "collection/key1"
  3183. }
  3184. ],
  3185. "resumeToken": ""
  3186. },
  3187. "4": {
  3188. "queries": [
  3189. {
  3190. "filters": [
  3191. [
  3192. "included",
  3193. "==",
  3194. true
  3195. ]
  3196. ],
  3197. "orderBys": [
  3198. ],
  3199. "path": "collection"
  3200. }
  3201. ],
  3202. "resumeToken": "resume-token-2000"
  3203. }
  3204. }
  3205. }
  3206. },
  3207. {
  3208. "watchAck": [
  3209. 4
  3210. ]
  3211. },
  3212. {
  3213. "watchEntity": {
  3214. "docs": [
  3215. ],
  3216. "targets": [
  3217. 4
  3218. ]
  3219. }
  3220. },
  3221. {
  3222. "watchCurrent": [
  3223. [
  3224. 4
  3225. ],
  3226. "resume-token-4000"
  3227. ]
  3228. },
  3229. {
  3230. "watchSnapshot": {
  3231. "targetIds": [
  3232. ],
  3233. "version": 4000
  3234. }
  3235. },
  3236. {
  3237. "watchAck": [
  3238. 1
  3239. ]
  3240. },
  3241. {
  3242. "watchEntity": {
  3243. "docs": [
  3244. {
  3245. "key": "collection/key1",
  3246. "options": {
  3247. "hasCommittedMutations": false,
  3248. "hasLocalMutations": false
  3249. },
  3250. "value": {
  3251. "included": false
  3252. },
  3253. "version": 1500
  3254. }
  3255. ],
  3256. "targets": [
  3257. 1
  3258. ]
  3259. }
  3260. },
  3261. {
  3262. "watchCurrent": [
  3263. [
  3264. 1
  3265. ],
  3266. "resume-token-4000"
  3267. ]
  3268. },
  3269. {
  3270. "watchSnapshot": {
  3271. "targetIds": [
  3272. ],
  3273. "version": 4000
  3274. },
  3275. "expectedSnapshotEvents": [
  3276. {
  3277. "errorCode": 0,
  3278. "fromCache": false,
  3279. "hasPendingWrites": false,
  3280. "query": {
  3281. "filters": [
  3282. [
  3283. "included",
  3284. "==",
  3285. true
  3286. ]
  3287. ],
  3288. "orderBys": [
  3289. ],
  3290. "path": "collection"
  3291. },
  3292. "removed": [
  3293. {
  3294. "key": "collection/key1",
  3295. "options": {
  3296. "hasCommittedMutations": false,
  3297. "hasLocalMutations": false
  3298. },
  3299. "value": {
  3300. "included": true
  3301. },
  3302. "version": 1
  3303. }
  3304. ]
  3305. }
  3306. ],
  3307. "expectedState": {
  3308. "activeLimboDocs": [
  3309. ],
  3310. "activeTargets": {
  3311. "4": {
  3312. "queries": [
  3313. {
  3314. "filters": [
  3315. [
  3316. "included",
  3317. "==",
  3318. true
  3319. ]
  3320. ],
  3321. "orderBys": [
  3322. ],
  3323. "path": "collection"
  3324. }
  3325. ],
  3326. "resumeToken": "resume-token-2000"
  3327. }
  3328. }
  3329. }
  3330. }
  3331. ]
  3332. },
  3333. "Recovers when Limbo rejection cannot be persisted": {
  3334. "describeName": "Persistence Recovery",
  3335. "itName": "Recovers when Limbo rejection cannot be persisted",
  3336. "tags": [
  3337. "no-ios",
  3338. "no-android"
  3339. ],
  3340. "config": {
  3341. "numClients": 1,
  3342. "useGarbageCollection": false
  3343. },
  3344. "steps": [
  3345. {
  3346. "userListen": {
  3347. "query": {
  3348. "filters": [
  3349. ],
  3350. "orderBys": [
  3351. ],
  3352. "path": "collection"
  3353. },
  3354. "targetId": 2
  3355. },
  3356. "expectedState": {
  3357. "activeTargets": {
  3358. "2": {
  3359. "queries": [
  3360. {
  3361. "filters": [
  3362. ],
  3363. "orderBys": [
  3364. ],
  3365. "path": "collection"
  3366. }
  3367. ],
  3368. "resumeToken": ""
  3369. }
  3370. }
  3371. }
  3372. },
  3373. {
  3374. "watchAck": [
  3375. 2
  3376. ]
  3377. },
  3378. {
  3379. "watchEntity": {
  3380. "docs": [
  3381. {
  3382. "key": "collection/key1",
  3383. "options": {
  3384. "hasCommittedMutations": false,
  3385. "hasLocalMutations": false
  3386. },
  3387. "value": {
  3388. "included": true
  3389. },
  3390. "version": 1
  3391. }
  3392. ],
  3393. "targets": [
  3394. 2
  3395. ]
  3396. }
  3397. },
  3398. {
  3399. "watchCurrent": [
  3400. [
  3401. 2
  3402. ],
  3403. "resume-token-1000"
  3404. ]
  3405. },
  3406. {
  3407. "watchSnapshot": {
  3408. "targetIds": [
  3409. ],
  3410. "version": 1000
  3411. },
  3412. "expectedSnapshotEvents": [
  3413. {
  3414. "added": [
  3415. {
  3416. "key": "collection/key1",
  3417. "options": {
  3418. "hasCommittedMutations": false,
  3419. "hasLocalMutations": false
  3420. },
  3421. "value": {
  3422. "included": true
  3423. },
  3424. "version": 1
  3425. }
  3426. ],
  3427. "errorCode": 0,
  3428. "fromCache": false,
  3429. "hasPendingWrites": false,
  3430. "query": {
  3431. "filters": [
  3432. ],
  3433. "orderBys": [
  3434. ],
  3435. "path": "collection"
  3436. }
  3437. }
  3438. ]
  3439. },
  3440. {
  3441. "userUnlisten": [
  3442. 2,
  3443. {
  3444. "filters": [
  3445. ],
  3446. "orderBys": [
  3447. ],
  3448. "path": "collection"
  3449. }
  3450. ],
  3451. "expectedState": {
  3452. "activeTargets": {
  3453. }
  3454. }
  3455. },
  3456. {
  3457. "userListen": {
  3458. "query": {
  3459. "filters": [
  3460. [
  3461. "included",
  3462. "==",
  3463. true
  3464. ]
  3465. ],
  3466. "orderBys": [
  3467. ],
  3468. "path": "collection"
  3469. },
  3470. "targetId": 4
  3471. },
  3472. "expectedSnapshotEvents": [
  3473. {
  3474. "added": [
  3475. {
  3476. "key": "collection/key1",
  3477. "options": {
  3478. "hasCommittedMutations": false,
  3479. "hasLocalMutations": false
  3480. },
  3481. "value": {
  3482. "included": true
  3483. },
  3484. "version": 1
  3485. }
  3486. ],
  3487. "errorCode": 0,
  3488. "fromCache": true,
  3489. "hasPendingWrites": false,
  3490. "query": {
  3491. "filters": [
  3492. [
  3493. "included",
  3494. "==",
  3495. true
  3496. ]
  3497. ],
  3498. "orderBys": [
  3499. ],
  3500. "path": "collection"
  3501. }
  3502. }
  3503. ],
  3504. "expectedState": {
  3505. "activeTargets": {
  3506. "4": {
  3507. "queries": [
  3508. {
  3509. "filters": [
  3510. [
  3511. "included",
  3512. "==",
  3513. true
  3514. ]
  3515. ],
  3516. "orderBys": [
  3517. ],
  3518. "path": "collection"
  3519. }
  3520. ],
  3521. "resumeToken": ""
  3522. }
  3523. }
  3524. }
  3525. },
  3526. {
  3527. "watchAck": [
  3528. 4
  3529. ]
  3530. },
  3531. {
  3532. "watchEntity": {
  3533. "docs": [
  3534. ],
  3535. "targets": [
  3536. 4
  3537. ]
  3538. }
  3539. },
  3540. {
  3541. "watchCurrent": [
  3542. [
  3543. 4
  3544. ],
  3545. "resume-token-2000"
  3546. ]
  3547. },
  3548. {
  3549. "watchSnapshot": {
  3550. "targetIds": [
  3551. ],
  3552. "version": 2000
  3553. },
  3554. "expectedState": {
  3555. "activeLimboDocs": [
  3556. "collection/key1"
  3557. ],
  3558. "activeTargets": {
  3559. "1": {
  3560. "queries": [
  3561. {
  3562. "filters": [
  3563. ],
  3564. "orderBys": [
  3565. ],
  3566. "path": "collection/key1"
  3567. }
  3568. ],
  3569. "resumeToken": ""
  3570. },
  3571. "4": {
  3572. "queries": [
  3573. {
  3574. "filters": [
  3575. [
  3576. "included",
  3577. "==",
  3578. true
  3579. ]
  3580. ],
  3581. "orderBys": [
  3582. ],
  3583. "path": "collection"
  3584. }
  3585. ],
  3586. "resumeToken": ""
  3587. }
  3588. }
  3589. }
  3590. },
  3591. {
  3592. "failDatabase": [
  3593. "Apply remote event",
  3594. "Get last remote snapshot version"
  3595. ]
  3596. },
  3597. {
  3598. "watchRemove": {
  3599. "cause": {
  3600. "code": 7
  3601. },
  3602. "targetIds": [
  3603. 1
  3604. ]
  3605. },
  3606. "expectedState": {
  3607. "activeTargets": {
  3608. }
  3609. }
  3610. },
  3611. {
  3612. "failDatabase": false
  3613. },
  3614. {
  3615. "runTimer": "async_queue_retry",
  3616. "expectedState": {
  3617. "activeTargets": {
  3618. "1": {
  3619. "queries": [
  3620. {
  3621. "filters": [
  3622. ],
  3623. "orderBys": [
  3624. ],
  3625. "path": "collection/key1"
  3626. }
  3627. ],
  3628. "resumeToken": ""
  3629. },
  3630. "4": {
  3631. "queries": [
  3632. {
  3633. "filters": [
  3634. [
  3635. "included",
  3636. "==",
  3637. true
  3638. ]
  3639. ],
  3640. "orderBys": [
  3641. ],
  3642. "path": "collection"
  3643. }
  3644. ],
  3645. "resumeToken": "resume-token-2000"
  3646. }
  3647. }
  3648. }
  3649. },
  3650. {
  3651. "watchAck": [
  3652. 4
  3653. ]
  3654. },
  3655. {
  3656. "watchEntity": {
  3657. "docs": [
  3658. ],
  3659. "targets": [
  3660. 4
  3661. ]
  3662. }
  3663. },
  3664. {
  3665. "watchCurrent": [
  3666. [
  3667. 4
  3668. ],
  3669. "resume-token-3000"
  3670. ]
  3671. },
  3672. {
  3673. "watchSnapshot": {
  3674. "targetIds": [
  3675. ],
  3676. "version": 3000
  3677. }
  3678. },
  3679. {
  3680. "watchRemove": {
  3681. "cause": {
  3682. "code": 7
  3683. },
  3684. "targetIds": [
  3685. 1
  3686. ]
  3687. },
  3688. "expectedSnapshotEvents": [
  3689. {
  3690. "errorCode": 0,
  3691. "fromCache": false,
  3692. "hasPendingWrites": false,
  3693. "query": {
  3694. "filters": [
  3695. [
  3696. "included",
  3697. "==",
  3698. true
  3699. ]
  3700. ],
  3701. "orderBys": [
  3702. ],
  3703. "path": "collection"
  3704. },
  3705. "removed": [
  3706. {
  3707. "key": "collection/key1",
  3708. "options": {
  3709. "hasCommittedMutations": false,
  3710. "hasLocalMutations": false
  3711. },
  3712. "value": {
  3713. "included": true
  3714. },
  3715. "version": 1
  3716. }
  3717. ]
  3718. }
  3719. ],
  3720. "expectedState": {
  3721. "activeLimboDocs": [
  3722. ],
  3723. "activeTargets": {
  3724. "4": {
  3725. "queries": [
  3726. {
  3727. "filters": [
  3728. [
  3729. "included",
  3730. "==",
  3731. true
  3732. ]
  3733. ],
  3734. "orderBys": [
  3735. ],
  3736. "path": "collection"
  3737. }
  3738. ],
  3739. "resumeToken": "resume-token-2000"
  3740. }
  3741. }
  3742. }
  3743. }
  3744. ]
  3745. },
  3746. "Recovers when watch update cannot be persisted": {
  3747. "describeName": "Persistence Recovery",
  3748. "itName": "Recovers when watch update cannot be persisted",
  3749. "tags": [
  3750. "no-ios",
  3751. "no-android"
  3752. ],
  3753. "config": {
  3754. "numClients": 1,
  3755. "useGarbageCollection": false
  3756. },
  3757. "steps": [
  3758. {
  3759. "userListen": {
  3760. "query": {
  3761. "filters": [
  3762. ],
  3763. "orderBys": [
  3764. ],
  3765. "path": "collection"
  3766. },
  3767. "targetId": 2
  3768. },
  3769. "expectedState": {
  3770. "activeTargets": {
  3771. "2": {
  3772. "queries": [
  3773. {
  3774. "filters": [
  3775. ],
  3776. "orderBys": [
  3777. ],
  3778. "path": "collection"
  3779. }
  3780. ],
  3781. "resumeToken": ""
  3782. }
  3783. }
  3784. }
  3785. },
  3786. {
  3787. "watchAck": [
  3788. 2
  3789. ]
  3790. },
  3791. {
  3792. "watchEntity": {
  3793. "docs": [
  3794. {
  3795. "key": "collection/key1",
  3796. "options": {
  3797. "hasCommittedMutations": false,
  3798. "hasLocalMutations": false
  3799. },
  3800. "value": {
  3801. "foo": "a"
  3802. },
  3803. "version": 1000
  3804. }
  3805. ],
  3806. "targets": [
  3807. 2
  3808. ]
  3809. }
  3810. },
  3811. {
  3812. "watchCurrent": [
  3813. [
  3814. 2
  3815. ],
  3816. "resume-token-1000"
  3817. ]
  3818. },
  3819. {
  3820. "watchSnapshot": {
  3821. "targetIds": [
  3822. ],
  3823. "version": 1000
  3824. },
  3825. "expectedSnapshotEvents": [
  3826. {
  3827. "added": [
  3828. {
  3829. "key": "collection/key1",
  3830. "options": {
  3831. "hasCommittedMutations": false,
  3832. "hasLocalMutations": false
  3833. },
  3834. "value": {
  3835. "foo": "a"
  3836. },
  3837. "version": 1000
  3838. }
  3839. ],
  3840. "errorCode": 0,
  3841. "fromCache": false,
  3842. "hasPendingWrites": false,
  3843. "query": {
  3844. "filters": [
  3845. ],
  3846. "orderBys": [
  3847. ],
  3848. "path": "collection"
  3849. }
  3850. }
  3851. ]
  3852. },
  3853. {
  3854. "watchEntity": {
  3855. "docs": [
  3856. {
  3857. "key": "collection/key2",
  3858. "options": {
  3859. "hasCommittedMutations": false,
  3860. "hasLocalMutations": false
  3861. },
  3862. "value": {
  3863. "foo": "b"
  3864. },
  3865. "version": 2000
  3866. }
  3867. ],
  3868. "targets": [
  3869. 2
  3870. ]
  3871. }
  3872. },
  3873. {
  3874. "failDatabase": [
  3875. "Get last remote snapshot version"
  3876. ]
  3877. },
  3878. {
  3879. "watchSnapshot": {
  3880. "targetIds": [
  3881. ],
  3882. "version": 1500
  3883. },
  3884. "expectedSnapshotEvents": [
  3885. {
  3886. "errorCode": 0,
  3887. "fromCache": true,
  3888. "hasPendingWrites": false,
  3889. "query": {
  3890. "filters": [
  3891. ],
  3892. "orderBys": [
  3893. ],
  3894. "path": "collection"
  3895. }
  3896. }
  3897. ],
  3898. "expectedState": {
  3899. "activeTargets": {
  3900. }
  3901. }
  3902. },
  3903. {
  3904. "failDatabase": false
  3905. },
  3906. {
  3907. "runTimer": "async_queue_retry",
  3908. "expectedState": {
  3909. "activeTargets": {
  3910. "2": {
  3911. "queries": [
  3912. {
  3913. "filters": [
  3914. ],
  3915. "orderBys": [
  3916. ],
  3917. "path": "collection"
  3918. }
  3919. ],
  3920. "resumeToken": "resume-token-1000"
  3921. }
  3922. }
  3923. }
  3924. },
  3925. {
  3926. "watchAck": [
  3927. 2
  3928. ]
  3929. },
  3930. {
  3931. "watchEntity": {
  3932. "docs": [
  3933. {
  3934. "key": "collection/key2",
  3935. "options": {
  3936. "hasCommittedMutations": false,
  3937. "hasLocalMutations": false
  3938. },
  3939. "value": {
  3940. "foo": "b"
  3941. },
  3942. "version": 2000
  3943. }
  3944. ],
  3945. "targets": [
  3946. 2
  3947. ]
  3948. }
  3949. },
  3950. {
  3951. "watchCurrent": [
  3952. [
  3953. 2
  3954. ],
  3955. "resume-token-2000"
  3956. ]
  3957. },
  3958. {
  3959. "watchSnapshot": {
  3960. "targetIds": [
  3961. ],
  3962. "version": 2000
  3963. },
  3964. "expectedSnapshotEvents": [
  3965. {
  3966. "added": [
  3967. {
  3968. "key": "collection/key2",
  3969. "options": {
  3970. "hasCommittedMutations": false,
  3971. "hasLocalMutations": false
  3972. },
  3973. "value": {
  3974. "foo": "b"
  3975. },
  3976. "version": 2000
  3977. }
  3978. ],
  3979. "errorCode": 0,
  3980. "fromCache": false,
  3981. "hasPendingWrites": false,
  3982. "query": {
  3983. "filters": [
  3984. ],
  3985. "orderBys": [
  3986. ],
  3987. "path": "collection"
  3988. }
  3989. }
  3990. ]
  3991. }
  3992. ]
  3993. },
  3994. "Recovers when write acknowledgment cannot be persisted": {
  3995. "describeName": "Persistence Recovery",
  3996. "itName": "Recovers when write acknowledgment cannot be persisted",
  3997. "tags": [
  3998. "no-ios",
  3999. "no-android"
  4000. ],
  4001. "config": {
  4002. "numClients": 1,
  4003. "useGarbageCollection": true
  4004. },
  4005. "steps": [
  4006. {
  4007. "userSet": [
  4008. "collection/a",
  4009. {
  4010. "v": 1
  4011. }
  4012. ]
  4013. },
  4014. {
  4015. "userSet": [
  4016. "collection/b",
  4017. {
  4018. "v": 2
  4019. }
  4020. ]
  4021. },
  4022. {
  4023. "userSet": [
  4024. "collection/c",
  4025. {
  4026. "v": 3
  4027. }
  4028. ]
  4029. },
  4030. {
  4031. "writeAck": {
  4032. "version": 1
  4033. },
  4034. "expectedState": {
  4035. "userCallbacks": {
  4036. "acknowledgedDocs": [
  4037. "collection/a"
  4038. ],
  4039. "rejectedDocs": [
  4040. ]
  4041. }
  4042. }
  4043. },
  4044. {
  4045. "failDatabase": [
  4046. "Acknowledge batch"
  4047. ]
  4048. },
  4049. {
  4050. "writeAck": {
  4051. "version": 2
  4052. }
  4053. },
  4054. {
  4055. "failDatabase": false
  4056. },
  4057. {
  4058. "runTimer": "async_queue_retry",
  4059. "expectedState": {
  4060. "userCallbacks": {
  4061. "acknowledgedDocs": [
  4062. "collection/b"
  4063. ],
  4064. "rejectedDocs": [
  4065. ]
  4066. }
  4067. }
  4068. },
  4069. {
  4070. "writeAck": {
  4071. "version": 1
  4072. },
  4073. "expectedState": {
  4074. "userCallbacks": {
  4075. "acknowledgedDocs": [
  4076. "collection/c"
  4077. ],
  4078. "rejectedDocs": [
  4079. ]
  4080. }
  4081. }
  4082. }
  4083. ]
  4084. },
  4085. "Recovers when write acknowledgment cannot be persisted (with restart)": {
  4086. "describeName": "Persistence Recovery",
  4087. "itName": "Recovers when write acknowledgment cannot be persisted (with restart)",
  4088. "tags": [
  4089. "durable-persistence",
  4090. "no-ios",
  4091. "no-android"
  4092. ],
  4093. "config": {
  4094. "numClients": 1,
  4095. "useGarbageCollection": true
  4096. },
  4097. "steps": [
  4098. {
  4099. "userSet": [
  4100. "collection/a",
  4101. {
  4102. "v": 1
  4103. }
  4104. ]
  4105. },
  4106. {
  4107. "userSet": [
  4108. "collection/b",
  4109. {
  4110. "v": 2
  4111. }
  4112. ]
  4113. },
  4114. {
  4115. "userSet": [
  4116. "collection/c",
  4117. {
  4118. "v": 3
  4119. }
  4120. ]
  4121. },
  4122. {
  4123. "writeAck": {
  4124. "version": 1
  4125. },
  4126. "expectedState": {
  4127. "userCallbacks": {
  4128. "acknowledgedDocs": [
  4129. "collection/a"
  4130. ],
  4131. "rejectedDocs": [
  4132. ]
  4133. }
  4134. }
  4135. },
  4136. {
  4137. "failDatabase": [
  4138. "Acknowledge batch"
  4139. ]
  4140. },
  4141. {
  4142. "writeAck": {
  4143. "keepInQueue": true,
  4144. "version": 2
  4145. }
  4146. },
  4147. {
  4148. "restart": true,
  4149. "expectedState": {
  4150. "activeLimboDocs": [
  4151. ],
  4152. "activeTargets": {
  4153. },
  4154. "enqueuedLimboDocs": [
  4155. ],
  4156. "numOutstandingWrites": 2
  4157. }
  4158. },
  4159. {
  4160. "writeAck": {
  4161. "version": 2
  4162. }
  4163. },
  4164. {
  4165. "writeAck": {
  4166. "version": 3
  4167. }
  4168. }
  4169. ]
  4170. },
  4171. "Recovers when write cannot be persisted": {
  4172. "describeName": "Persistence Recovery",
  4173. "itName": "Recovers when write cannot be persisted",
  4174. "tags": [
  4175. "no-ios",
  4176. "no-android"
  4177. ],
  4178. "config": {
  4179. "numClients": 1,
  4180. "useGarbageCollection": true
  4181. },
  4182. "steps": [
  4183. {
  4184. "userSet": [
  4185. "collection/key1",
  4186. {
  4187. "foo": "a"
  4188. }
  4189. ],
  4190. "expectedState": {
  4191. "numOutstandingWrites": 1
  4192. }
  4193. },
  4194. {
  4195. "failDatabase": [
  4196. "Locally write mutations"
  4197. ]
  4198. },
  4199. {
  4200. "userSet": [
  4201. "collection/key2",
  4202. {
  4203. "bar": "b"
  4204. }
  4205. ],
  4206. "expectedState": {
  4207. "userCallbacks": {
  4208. "acknowledgedDocs": [
  4209. ],
  4210. "rejectedDocs": [
  4211. "collection/key2"
  4212. ]
  4213. }
  4214. }
  4215. },
  4216. {
  4217. "failDatabase": [
  4218. "notifyLocalViewChanges"
  4219. ]
  4220. },
  4221. {
  4222. "userSet": [
  4223. "collection/key3",
  4224. {
  4225. "bar": "b"
  4226. }
  4227. ]
  4228. },
  4229. {
  4230. "failDatabase": false,
  4231. "expectedState": {
  4232. "numOutstandingWrites": 2
  4233. }
  4234. },
  4235. {
  4236. "userSet": [
  4237. "collection/key4",
  4238. {
  4239. "baz": "c"
  4240. }
  4241. ],
  4242. "expectedState": {
  4243. "numOutstandingWrites": 3
  4244. }
  4245. },
  4246. {
  4247. "writeAck": {
  4248. "version": 1
  4249. },
  4250. "expectedState": {
  4251. "userCallbacks": {
  4252. "acknowledgedDocs": [
  4253. "collection/key1"
  4254. ],
  4255. "rejectedDocs": [
  4256. ]
  4257. }
  4258. }
  4259. },
  4260. {
  4261. "writeAck": {
  4262. "version": 2
  4263. },
  4264. "expectedState": {
  4265. "userCallbacks": {
  4266. "acknowledgedDocs": [
  4267. "collection/key3"
  4268. ],
  4269. "rejectedDocs": [
  4270. ]
  4271. }
  4272. }
  4273. },
  4274. {
  4275. "writeAck": {
  4276. "version": 3
  4277. },
  4278. "expectedState": {
  4279. "numOutstandingWrites": 0,
  4280. "userCallbacks": {
  4281. "acknowledgedDocs": [
  4282. "collection/key4"
  4283. ],
  4284. "rejectedDocs": [
  4285. ]
  4286. }
  4287. }
  4288. }
  4289. ]
  4290. },
  4291. "Recovers when write rejection cannot be persisted": {
  4292. "describeName": "Persistence Recovery",
  4293. "itName": "Recovers when write rejection cannot be persisted",
  4294. "tags": [
  4295. "no-ios",
  4296. "no-android"
  4297. ],
  4298. "config": {
  4299. "numClients": 1,
  4300. "useGarbageCollection": true
  4301. },
  4302. "steps": [
  4303. {
  4304. "userPatch": [
  4305. "collection/a",
  4306. {
  4307. "v": 1
  4308. }
  4309. ]
  4310. },
  4311. {
  4312. "userPatch": [
  4313. "collection/a",
  4314. {
  4315. "v": 2
  4316. }
  4317. ]
  4318. },
  4319. {
  4320. "userPatch": [
  4321. "collection/c",
  4322. {
  4323. "v": 3
  4324. }
  4325. ]
  4326. },
  4327. {
  4328. "failWrite": {
  4329. "error": {
  4330. "code": 9
  4331. }
  4332. },
  4333. "expectedState": {
  4334. "userCallbacks": {
  4335. "acknowledgedDocs": [
  4336. ],
  4337. "rejectedDocs": [
  4338. "collection/a"
  4339. ]
  4340. }
  4341. }
  4342. },
  4343. {
  4344. "failDatabase": [
  4345. "Reject batch"
  4346. ]
  4347. },
  4348. {
  4349. "failWrite": {
  4350. "error": {
  4351. "code": 9
  4352. }
  4353. }
  4354. },
  4355. {
  4356. "failDatabase": false
  4357. },
  4358. {
  4359. "runTimer": "async_queue_retry",
  4360. "expectedState": {
  4361. "userCallbacks": {
  4362. "acknowledgedDocs": [
  4363. ],
  4364. "rejectedDocs": [
  4365. "collection/a"
  4366. ]
  4367. }
  4368. }
  4369. },
  4370. {
  4371. "failWrite": {
  4372. "error": {
  4373. "code": 9
  4374. }
  4375. },
  4376. "expectedState": {
  4377. "userCallbacks": {
  4378. "acknowledgedDocs": [
  4379. ],
  4380. "rejectedDocs": [
  4381. "collection/c"
  4382. ]
  4383. }
  4384. }
  4385. }
  4386. ]
  4387. },
  4388. "Surfaces local documents if notifyLocalViewChanges fails": {
  4389. "describeName": "Persistence Recovery",
  4390. "itName": "Surfaces local documents if notifyLocalViewChanges fails",
  4391. "tags": [
  4392. "no-ios",
  4393. "no-android"
  4394. ],
  4395. "config": {
  4396. "numClients": 1,
  4397. "useGarbageCollection": true
  4398. },
  4399. "steps": [
  4400. {
  4401. "userListen": {
  4402. "query": {
  4403. "filters": [
  4404. ],
  4405. "orderBys": [
  4406. ],
  4407. "path": "collection"
  4408. },
  4409. "targetId": 2
  4410. },
  4411. "expectedState": {
  4412. "activeTargets": {
  4413. "2": {
  4414. "queries": [
  4415. {
  4416. "filters": [
  4417. ],
  4418. "orderBys": [
  4419. ],
  4420. "path": "collection"
  4421. }
  4422. ],
  4423. "resumeToken": ""
  4424. }
  4425. }
  4426. }
  4427. },
  4428. {
  4429. "failDatabase": [
  4430. "notifyLocalViewChanges"
  4431. ]
  4432. },
  4433. {
  4434. "userSet": [
  4435. "collection/key1",
  4436. {
  4437. "foo": "a"
  4438. }
  4439. ],
  4440. "expectedSnapshotEvents": [
  4441. {
  4442. "added": [
  4443. {
  4444. "key": "collection/key1",
  4445. "options": {
  4446. "hasCommittedMutations": false,
  4447. "hasLocalMutations": true
  4448. },
  4449. "value": {
  4450. "foo": "a"
  4451. },
  4452. "version": 0
  4453. }
  4454. ],
  4455. "errorCode": 0,
  4456. "fromCache": true,
  4457. "hasPendingWrites": true,
  4458. "query": {
  4459. "filters": [
  4460. ],
  4461. "orderBys": [
  4462. ],
  4463. "path": "collection"
  4464. }
  4465. }
  4466. ]
  4467. },
  4468. {
  4469. "failDatabase": false
  4470. },
  4471. {
  4472. "runTimer": "async_queue_retry"
  4473. },
  4474. {
  4475. "writeAck": {
  4476. "version": 1
  4477. },
  4478. "expectedState": {
  4479. "userCallbacks": {
  4480. "acknowledgedDocs": [
  4481. "collection/key1"
  4482. ],
  4483. "rejectedDocs": [
  4484. ]
  4485. }
  4486. }
  4487. },
  4488. {
  4489. "failDatabase": [
  4490. "notifyLocalViewChanges"
  4491. ]
  4492. },
  4493. {
  4494. "watchAck": [
  4495. 2
  4496. ]
  4497. },
  4498. {
  4499. "watchEntity": {
  4500. "docs": [
  4501. {
  4502. "key": "collection/key1",
  4503. "options": {
  4504. "hasCommittedMutations": false,
  4505. "hasLocalMutations": false
  4506. },
  4507. "value": {
  4508. "foo": "a"
  4509. },
  4510. "version": 1
  4511. },
  4512. {
  4513. "key": "collection/key2",
  4514. "options": {
  4515. "hasCommittedMutations": false,
  4516. "hasLocalMutations": false
  4517. },
  4518. "value": {
  4519. "foo": "b"
  4520. },
  4521. "version": 2
  4522. }
  4523. ],
  4524. "targets": [
  4525. 2
  4526. ]
  4527. }
  4528. },
  4529. {
  4530. "watchCurrent": [
  4531. [
  4532. 2
  4533. ],
  4534. "resume-token-1000"
  4535. ]
  4536. },
  4537. {
  4538. "watchSnapshot": {
  4539. "targetIds": [
  4540. ],
  4541. "version": 1000
  4542. },
  4543. "expectedSnapshotEvents": [
  4544. {
  4545. "added": [
  4546. {
  4547. "key": "collection/key2",
  4548. "options": {
  4549. "hasCommittedMutations": false,
  4550. "hasLocalMutations": false
  4551. },
  4552. "value": {
  4553. "foo": "b"
  4554. },
  4555. "version": 2
  4556. }
  4557. ],
  4558. "errorCode": 0,
  4559. "fromCache": false,
  4560. "hasPendingWrites": false,
  4561. "metadata": [
  4562. {
  4563. "key": "collection/key1",
  4564. "options": {
  4565. "hasCommittedMutations": false,
  4566. "hasLocalMutations": false
  4567. },
  4568. "value": {
  4569. "foo": "a"
  4570. },
  4571. "version": 1
  4572. }
  4573. ],
  4574. "query": {
  4575. "filters": [
  4576. ],
  4577. "orderBys": [
  4578. ],
  4579. "path": "collection"
  4580. }
  4581. }
  4582. ]
  4583. }
  4584. ]
  4585. },
  4586. "Unlisten succeeds when target release fails": {
  4587. "describeName": "Persistence Recovery",
  4588. "itName": "Unlisten succeeds when target release fails",
  4589. "tags": [
  4590. "no-ios",
  4591. "no-android"
  4592. ],
  4593. "config": {
  4594. "numClients": 1,
  4595. "useGarbageCollection": true
  4596. },
  4597. "steps": [
  4598. {
  4599. "userListen": {
  4600. "query": {
  4601. "filters": [
  4602. ],
  4603. "orderBys": [
  4604. ],
  4605. "path": "collection"
  4606. },
  4607. "targetId": 2
  4608. },
  4609. "expectedState": {
  4610. "activeTargets": {
  4611. "2": {
  4612. "queries": [
  4613. {
  4614. "filters": [
  4615. ],
  4616. "orderBys": [
  4617. ],
  4618. "path": "collection"
  4619. }
  4620. ],
  4621. "resumeToken": ""
  4622. }
  4623. }
  4624. }
  4625. },
  4626. {
  4627. "watchAck": [
  4628. 2
  4629. ]
  4630. },
  4631. {
  4632. "watchEntity": {
  4633. "docs": [
  4634. {
  4635. "key": "collection/key1",
  4636. "options": {
  4637. "hasCommittedMutations": false,
  4638. "hasLocalMutations": false
  4639. },
  4640. "value": {
  4641. "foo": "a"
  4642. },
  4643. "version": 1
  4644. }
  4645. ],
  4646. "targets": [
  4647. 2
  4648. ]
  4649. }
  4650. },
  4651. {
  4652. "watchCurrent": [
  4653. [
  4654. 2
  4655. ],
  4656. "resume-token-1000"
  4657. ]
  4658. },
  4659. {
  4660. "watchSnapshot": {
  4661. "targetIds": [
  4662. ],
  4663. "version": 1000
  4664. },
  4665. "expectedSnapshotEvents": [
  4666. {
  4667. "added": [
  4668. {
  4669. "key": "collection/key1",
  4670. "options": {
  4671. "hasCommittedMutations": false,
  4672. "hasLocalMutations": false
  4673. },
  4674. "value": {
  4675. "foo": "a"
  4676. },
  4677. "version": 1
  4678. }
  4679. ],
  4680. "errorCode": 0,
  4681. "fromCache": false,
  4682. "hasPendingWrites": false,
  4683. "query": {
  4684. "filters": [
  4685. ],
  4686. "orderBys": [
  4687. ],
  4688. "path": "collection"
  4689. }
  4690. }
  4691. ]
  4692. },
  4693. {
  4694. "failDatabase": [
  4695. "Release target"
  4696. ]
  4697. },
  4698. {
  4699. "userUnlisten": [
  4700. 2,
  4701. {
  4702. "filters": [
  4703. ],
  4704. "orderBys": [
  4705. ],
  4706. "path": "collection"
  4707. }
  4708. ],
  4709. "expectedState": {
  4710. "activeTargets": {
  4711. }
  4712. }
  4713. }
  4714. ]
  4715. },
  4716. "User change handles transaction failures (with recovery)": {
  4717. "describeName": "Persistence Recovery",
  4718. "itName": "User change handles transaction failures (with recovery)",
  4719. "tags": [
  4720. "durable-persistence",
  4721. "no-ios",
  4722. "no-android"
  4723. ],
  4724. "config": {
  4725. "numClients": 1,
  4726. "useGarbageCollection": true
  4727. },
  4728. "steps": [
  4729. {
  4730. "changeUser": "user1"
  4731. },
  4732. {
  4733. "userSet": [
  4734. "collection/key1",
  4735. {
  4736. "foo": "a"
  4737. }
  4738. ]
  4739. },
  4740. {
  4741. "userListen": {
  4742. "query": {
  4743. "filters": [
  4744. ],
  4745. "orderBys": [
  4746. ],
  4747. "path": "collection"
  4748. },
  4749. "targetId": 2
  4750. },
  4751. "expectedSnapshotEvents": [
  4752. {
  4753. "added": [
  4754. {
  4755. "key": "collection/key1",
  4756. "options": {
  4757. "hasCommittedMutations": false,
  4758. "hasLocalMutations": true
  4759. },
  4760. "value": {
  4761. "foo": "a"
  4762. },
  4763. "version": 0
  4764. }
  4765. ],
  4766. "errorCode": 0,
  4767. "fromCache": true,
  4768. "hasPendingWrites": true,
  4769. "query": {
  4770. "filters": [
  4771. ],
  4772. "orderBys": [
  4773. ],
  4774. "path": "collection"
  4775. }
  4776. }
  4777. ],
  4778. "expectedState": {
  4779. "activeTargets": {
  4780. "2": {
  4781. "queries": [
  4782. {
  4783. "filters": [
  4784. ],
  4785. "orderBys": [
  4786. ],
  4787. "path": "collection"
  4788. }
  4789. ],
  4790. "resumeToken": ""
  4791. }
  4792. }
  4793. }
  4794. },
  4795. {
  4796. "failDatabase": [
  4797. "Handle user change"
  4798. ]
  4799. },
  4800. {
  4801. "changeUser": "user2",
  4802. "expectedState": {
  4803. "activeTargets": {
  4804. }
  4805. }
  4806. },
  4807. {
  4808. "failDatabase": false
  4809. },
  4810. {
  4811. "runTimer": "async_queue_retry",
  4812. "expectedSnapshotEvents": [
  4813. {
  4814. "errorCode": 0,
  4815. "fromCache": true,
  4816. "hasPendingWrites": false,
  4817. "query": {
  4818. "filters": [
  4819. ],
  4820. "orderBys": [
  4821. ],
  4822. "path": "collection"
  4823. },
  4824. "removed": [
  4825. {
  4826. "key": "collection/key1",
  4827. "options": {
  4828. "hasCommittedMutations": false,
  4829. "hasLocalMutations": true
  4830. },
  4831. "value": {
  4832. "foo": "a"
  4833. },
  4834. "version": 0
  4835. }
  4836. ]
  4837. }
  4838. ],
  4839. "expectedState": {
  4840. "activeTargets": {
  4841. "2": {
  4842. "queries": [
  4843. {
  4844. "filters": [
  4845. ],
  4846. "orderBys": [
  4847. ],
  4848. "path": "collection"
  4849. }
  4850. ],
  4851. "resumeToken": ""
  4852. }
  4853. }
  4854. }
  4855. },
  4856. {
  4857. "failDatabase": [
  4858. "Handle user change"
  4859. ]
  4860. },
  4861. {
  4862. "changeUser": "user1",
  4863. "expectedState": {
  4864. "activeTargets": {
  4865. }
  4866. }
  4867. },
  4868. {
  4869. "failDatabase": false
  4870. },
  4871. {
  4872. "runTimer": "async_queue_retry",
  4873. "expectedSnapshotEvents": [
  4874. {
  4875. "added": [
  4876. {
  4877. "key": "collection/key1",
  4878. "options": {
  4879. "hasCommittedMutations": false,
  4880. "hasLocalMutations": true
  4881. },
  4882. "value": {
  4883. "foo": "a"
  4884. },
  4885. "version": 0
  4886. }
  4887. ],
  4888. "errorCode": 0,
  4889. "fromCache": true,
  4890. "hasPendingWrites": true,
  4891. "query": {
  4892. "filters": [
  4893. ],
  4894. "orderBys": [
  4895. ],
  4896. "path": "collection"
  4897. }
  4898. }
  4899. ],
  4900. "expectedState": {
  4901. "activeTargets": {
  4902. "2": {
  4903. "queries": [
  4904. {
  4905. "filters": [
  4906. ],
  4907. "orderBys": [
  4908. ],
  4909. "path": "collection"
  4910. }
  4911. ],
  4912. "resumeToken": ""
  4913. }
  4914. }
  4915. }
  4916. }
  4917. ]
  4918. },
  4919. "Write is acknowledged by primary client (with recovery)": {
  4920. "describeName": "Persistence Recovery",
  4921. "itName": "Write is acknowledged by primary client (with recovery)",
  4922. "tags": [
  4923. "multi-client",
  4924. "no-ios",
  4925. "no-android"
  4926. ],
  4927. "config": {
  4928. "numClients": 2,
  4929. "useGarbageCollection": false
  4930. },
  4931. "steps": [
  4932. {
  4933. "clientIndex": 0,
  4934. "drainQueue": true,
  4935. "expectedState": {
  4936. "isPrimary": true
  4937. }
  4938. },
  4939. {
  4940. "clientIndex": 1,
  4941. "drainQueue": true,
  4942. "expectedState": {
  4943. "isPrimary": false
  4944. }
  4945. },
  4946. {
  4947. "clientIndex": 1,
  4948. "userSet": [
  4949. "collection/a",
  4950. {
  4951. "v": 1
  4952. }
  4953. ]
  4954. },
  4955. {
  4956. "clientIndex": 1,
  4957. "failDatabase": [
  4958. "Lookup mutation documents"
  4959. ]
  4960. },
  4961. {
  4962. "clientIndex": 0,
  4963. "drainQueue": true
  4964. },
  4965. {
  4966. "clientIndex": 0,
  4967. "writeAck": {
  4968. "version": 1
  4969. }
  4970. },
  4971. {
  4972. "clientIndex": 1,
  4973. "drainQueue": true
  4974. },
  4975. {
  4976. "clientIndex": 1,
  4977. "runTimer": "async_queue_retry"
  4978. },
  4979. {
  4980. "clientIndex": 1,
  4981. "failDatabase": false
  4982. },
  4983. {
  4984. "clientIndex": 1,
  4985. "runTimer": "async_queue_retry",
  4986. "expectedState": {
  4987. "userCallbacks": {
  4988. "acknowledgedDocs": [
  4989. "collection/a"
  4990. ],
  4991. "rejectedDocs": [
  4992. ]
  4993. }
  4994. }
  4995. }
  4996. ]
  4997. },
  4998. "Writes are pending until acknowledgement is persisted": {
  4999. "describeName": "Persistence Recovery",
  5000. "itName": "Writes are pending until acknowledgement is persisted",
  5001. "tags": [
  5002. "no-ios",
  5003. "no-android"
  5004. ],
  5005. "config": {
  5006. "numClients": 1,
  5007. "useGarbageCollection": true
  5008. },
  5009. "steps": [
  5010. {
  5011. "userListen": {
  5012. "query": {
  5013. "filters": [
  5014. ],
  5015. "orderBys": [
  5016. ],
  5017. "path": "collection"
  5018. },
  5019. "targetId": 2
  5020. },
  5021. "expectedState": {
  5022. "activeTargets": {
  5023. "2": {
  5024. "queries": [
  5025. {
  5026. "filters": [
  5027. ],
  5028. "orderBys": [
  5029. ],
  5030. "path": "collection"
  5031. }
  5032. ],
  5033. "resumeToken": ""
  5034. }
  5035. }
  5036. }
  5037. },
  5038. {
  5039. "watchAck": [
  5040. 2
  5041. ]
  5042. },
  5043. {
  5044. "watchEntity": {
  5045. "docs": [
  5046. ],
  5047. "targets": [
  5048. 2
  5049. ]
  5050. }
  5051. },
  5052. {
  5053. "watchCurrent": [
  5054. [
  5055. 2
  5056. ],
  5057. "resume-token-1000"
  5058. ]
  5059. },
  5060. {
  5061. "watchSnapshot": {
  5062. "targetIds": [
  5063. ],
  5064. "version": 1000
  5065. },
  5066. "expectedSnapshotEvents": [
  5067. {
  5068. "errorCode": 0,
  5069. "fromCache": false,
  5070. "hasPendingWrites": false,
  5071. "query": {
  5072. "filters": [
  5073. ],
  5074. "orderBys": [
  5075. ],
  5076. "path": "collection"
  5077. }
  5078. }
  5079. ]
  5080. },
  5081. {
  5082. "userSet": [
  5083. "collection/a",
  5084. {
  5085. "v": 1
  5086. }
  5087. ],
  5088. "expectedSnapshotEvents": [
  5089. {
  5090. "added": [
  5091. {
  5092. "key": "collection/a",
  5093. "options": {
  5094. "hasCommittedMutations": false,
  5095. "hasLocalMutations": true
  5096. },
  5097. "value": {
  5098. "v": 1
  5099. },
  5100. "version": 0
  5101. }
  5102. ],
  5103. "errorCode": 0,
  5104. "fromCache": false,
  5105. "hasPendingWrites": true,
  5106. "query": {
  5107. "filters": [
  5108. ],
  5109. "orderBys": [
  5110. ],
  5111. "path": "collection"
  5112. }
  5113. }
  5114. ]
  5115. },
  5116. {
  5117. "userSet": [
  5118. "collection/b",
  5119. {
  5120. "v": 2
  5121. }
  5122. ],
  5123. "expectedSnapshotEvents": [
  5124. {
  5125. "added": [
  5126. {
  5127. "key": "collection/b",
  5128. "options": {
  5129. "hasCommittedMutations": false,
  5130. "hasLocalMutations": true
  5131. },
  5132. "value": {
  5133. "v": 2
  5134. },
  5135. "version": 0
  5136. }
  5137. ],
  5138. "errorCode": 0,
  5139. "fromCache": false,
  5140. "hasPendingWrites": true,
  5141. "query": {
  5142. "filters": [
  5143. ],
  5144. "orderBys": [
  5145. ],
  5146. "path": "collection"
  5147. }
  5148. }
  5149. ]
  5150. },
  5151. {
  5152. "failDatabase": [
  5153. "Acknowledge batch"
  5154. ]
  5155. },
  5156. {
  5157. "writeAck": {
  5158. "version": 1
  5159. },
  5160. "expectedSnapshotEvents": [
  5161. {
  5162. "errorCode": 0,
  5163. "fromCache": true,
  5164. "hasPendingWrites": true,
  5165. "query": {
  5166. "filters": [
  5167. ],
  5168. "orderBys": [
  5169. ],
  5170. "path": "collection"
  5171. }
  5172. }
  5173. ],
  5174. "expectedState": {
  5175. "activeTargets": {
  5176. }
  5177. }
  5178. },
  5179. {
  5180. "failDatabase": false
  5181. },
  5182. {
  5183. "runTimer": "async_queue_retry",
  5184. "expectedState": {
  5185. "activeTargets": {
  5186. "2": {
  5187. "queries": [
  5188. {
  5189. "filters": [
  5190. ],
  5191. "orderBys": [
  5192. ],
  5193. "path": "collection"
  5194. }
  5195. ],
  5196. "resumeToken": "resume-token-1000"
  5197. }
  5198. },
  5199. "userCallbacks": {
  5200. "acknowledgedDocs": [
  5201. "collection/a"
  5202. ],
  5203. "rejectedDocs": [
  5204. ]
  5205. }
  5206. }
  5207. },
  5208. {
  5209. "watchAck": [
  5210. 2
  5211. ]
  5212. },
  5213. {
  5214. "watchEntity": {
  5215. "docs": [
  5216. {
  5217. "key": "collection/a",
  5218. "options": {
  5219. "hasCommittedMutations": false,
  5220. "hasLocalMutations": false
  5221. },
  5222. "value": {
  5223. "v": 1
  5224. },
  5225. "version": 1001
  5226. }
  5227. ],
  5228. "targets": [
  5229. 2
  5230. ]
  5231. }
  5232. },
  5233. {
  5234. "watchCurrent": [
  5235. [
  5236. 2
  5237. ],
  5238. "resume-token-1001"
  5239. ]
  5240. },
  5241. {
  5242. "watchSnapshot": {
  5243. "targetIds": [
  5244. ],
  5245. "version": 1001
  5246. },
  5247. "expectedSnapshotEvents": [
  5248. {
  5249. "errorCode": 0,
  5250. "fromCache": false,
  5251. "hasPendingWrites": true,
  5252. "metadata": [
  5253. {
  5254. "key": "collection/a",
  5255. "options": {
  5256. "hasCommittedMutations": false,
  5257. "hasLocalMutations": false
  5258. },
  5259. "value": {
  5260. "v": 1
  5261. },
  5262. "version": 1001
  5263. }
  5264. ],
  5265. "query": {
  5266. "filters": [
  5267. ],
  5268. "orderBys": [
  5269. ],
  5270. "path": "collection"
  5271. }
  5272. }
  5273. ]
  5274. },
  5275. {
  5276. "writeAck": {
  5277. "version": 2
  5278. },
  5279. "expectedState": {
  5280. "userCallbacks": {
  5281. "acknowledgedDocs": [
  5282. "collection/b"
  5283. ],
  5284. "rejectedDocs": [
  5285. ]
  5286. }
  5287. }
  5288. },
  5289. {
  5290. "watchEntity": {
  5291. "docs": [
  5292. {
  5293. "key": "collection/b",
  5294. "options": {
  5295. "hasCommittedMutations": false,
  5296. "hasLocalMutations": false
  5297. },
  5298. "value": {
  5299. "v": 2
  5300. },
  5301. "version": 1002
  5302. }
  5303. ],
  5304. "targets": [
  5305. 2
  5306. ]
  5307. }
  5308. },
  5309. {
  5310. "watchSnapshot": {
  5311. "targetIds": [
  5312. ],
  5313. "version": 1002
  5314. },
  5315. "expectedSnapshotEvents": [
  5316. {
  5317. "errorCode": 0,
  5318. "fromCache": false,
  5319. "hasPendingWrites": false,
  5320. "metadata": [
  5321. {
  5322. "key": "collection/b",
  5323. "options": {
  5324. "hasCommittedMutations": false,
  5325. "hasLocalMutations": false
  5326. },
  5327. "value": {
  5328. "v": 2
  5329. },
  5330. "version": 1002
  5331. }
  5332. ],
  5333. "query": {
  5334. "filters": [
  5335. ],
  5336. "orderBys": [
  5337. ],
  5338. "path": "collection"
  5339. }
  5340. }
  5341. ]
  5342. }
  5343. ]
  5344. }
  5345. }