Skip to content

Commit 2448b16

Browse files
Fix integration tests
1 parent b7766c0 commit 2448b16

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

packages/firestore/src/core/component_provider.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ export class MemoryComponentProvider {
107107
OnlineStateSource.SharedClientState
108108
);
109109
this.remoteStore.syncEngine = this.syncEngine;
110-
110+
111+
await this.localStore.start();
111112
await this.sharedClientState.start();
112113
await this.remoteStore.start();
113114

@@ -212,12 +213,6 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
212213
'IndexedDbComponentProvider should provide MultiTabSyncEngine'
213214
);
214215

215-
if (this.sharedClientState instanceof WebStorageSharedClientState) {
216-
this.sharedClientState.syncEngine = this.syncEngine;
217-
}
218-
219-
await this.localStore.start();
220-
221216
// NOTE: This will immediately call the listener, so we make sure to
222217
// set it after localStore / remoteStore are started.
223218
await this.persistence.setPrimaryStateListener(async isPrimary => {
@@ -251,13 +246,17 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
251246
this.localStore instanceof MultiTabLocalStore,
252247
'IndexedDbComponentProvider should provide MultiTabLocalStore'
253248
);
254-
return new MultiTabSyncEngine(
249+
const syncEngine = new MultiTabSyncEngine(
255250
this.localStore,
256251
this.remoteStore,
257252
this.sharedClientState,
258253
cfg.initialUser,
259254
cfg.maxConcurrentLimboResolutions
260255
);
256+
if (this.sharedClientState instanceof WebStorageSharedClientState) {
257+
this.sharedClientState.syncEngine = syncEngine;
258+
}
259+
return syncEngine;
261260
}
262261

263262
createGarbageCollectionScheduler(

packages/firestore/src/local/local_store.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ export class LocalStore {
219219
this.queryEngine.setLocalDocumentsView(this.localDocuments);
220220
}
221221

222+
/** Starts the LocalStore. */
223+
start(): Promise<void> {
224+
return Promise.resolve();
225+
}
226+
222227
/**
223228
* Tells the LocalStore that the currently authenticated user has changed.
224229
*

0 commit comments

Comments
 (0)