@@ -180,8 +180,6 @@ export class MemoryComponentProvider implements ComponentProvider {
180
180
* Provides all components needed for Firestore with IndexedDB persistence.
181
181
*/
182
182
export class IndexedDbComponentProvider extends MemoryComponentProvider {
183
- persistence ! : IndexedDbPersistence ;
184
-
185
183
// TODO(tree-shaking): Create an IndexedDbComponentProvider and a
186
184
// MultiTabComponentProvider. The IndexedDbComponentProvider should depend
187
185
// on LocalStore and SyncEngine.
@@ -191,6 +189,11 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
191
189
async initialize ( cfg : ComponentConfiguration ) : Promise < void > {
192
190
await super . initialize ( cfg ) ;
193
191
192
+ debugAssert (
193
+ this . persistence instanceof IndexedDbPersistence ,
194
+ 'IndexedDbComponentProvider should provide IndexedDBPersistence'
195
+ ) ;
196
+
194
197
// NOTE: This will immediately call the listener, so we make sure to
195
198
// set it after localStore / remoteStore are started.
196
199
await this . persistence . setPrimaryStateListener ( async isPrimary => {
@@ -208,6 +211,10 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
208
211
}
209
212
210
213
createLocalStore ( cfg : ComponentConfiguration ) : LocalStore {
214
+ debugAssert (
215
+ this . persistence instanceof IndexedDbPersistence ,
216
+ 'IndexedDbComponentProvider should provide IndexedDBPersistence'
217
+ ) ;
211
218
return new MultiTabLocalStore (
212
219
this . persistence ,
213
220
new IndexFreeQueryEngine ( ) ,
@@ -232,6 +239,10 @@ export class IndexedDbComponentProvider extends MemoryComponentProvider {
232
239
createGarbageCollectionScheduler (
233
240
cfg : ComponentConfiguration
234
241
) : GarbageCollectionScheduler | null {
242
+ debugAssert (
243
+ this . persistence instanceof IndexedDbPersistence ,
244
+ 'IndexedDbComponentProvider should provide IndexedDBPersistence'
245
+ ) ;
235
246
const garbageCollector = this . persistence . referenceDelegate
236
247
. garbageCollector ;
237
248
return new LruScheduler ( garbageCollector , cfg . asyncQueue ) ;
0 commit comments