From 01663bb7b4c665132e973ddc6d16e2cd95c18efe Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Wed, 30 Oct 2024 21:01:27 +0000 Subject: [PATCH] fix: memory leak in `DataStore` We have a set of promises waiting to be indexed, and we never removed these promises from the set. This fixes that memory leak. --- src/datastore/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/datastore/index.js b/src/datastore/index.js index 6a29e78a..bf3d8be3 100644 --- a/src/datastore/index.js +++ b/src/datastore/index.js @@ -111,6 +111,7 @@ export class DataStore extends TypedEmitter { const pending = this.#pendingIndex.get(versionId) if (!pending) continue pending.resolve() + this.#pendingIndex.delete(versionId) } for (const schemaName of this.schemas) { // Unsupported initially