From 3eb07e38aedcc31ee2ea5e3a283903b2a4d83cd8 Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Mon, 24 Aug 2026 14:53:39 +1000 Subject: [PATCH] fix(app): use a deletable cursor for draft blob cleanup (#44594) Co-authored-by: Brendan Allan --- packages/app/src/runtime/persistence/drafts.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/app/src/runtime/persistence/drafts.ts b/packages/app/src/runtime/persistence/drafts.ts index 9d484bd55fc..be20a3d1d24 100644 --- a/packages/app/src/runtime/persistence/drafts.ts +++ b/packages/app/src/runtime/persistence/drafts.ts @@ -114,11 +114,12 @@ export function createBrowserDraftStore(): DraftStore { if (item?.blob && typeof item.blob.id === "string") used.add(item.blob.id) return item }) - const blobs = transaction.objectStore("blobs").openKeyCursor() + const store = transaction.objectStore("blobs") + const blobs = store.openKeyCursor() blobs.addEventListener("success", () => { const cursor = blobs.result if (!cursor) return - if (!used.has(String(cursor.key))) cursor.delete() + if (!used.has(String(cursor.key))) store.delete(cursor.key) cursor.continue() }) })