Skip to content

Conversation

@jacekradko
Copy link
Member

Description

Looks like this was missed in the initial change to send the Partitioned attribute for the __session cookie

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented May 1, 2025

🦋 Changeset detected

Latest commit: 46770c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

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

@vercel
Copy link

vercel bot commented May 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2025 6:32pm

@jacekradko jacekradko requested a review from Copilot May 1, 2025 18:22
Copy link
Contributor

Copilot AI left a 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

@jacekradko jacekradko changed the title fix(clerk-js): added Partitioned attribute to CHIPS build fix(clerk-js): Add Partitioned attribute to CHIPS build May 1, 2025
@jacekradko jacekradko changed the title fix(clerk-js): Add Partitioned attribute to CHIPS build fix(clerk-js): Add Partitioned to __client_uat in CHIPS build May 1, 2025
Comment on lines +8 to +11
jest.mock('@clerk/shared/cookie');
jest.mock('@clerk/shared/date');
jest.mock('../../../../utils');
jest.mock('../../getSecureAttribute');
Copy link
Member

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 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many?

Comment on lines +57 to +58
suffixedClientUatCookie.set(val, { domain, expires, partitioned, sameSite, secure });
clientUatCookie.set(val, { domain, expires, partitioned, sameSite, secure });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classic @jacekradko 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷🏼‍♂️

@jacekradko jacekradko merged commit 7e96632 into main May 2, 2025
32 checks passed
@jacekradko jacekradko deleted the fix/set-partitioned-for-client-uat branch May 2, 2025 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants