@@ -21,8 +21,8 @@ import {
21
21
SharedClientState ,
22
22
WebStorageSharedClientState
23
23
} from '../local/shared_client_state' ;
24
- import { LocalStore } from '../local/local_store' ;
25
- import { SyncEngine } from './sync_engine' ;
24
+ import { LocalStore , MultiTabLocalStore } from '../local/local_store' ;
25
+ import { MultiTabSyncEngine , SyncEngine } from './sync_engine' ;
26
26
import { RemoteStore } from '../remote/remote_store' ;
27
27
import { EventManager } from './event_manager' ;
28
28
import { AsyncQueue } from '../util/async_queue' ;
@@ -77,8 +77,8 @@ export interface ComponentProvider {
77
77
export class IndexedDbComponentProvider implements ComponentProvider {
78
78
persistence ! : IndexedDbPersistence ;
79
79
sharedClientState ! : SharedClientState ;
80
- localStore ! : LocalStore ;
81
- syncEngine ! : SyncEngine ;
80
+ localStore ! : MultiTabLocalStore ;
81
+ syncEngine ! : MultiTabSyncEngine ;
82
82
gcScheduler ! : GarbageCollectionScheduler | null ;
83
83
remoteStore ! : RemoteStore ;
84
84
eventManager ! : EventManager ;
@@ -141,7 +141,7 @@ export class IndexedDbComponentProvider implements ComponentProvider {
141
141
. garbageCollector ;
142
142
143
143
this . gcScheduler = new LruScheduler ( garbageCollector , asyncQueue ) ;
144
- this . localStore = new LocalStore (
144
+ this . localStore = new MultiTabLocalStore (
145
145
this . persistence ,
146
146
new IndexFreeQueryEngine ( ) ,
147
147
initialUser
@@ -157,7 +157,7 @@ export class IndexedDbComponentProvider implements ComponentProvider {
157
157
) ,
158
158
platform . newConnectivityMonitor ( )
159
159
) ;
160
- this . syncEngine = new SyncEngine (
160
+ this . syncEngine = new MultiTabSyncEngine (
161
161
this . localStore ,
162
162
this . remoteStore ,
163
163
this . sharedClientState ,
@@ -233,10 +233,7 @@ export class MemoryComponentProvider implements ComponentProvider {
233
233
) ;
234
234
}
235
235
236
- this . persistence = new MemoryPersistence (
237
- clientId ,
238
- this . referenceDelegateFactory
239
- ) ;
236
+ this . persistence = new MemoryPersistence ( this . referenceDelegateFactory ) ;
240
237
this . gcScheduler = null ;
241
238
this . sharedClientState = new MemorySharedClientState ( ) ;
242
239
this . localStore = new LocalStore (
@@ -268,7 +265,6 @@ export class MemoryComponentProvider implements ComponentProvider {
268
265
269
266
await this . remoteStore . start ( ) ;
270
267
await this . remoteStore . applyPrimaryState ( true ) ;
271
- await this . syncEngine . applyPrimaryState ( true ) ;
272
268
}
273
269
274
270
clearPersistence ( ) : never {
0 commit comments