-
Notifications
You must be signed in to change notification settings - Fork 402
fix(clerk-js): Add Partitioned to __client_uat in CHIPS build #5785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 46770c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue by sending the Partitioned attribute for the __session cookie when building for CHIPS.
- Updates cookie options in clientUat.ts to conditionally set the sameSite and partitioned attributes.
- Adds new tests for the clientUat cookie behavior in various contexts.
- Enhances test coverage in both session and clientUat tests to ensure expected cookie creation, setting, and removal.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/clerk-js/src/core/auth/cookies/clientUat.ts | Updated cookie options with a new Partitioned attribute and adjusted sameSite strategy |
| packages/clerk-js/src/core/auth/cookies/tests/session.test.ts | Added tests to validate session cookie creation and prioritization between suffixed and non-suffixed cookies |
| packages/clerk-js/src/core/auth/cookies/tests/clientUat.test.ts | Added tests to validate clientUat cookie behavior across different contexts |
| jest.mock('@clerk/shared/cookie'); | ||
| jest.mock('@clerk/shared/date'); | ||
| jest.mock('../../../../utils'); | ||
| jest.mock('../../getSecureAttribute'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot of mocks 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many?
| suffixedClientUatCookie.set(val, { domain, expires, partitioned, sameSite, secure }); | ||
| clientUatCookie.set(val, { domain, expires, partitioned, sameSite, secure }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classic @jacekradko 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷🏼♂️
Description
Looks like this was missed in the initial change to send the Partitioned attribute for the
__sessioncookieChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change