File tree Expand file tree Collapse file tree 4 files changed +4023
-4418
lines changed Expand file tree Collapse file tree 4 files changed +4023
-4418
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,9 @@ class MemoryLocalCacheImpl implements MemoryLocalCache {
62
62
this . _offlineComponentProvider =
63
63
settings . garbageCollector . _offlineComponentProvider ;
64
64
} else {
65
- this . _offlineComponentProvider = new MemoryOfflineComponentProvider ( ) ;
65
+ this . _offlineComponentProvider = new LruGcMemoryOfflineComponentProvider (
66
+ undefined
67
+ ) ;
66
68
}
67
69
}
68
70
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ import { Aggregate } from './aggregate';
62
62
import { NamedQuery } from './bundle' ;
63
63
import {
64
64
ComponentConfiguration ,
65
+ LruGcMemoryOfflineComponentProvider ,
65
66
MemoryOfflineComponentProvider ,
66
67
OfflineComponentProvider ,
67
68
OnlineComponentProvider
@@ -336,7 +337,7 @@ async function ensureOfflineComponents(
336
337
logDebug ( LOG_TAG , 'Using default OfflineComponentProvider' ) ;
337
338
await setOfflineComponentProvider (
338
339
client ,
339
- new MemoryOfflineComponentProvider ( )
340
+ new LruGcMemoryOfflineComponentProvider ( undefined )
340
341
) ;
341
342
}
342
343
}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
25
25
DocumentData ,
26
26
DocumentReference ,
27
27
Firestore ,
28
+ memoryEagerGarbageCollector ,
28
29
memoryLocalCache ,
29
30
memoryLruGarbageCollector ,
30
31
newTestApp ,
@@ -148,10 +149,14 @@ export function withTestDb(
148
149
export function withEnsuredEagerGcTestDb (
149
150
fn : ( db : Firestore ) => Promise < void >
150
151
) : Promise < void > {
152
+ const newSettings = { ...DEFAULT_SETTINGS } ;
153
+ newSettings . localCache = memoryLocalCache ( {
154
+ garbageCollector : memoryEagerGarbageCollector ( )
155
+ } ) ;
151
156
return withTestDbsSettings (
152
157
false ,
153
158
DEFAULT_PROJECT_ID ,
154
- { ... DEFAULT_SETTINGS , cacheSizeBytes : 1 * 1024 * 1024 } ,
159
+ newSettings ,
155
160
1 ,
156
161
async ( [ db ] ) => {
157
162
return fn ( db ) ;
You can’t perform that action at this time.
0 commit comments