Skip to content

Commit 92b1cac

Browse files
committed
Fix a build error
1 parent 2ea1fad commit 92b1cac

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

packages/firestore/src/local/lru_garbage_collector_impl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ export class LruScheduler implements Scheduler {
177177
}
178178

179179
/**
180-
* Implements the steps for LRU garbage collection. Exported for testing purpose only.
180+
* Implements the steps for LRU garbage collection.
181181
*/
182-
export class LruGarbageCollectorImpl implements LruGarbageCollector {
182+
class LruGarbageCollectorImpl implements LruGarbageCollector {
183183
constructor(
184184
private readonly delegate: LruDelegate,
185185
readonly params: LruParams

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {
3333
} from '../../../src/local/indexeddb_persistence';
3434
import { LocalStore } from '../../../src/local/local_store';
3535
import { LruParams } from '../../../src/local/lru_garbage_collector';
36-
import { LruGarbageCollectorImpl } from '../../../src/local/lru_garbage_collector_impl';
3736
import {
3837
MemoryEagerDelegate,
3938
MemoryLruDelegate,
@@ -228,10 +227,6 @@ export class MockMemoryOfflineComponentProvider extends MemoryOfflineComponentPr
228227
}
229228
}
230229

231-
// A LRU garbage collector whose params are mutable.
232-
type Mutable<T> = { -readonly [P in keyof T]: T[P] };
233-
export type MutableLruGarbageCollector = Mutable<LruGarbageCollectorImpl>;
234-
235230
export class MockConnection implements Connection {
236231
watchStream: StreamBridge<api.ListenRequest, api.ListenResponse> | null =
237232
null;

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ import {
7979
} from '../../../src/local/indexeddb_sentinels';
8080
import { LocalStore } from '../../../src/local/local_store';
8181
import { localStoreConfigureFieldIndexes } from '../../../src/local/local_store_impl';
82+
import { LruGarbageCollector } from '../../../src/local/lru_garbage_collector';
8283
import { MemoryLruDelegate } from '../../../src/local/memory_persistence';
8384
import {
8485
ClientId,
@@ -173,7 +174,6 @@ import {
173174
MockMemoryPersistence,
174175
MockMultiTabOfflineComponentProvider,
175176
MockOnlineComponentProvider,
176-
MutableLruGarbageCollector,
177177
QueryEvent,
178178
SharedWriteTracker
179179
} from './spec_test_components';
@@ -248,7 +248,7 @@ abstract class TestRunner {
248248
private localStore!: LocalStore;
249249
private remoteStore!: RemoteStore;
250250
private persistence!: MockMemoryPersistence | MockIndexedDbPersistence;
251-
private lruGarbageCollector!: MutableLruGarbageCollector;
251+
private lruGarbageCollector!: LruGarbageCollector;
252252
protected sharedClientState!: SharedClientState;
253253

254254
private useEagerGCForMemory: boolean;
@@ -889,9 +889,12 @@ abstract class TestRunner {
889889
private async doTriggerLruGC(cacheThreshold: number): Promise<void> {
890890
return this.queue.enqueue(async () => {
891891
if (!!this.lruGarbageCollector) {
892-
this.lruGarbageCollector.params.cacheSizeCollectionThreshold =
893-
cacheThreshold;
894-
this.lruGarbageCollector.params.percentileToCollect = 100;
892+
const params = this.lruGarbageCollector.params as {
893+
cacheSizeCollectionThreshold: number;
894+
percentileToCollect: number;
895+
};
896+
params.cacheSizeCollectionThreshold = cacheThreshold;
897+
params.percentileToCollect = 100;
895898
await this.localStore.collectGarbage(this.lruGarbageCollector);
896899
}
897900
});

0 commit comments

Comments
 (0)