Skip to content

Commit

Permalink
Merge ee12bb1 into 2c90aec
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian authored Aug 17, 2021
2 parents 2c90aec + ee12bb1 commit f056cd1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/witty-chicken-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/firestore": patch
---

Fixed a regression that prevented the garbage collector from running if multi-tab was disabled.
9 changes: 9 additions & 0 deletions packages/firestore/src/core/component_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ export class IndexedDbOfflineComponentProvider extends MemoryOfflineComponentPro
this.onlineComponentProvider.syncEngine
);
await fillWritePipeline(this.onlineComponentProvider.remoteStore);

// NOTE: This will immediately call the listener, so we make sure to
// set it after localStore / remoteStore are started.
await this.persistence.setPrimaryStateListener(() => {
if (this.gcScheduler && !this.gcScheduler.started) {
this.gcScheduler.start(this.localStore);
}
return Promise.resolve();
});
}

createLocalStore(cfg: ComponentConfiguration): LocalStore {
Expand Down

0 comments on commit f056cd1

Please sign in to comment.