@@ -57,6 +57,28 @@ describeSpec('Persistence Recovery', ['no-ios', 'no-android'], () => {
57
57
}
58
58
) ;
59
59
60
+ specTest (
61
+ 'Clients fail to lookup mutations (with recovery)' ,
62
+ [ 'multi-client' ] ,
63
+ ( ) => {
64
+ return client ( 0 )
65
+ . expectPrimaryState ( true )
66
+ . failDatabaseTransactions ( 'Lookup mutation documents' )
67
+ . client ( 1 )
68
+ . failDatabaseTransactions ( 'Lookup mutation documents' )
69
+ . expectPrimaryState ( false )
70
+ . userSets ( 'collection/a' , { v : 1 } )
71
+ . client ( 0 )
72
+ . recoverDatabase ( )
73
+ . runTimer ( TimerId . AsyncQueueRetry )
74
+ . writeAcks ( 'collection/a' , 1 , { expectUserCallback : false } )
75
+ . client ( 1 )
76
+ . recoverDatabase ( )
77
+ . runTimer ( TimerId . AsyncQueueRetry )
78
+ . expectUserCallbacks ( { acknowledged : [ 'collection/a' ] } ) ;
79
+ }
80
+ ) ;
81
+
60
82
specTest (
61
83
'Query raises events in secondary client (with recovery)' ,
62
84
[ 'multi-client' ] ,
@@ -114,6 +136,31 @@ describeSpec('Persistence Recovery', ['no-ios', 'no-android'], () => {
114
136
}
115
137
) ;
116
138
139
+ specTest (
140
+ 'Ignores intermittent lease refresh failures (with recovery)' ,
141
+ [ 'multi-client' ] ,
142
+ ( ) => {
143
+ return client ( 0 )
144
+ . expectPrimaryState ( true )
145
+ . client ( 1 )
146
+ . expectPrimaryState ( false )
147
+ . client ( 0 )
148
+ . failDatabaseTransactions ( 'updateClientMetadataAndTryBecomePrimary' )
149
+ . runTimer ( TimerId . ClientMetadataRefresh )
150
+ . client ( 1 )
151
+ . failDatabaseTransactions ( 'updateClientMetadataAndTryBecomePrimary' )
152
+ . runTimer ( TimerId . ClientMetadataRefresh )
153
+ . client ( 0 )
154
+ . recoverDatabase ( )
155
+ . runTimer ( TimerId . ClientMetadataRefresh )
156
+ . expectPrimaryState ( true )
157
+ . client ( 1 )
158
+ . recoverDatabase ( )
159
+ . runTimer ( TimerId . ClientMetadataRefresh )
160
+ . expectPrimaryState ( false ) ;
161
+ }
162
+ ) ;
163
+
117
164
specTest ( 'Recovers when write cannot be persisted' , [ ] , ( ) => {
118
165
return (
119
166
spec ( )
0 commit comments