@@ -57,19 +57,19 @@ import { Code, FirestoreError } from '../util/error';
57
57
58
58
import { DatabaseInfo } from './database_info' ;
59
59
import { EventManager , newEventManager } from './event_manager' ;
60
+ import { SyncEngine } from './sync_engine' ;
60
61
import {
61
- applyActiveTargetsChange ,
62
- applyBatchState ,
63
- applyOnlineStateChange ,
64
- applyPrimaryState ,
65
- applyTargetState ,
66
- getActiveClients ,
67
- syncEngineHandleCredentialChange ,
68
62
newSyncEngine ,
69
- SyncEngine ,
70
- ensureWriteCallbacks ,
71
- synchronizeWithChangedDocuments
72
- } from './sync_engine' ;
63
+ syncEngineApplyActiveTargetsChange ,
64
+ syncEngineApplyBatchState ,
65
+ syncEngineApplyOnlineStateChange ,
66
+ syncEngineApplyPrimaryState ,
67
+ syncEngineApplyTargetState ,
68
+ syncEngineEnsureWriteCallbacks ,
69
+ syncEngineGetActiveClients ,
70
+ syncEngineHandleCredentialChange ,
71
+ syncEngineSynchronizeWithChangedDocuments
72
+ } from './sync_engine_impl' ;
73
73
import { OnlineStateSource } from './types' ;
74
74
75
75
export interface ComponentConfiguration {
@@ -177,7 +177,9 @@ export class IndexedDbOfflineComponentProvider extends MemoryOfflineComponentPro
177
177
await this . onlineComponentProvider . initialize ( this , cfg ) ;
178
178
179
179
// Enqueue writes from a previous session
180
- await ensureWriteCallbacks ( this . onlineComponentProvider . syncEngine ) ;
180
+ await syncEngineEnsureWriteCallbacks (
181
+ this . onlineComponentProvider . syncEngine
182
+ ) ;
181
183
await fillWritePipeline ( this . onlineComponentProvider . remoteStore ) ;
182
184
}
183
185
@@ -252,14 +254,14 @@ export class MultiTabOfflineComponentProvider extends IndexedDbOfflineComponentP
252
254
253
255
if ( this . sharedClientState instanceof WebStorageSharedClientState ) {
254
256
this . sharedClientState . syncEngine = {
255
- applyBatchState : applyBatchState . bind ( null , syncEngine ) ,
256
- applyTargetState : applyTargetState . bind ( null , syncEngine ) ,
257
- applyActiveTargetsChange : applyActiveTargetsChange . bind (
257
+ applyBatchState : syncEngineApplyBatchState . bind ( null , syncEngine ) ,
258
+ applyTargetState : syncEngineApplyTargetState . bind ( null , syncEngine ) ,
259
+ applyActiveTargetsChange : syncEngineApplyActiveTargetsChange . bind (
258
260
null ,
259
261
syncEngine
260
262
) ,
261
- getActiveClients : getActiveClients . bind ( null , syncEngine ) ,
262
- synchronizeWithChangedDocuments : synchronizeWithChangedDocuments . bind (
263
+ getActiveClients : syncEngineGetActiveClients . bind ( null , syncEngine ) ,
264
+ synchronizeWithChangedDocuments : syncEngineSynchronizeWithChangedDocuments . bind (
263
265
null ,
264
266
syncEngine
265
267
)
@@ -270,7 +272,7 @@ export class MultiTabOfflineComponentProvider extends IndexedDbOfflineComponentP
270
272
// NOTE: This will immediately call the listener, so we make sure to
271
273
// set it after localStore / remoteStore are started.
272
274
await this . persistence . setPrimaryStateListener ( async isPrimary => {
273
- await applyPrimaryState (
275
+ await syncEngineApplyPrimaryState (
274
276
this . onlineComponentProvider . syncEngine ,
275
277
isPrimary
276
278
) ;
@@ -339,7 +341,7 @@ export class OnlineComponentProvider {
339
341
) ;
340
342
341
343
this . sharedClientState . onlineStateHandler = onlineState =>
342
- applyOnlineStateChange (
344
+ syncEngineApplyOnlineStateChange (
343
345
this . syncEngine ,
344
346
onlineState ,
345
347
OnlineStateSource . SharedClientState
@@ -372,7 +374,7 @@ export class OnlineComponentProvider {
372
374
this . datastore ,
373
375
cfg . asyncQueue ,
374
376
onlineState =>
375
- applyOnlineStateChange (
377
+ syncEngineApplyOnlineStateChange (
376
378
this . syncEngine ,
377
379
onlineState ,
378
380
OnlineStateSource . RemoteStore
0 commit comments