@@ -107,7 +107,8 @@ export class MemoryComponentProvider {
107
107
OnlineStateSource . SharedClientState
108
108
) ;
109
109
this . remoteStore . syncEngine = this . syncEngine ;
110
-
110
+
111
+ await this . localStore . start ( ) ;
111
112
await this . sharedClientState . start ( ) ;
112
113
await this . remoteStore . start ( ) ;
113
114
@@ -212,12 +213,6 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
212
213
'IndexedDbComponentProvider should provide MultiTabSyncEngine'
213
214
) ;
214
215
215
- if ( this . sharedClientState instanceof WebStorageSharedClientState ) {
216
- this . sharedClientState . syncEngine = this . syncEngine ;
217
- }
218
-
219
- await this . localStore . start ( ) ;
220
-
221
216
// NOTE: This will immediately call the listener, so we make sure to
222
217
// set it after localStore / remoteStore are started.
223
218
await this . persistence . setPrimaryStateListener ( async isPrimary => {
@@ -251,13 +246,17 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
251
246
this . localStore instanceof MultiTabLocalStore ,
252
247
'IndexedDbComponentProvider should provide MultiTabLocalStore'
253
248
) ;
254
- return new MultiTabSyncEngine (
249
+ const syncEngine = new MultiTabSyncEngine (
255
250
this . localStore ,
256
251
this . remoteStore ,
257
252
this . sharedClientState ,
258
253
cfg . initialUser ,
259
254
cfg . maxConcurrentLimboResolutions
260
255
) ;
256
+ if ( this . sharedClientState instanceof WebStorageSharedClientState ) {
257
+ this . sharedClientState . syncEngine = syncEngine ;
258
+ }
259
+ return syncEngine ;
261
260
}
262
261
263
262
createGarbageCollectionScheduler (
0 commit comments