@@ -48,11 +48,10 @@ import { Code, FirestoreError } from '../util/error';
48
48
import { OnlineStateSource } from './types' ;
49
49
import { LruParams , LruScheduler } from '../local/lru_garbage_collector' ;
50
50
import { IndexFreeQueryEngine } from '../local/index_free_query_engine' ;
51
- import { MemorySharedClientStateSyncer } from '../local/shared_client_state_syncer' ;
52
51
import {
53
- indexedDbStoragePrefix ,
52
+ indexedDbClearPersistence ,
54
53
IndexedDbPersistence ,
55
- indexedDbClearPersistence
54
+ indexedDbStoragePrefix
56
55
} from '../local/indexeddb_persistence' ;
57
56
import {
58
57
MemoryEagerDelegate ,
@@ -63,6 +62,7 @@ import { newSerializer } from '../platform/serializer';
63
62
import { getDocument , getWindow } from '../platform/dom' ;
64
63
import { CredentialsProvider } from '../api/credentials' ;
65
64
import { Connection } from '../remote/connection' ;
65
+
66
66
const MEMORY_ONLY_PERSISTENCE_ERROR_MESSAGE =
67
67
'You are using the memory-only build of Firestore. Persistence support is ' +
68
68
'only available via the @firebase/firestore bundle or the ' +
@@ -198,7 +198,7 @@ export class MemoryComponentProvider implements ComponentProvider {
198
198
}
199
199
200
200
createSyncEngine ( cfg : ComponentConfiguration ) : SyncEngine {
201
- const syncEngine = newSyncEngine (
201
+ return newSyncEngine (
202
202
this . localStore ,
203
203
this . remoteStore ,
204
204
this . datastore ,
@@ -207,10 +207,6 @@ export class MemoryComponentProvider implements ComponentProvider {
207
207
cfg . maxConcurrentLimboResolutions ,
208
208
/* isPrimary= */ true
209
209
) ;
210
- this . sharedClientState . syncEngine = new MemorySharedClientStateSyncer ( [
211
- cfg . clientId
212
- ] ) ;
213
- return syncEngine ;
214
210
}
215
211
216
212
clearPersistence (
@@ -330,12 +326,17 @@ export class MultiTabIndexedDbComponentProvider extends IndexedDbComponentProvid
330
326
cfg . maxConcurrentLimboResolutions ,
331
327
startsAsPrimary
332
328
) ;
333
- this . sharedClientState . syncEngine = {
334
- applyBatchState : applyBatchState . bind ( null , syncEngine ) ,
335
- applyTargetState : applyTargetState . bind ( null , syncEngine ) ,
336
- applyActiveTargetsChange : applyActiveTargetsChange . bind ( null , syncEngine ) ,
337
- getActiveClients : getActiveClients . bind ( null , syncEngine )
338
- } ;
329
+ if ( this . sharedClientState instanceof WebStorageSharedClientState ) {
330
+ this . sharedClientState . syncEngine = {
331
+ applyBatchState : applyBatchState . bind ( null , syncEngine ) ,
332
+ applyTargetState : applyTargetState . bind ( null , syncEngine ) ,
333
+ applyActiveTargetsChange : applyActiveTargetsChange . bind (
334
+ null ,
335
+ syncEngine
336
+ ) ,
337
+ getActiveClients : getActiveClients . bind ( null , syncEngine )
338
+ } ;
339
+ }
339
340
return syncEngine ;
340
341
}
341
342
0 commit comments