Skip to content

fix(cookies): 去重服务端重复 cookie 写入#246

Open
pjpjq wants to merge 1 commit into
supabase:mainfrom
pjpjq:codex/dedupe-server-cookie-writes
Open

fix(cookies): 去重服务端重复 cookie 写入#246
pjpjq wants to merge 1 commit into
supabase:mainfrom
pjpjq:codex/dedupe-server-cookie-writes

Conversation

@pjpjq

@pjpjq pjpjq commented Jun 8, 2026

Copy link
Copy Markdown

What changed

  • Wrap server-side cookies.setAll with a duplicate-payload guard.
  • Skip a repeated identical cookies+headers batch for the same setAll handler, while still allowing different payloads through.
  • Add regression coverage for duplicate and changed payload writes.

Why

When multiple server clients are created during the same SSR request, identical refresh writes can call the same response cookie writer repeatedly and emit duplicate Set-Cookie headers.

Fixes #144.

Validation

  • pnpm test src/cookies.spec.ts --run
  • pnpm build
  • git diff --check

@pjpjq pjpjq requested review from a team as code owners June 8, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant