From cdeb2316d05119ccbc185a0cde87c104be101f74 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Wed, 8 Jul 2026 13:57:16 -0400 Subject: [PATCH] test(auth): assert parseOAuthPersistBlob({}) returns null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document the contract the remote read() path leans on — the server's missing-file response is `c.json({}, 200)`, and the backend now passes that empty object straight to parseOAuthPersistBlob. Addresses the optional note on Claude review of #1612. Co-Authored-By: Claude Opus 4.8 (1M context) --- clients/web/src/test/core/auth/oauth-persist.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clients/web/src/test/core/auth/oauth-persist.test.ts b/clients/web/src/test/core/auth/oauth-persist.test.ts index b8c59624..62f8eadd 100644 --- a/clients/web/src/test/core/auth/oauth-persist.test.ts +++ b/clients/web/src/test/core/auth/oauth-persist.test.ts @@ -9,6 +9,13 @@ describe("parseOAuthPersistBlob", () => { expect(parseOAuthPersistBlob(null)).toBeNull(); }); + it("returns null for an empty object (server missing-file response)", () => { + // The remote read() path relies on this: the server answers a missing + // store with `c.json({}, 200)`, and the backend passes that straight + // through instead of special-casing an empty object. + expect(parseOAuthPersistBlob({})).toBeNull(); + }); + it("reads plain JSON with servers and idpSessions", () => { const snapshot = { servers: {