From 1bddf5269a19b6dc1b89145c1d9363332ff9d092 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Fri, 24 Jul 2026 23:43:35 +0800 Subject: [PATCH] fix(storage): keep the json loadAll closed guard a rejection Dropping async for the lint gate turned the closed-unit guard into a synchronous throw, breaking the conformance clause that every post-close operation rejects. Restore async with a justified require-await disable; the guard's rejection semantics are what the shared suite pins. --- packages/storage/storage-json/src/unit.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/storage/storage-json/src/unit.ts b/packages/storage/storage-json/src/unit.ts index 1bf272ec19..9591c30573 100644 --- a/packages/storage/storage-json/src/unit.ts +++ b/packages/storage/storage-json/src/unit.ts @@ -56,13 +56,14 @@ class JsonKvUnit implements KvUnit { private readonly onClose: () => void, ) {} - loadAll(): Promise<{ tables: Record>; global: unknown }> { + // eslint-disable-next-line @typescript-eslint/require-await -- async keeps the closed guard a rejection, not a synchronous throw + async loadAll(): Promise<{ tables: Record>; global: unknown }> { this.assertOpen() const tables: Record> = {} for (const [table, records] of this.state.tables) { tables[table] = Object.fromEntries(records) } - return Promise.resolve({ tables, global: this.state.global }) + return { tables, global: this.state.global } } async putRecord(table: string, key: string, value: unknown): Promise {