Skip to content

Commit 4c1a20c

Browse files
committed
Make maxConcurrentLimboResolutions a required parameter of the SyncEngine constructor.
1 parent abfa6fb commit 4c1a20c

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

packages/firestore/src/core/firestore_client.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { OnlineState, OnlineStateSource } from './types';
5353
import { ViewSnapshot } from './view_snapshot';
5454

5555
const LOG_TAG = 'FirestoreClient';
56+
const MAX_CONCURRENT_LIMBO_RESOLUTIONS = 100;
5657

5758
/** DOMException error code constants. */
5859
const DOM_EXCEPTION_INVALID_STATE = 11;
@@ -369,7 +370,8 @@ export class FirestoreClient {
369370
this.localStore,
370371
this.remoteStore,
371372
this.sharedClientState,
372-
user
373+
user,
374+
MAX_CONCURRENT_LIMBO_RESOLUTIONS
373375
);
374376

375377
this.sharedClientState.onlineStateHandler = sharedClientStateOnlineStateChangedHandler;

packages/firestore/src/core/sync_engine.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
188188
// PORTING NOTE: Manages state synchronization in multi-tab environments.
189189
private sharedClientState: SharedClientState,
190190
private currentUser: User,
191-
private maxConcurrentLimboResolutions: number = 100
191+
private maxConcurrentLimboResolutions: number
192192
) {}
193193

194194
// Only used for testing.

packages/firestore/test/unit/specs/spec_test_runner.ts

+7-16
Original file line numberDiff line numberDiff line change
@@ -511,22 +511,13 @@ abstract class TestRunner {
511511
remoteStoreOnlineStateChangedHandler,
512512
connectivityMonitor
513513
);
514-
if (this.maxConcurrentLimboResolutions) {
515-
this.syncEngine = new SyncEngine(
516-
this.localStore,
517-
this.remoteStore,
518-
this.sharedClientState,
519-
this.user,
520-
this.maxConcurrentLimboResolutions
521-
);
522-
} else {
523-
this.syncEngine = new SyncEngine(
524-
this.localStore,
525-
this.remoteStore,
526-
this.sharedClientState,
527-
this.user
528-
);
529-
}
514+
this.syncEngine = new SyncEngine(
515+
this.localStore,
516+
this.remoteStore,
517+
this.sharedClientState,
518+
this.user,
519+
this.maxConcurrentLimboResolutions ?? Number.MAX_SAFE_INTEGER
520+
);
530521

531522
// Set up wiring between sync engine and other components
532523
this.remoteStore.syncEngine = this.syncEngine;

0 commit comments

Comments
 (0)