Skip to content

fix(cookies): preserve the setAll method receiver - #300

Open
PhuocOng wants to merge 1 commit into
supabase:mainfrom
PhuocOng:fix/cookies-setall-receiver
Open

PhuocOng wants to merge 1 commit into
supabase:mainfrom
PhuocOng:fix/cookies-setall-receiver

Conversation

@PhuocOng

Copy link
Copy Markdown
Contributor

Summary

Fixes #299.

Bind cookies.setAll to the cookie adapter so methods that use this can write cookies. This matches how getAll and the deprecated cookie methods are called, while preserving the callback's arguments and sync/async return behavior.

Adds four regression cases covering browser/server adapters with synchronous and asynchronous writes, including cookie and header forwarding.

Verification

  • Before the fix: unchanged baseline passes 120 tests; both initial receiver regressions fail with Cannot set properties of undefined.
  • Ubuntu and Windows: all 124 tests pass with no skips, plus build, Prettier and the repository's ESLint command, using Node 22 and pnpm 11.1.2.
  • Real Auth/browser E2E: 8 scenarios pass with disposable Supabase Auth/Postgres and Chromium, exercising both public clients through sign-in, reload, refresh and sign-out, including chunk cleanup, unrelated-cookie preservation and server cache headers.

The two source files in this PR match the validated commit exactly. The additional workflows and E2E harness stay on the fork's validation branch and are not part of this PR. Runtime verification ran on GitHub-hosted runners, not locally.

AI-assisted with GitHub Copilot.

@PhuocOng
PhuocOng requested review from a team as code owners September 13, 2026 20:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cookies.setAll loses its receiver for stateful cookie adapters

1 participant