test(auth): assert parseOAuthPersistBlob({}) returns null

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) <noreply@anthropic.com>
This commit is contained in:
cliffhall 2026-07-08 13:57:16 -04:00
commit cdeb2316d0

View file

@ -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: {