diff --git a/packages/firestore/src/core/component_provider.ts b/packages/firestore/src/core/component_provider.ts index 54d16cc1655..618653b9237 100644 --- a/packages/firestore/src/core/component_provider.ts +++ b/packages/firestore/src/core/component_provider.ts @@ -166,10 +166,9 @@ export class MemoryOfflineComponentProvider } async terminate(): Promise { - if (this.gcScheduler) { - this.gcScheduler.stop(); - } - await this.sharedClientState.shutdown(); + this.gcScheduler?.stop(); + this.indexBackfillerScheduler?.stop(); + this.sharedClientState.shutdown(); await this.persistence.shutdown(); } } @@ -485,9 +484,6 @@ export class OnlineComponentProvider { async terminate(): Promise { await remoteStoreShutdown(this.remoteStore); - - if (this.datastore) { - await this.datastore.terminate(); - } + this.datastore?.terminate(); } }