Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Nov 5, 2025

Description

Adding _clerk_skip_cache=true query string param to token requests that are explicitly invoked with skipCache option

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:

Summary by CodeRabbit

  • New Features

    • Added an optional cache-skip capability for token creation and a flag to signal cache-skipping in token requests.
  • Tests

    • Expanded test coverage for token creation cache-skip behavior: successful creation, default behavior, skip-enabled, and skip-disabled scenarios.
  • Chores

    • Added a changeset entry documenting the cache-skip query behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

🦋 Changeset detected

Latest commit: 2064343

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 Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Nov 20, 2025 2:24pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

A new CLERK_SKIP_CACHE constant was added and Token.create gained an optional skipCache parameter that, when true, appends a _clerk_skip_cache query param to token requests. Session forwards skipCache to Token.create and tests were added to verify behavior.

Changes

Cohort / File(s) Summary
Constants
packages/clerk-js/src/core/constants.ts
Added export const CLERK_SKIP_CACHE = '_clerk_skip_cache';. Reordered nearby constant declarations.
Token Resource
packages/clerk-js/src/core/resources/Token.ts
Token.create(path, body, skipCache) optional parameter added; when true constructs a search including CLERK_SKIP_CACHE=true and passes it to the fetch call.
Session Flow
packages/clerk-js/src/core/resources/Session.ts
Calls to Token.create updated to forward the skipCache argument from the caller.
Tests
packages/clerk-js/src/core/resources/__tests__/Token.test.ts
Added tests for Token.create covering success and skipCache behaviors (default, true, false); adjusted imports and minor assertions.
Changeset
.changeset/old-wombats-tease.md
Added changeset noting the _clerk_skip_cache query param for token requests when skipCache is used.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Session
    participant Token
    participant API

    Caller->>Session: requestToken(..., skipCache?)
    activate Session
    Session->>Token: create(path, body, skipCache)
    deactivate Session

    activate Token
    alt skipCache == true
        Note right of Token `#e6f7ff`: builds search with\nCLERK_SKIP_CACHE=true
        Token->>API: POST /path?_clerk_skip_cache=true (body)
    else skipCache == false or undefined
        Token->>API: POST /path (body)
    end
    deactivate Token

    API-->>Token: TokenResource
    Token-->>Caller: TokenResource
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas to inspect:
    • URL/search param construction and encoding for _clerk_skip_cache.
    • Other callers of Token.create to ensure compatibility with the new optional param.
    • Test assertions verifying query presence/absence and fetch invocation.

Poem

🐇 A tiny flag hops into the stack,
Tokens leap past caches and race right back,
Tests nod approval with a tiny clap,
Queries take a new, deliberate lap,
A rabbit cheers the skip — quick, light, and slack! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a _clerk_skip_cache query parameter to token requests, which is the core feature implemented across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-skip-cache-query-param

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d8830bd and ffe8caf.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/constants.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/clerk-js/src/core/constants.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (22, shared, clerk-js, RQ)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 5, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7155

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7155

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7155

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7155

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7155

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7155

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7155

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@7155

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7155

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7155

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7155

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7155

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7155

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7155

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@7155

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7155

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7155

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7155

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7155

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7155

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7155

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7155

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7155

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7155

commit: 2064343

@blacksmith-sh
Copy link

blacksmith-sh bot commented Nov 5, 2025

Found 46 test failures on Blacksmith runners:

Test View Logs
[chrome] › integration/tests/
components.test.ts:102:9 › component smoke tests @generic › long-running--next.appRoute
r.withEmailCodes › OrganizationProfile supports fallback
View Logs
[chrome] › integration/tests/elements/
next-sign-in.test.ts:174:7 › Next.js Sign-In Flow @elements › long-running--elements.ne
xt.appRouter › cannot sign in with wrong password but can sign in with email
View Logs
[chrome] › integration/tests/elements/
next-sign-in.test.ts:33:7 › Next.js Sign-In Flow @elements › long-running--elements.nex
t.appRouter › sign in with email and password
View Logs
[chrome] › integration/tests/elements/
next-sign-up.test.ts:13:7 › Next.js Sign-Up Flow @elements › long-running--elements.nex
t.appRouter › sign up with email and password
View Logs
[chrome] › integration/tests/elements/
next-sign-up.test.ts:147:7 › Next.js Sign-Up Flow @elements › long-running--elements.ne
xt.appRouter › sign up, sign out and sign in again
View Logs
[chrome] › integration/tests/elements/
next-sign-up.test.ts:66:7 › Next.js Sign-Up Flow @elements › long-running--elements.nex
t.appRouter › can't sign up with weak password
View Logs
[chrome] › integration/tests/elements/
otp.test.ts:135:9 › OTP @elements › long-running--elements.next.appRouter › Type: segme
nted-otp › should replace selected segment with new input
View Logs
[chrome] › integration/tests/elements/
otp.test.ts:196:9 › OTP @elements › long-running--elements.next.appRouter › Type: segme
nted-otp › should forward-delete char when pressing delete
View Logs
[chrome] › integration/tests/
resiliency.test.ts:230:9 › resiliency @generic › long-running--react.vite.withEmailCode
s › Clerk.status › clerk-js environment fails and status degraded
View Logs
[chrome] › integration/tests/
resiliency.test.ts:41:7 › resiliency @generic › long-running--react.vite.withEmailCodes
› signed in users can get a fresh session token when Client fails to load
View Logs
[chrome] › integration/tests/
session-tasks-multi-session.test.ts:33:9 › session tasks multi-session flow @nextjs › l
ong-running--next.appRouter.withSessionTasks › when switching sessions, navigate to tas
k
View Logs
[chrome] › integration/tests/session-token-cache/
multi-session.test.ts:54:9 › MemoryTokenCache Multi-Session Integration @nextjs › long-
running--next.appRouter.withSessionTasks › MemoryTokenCache multi-session - multiple us
ers in different tabs with separate token caches
View Logs
[chrome] › integration/tests/session-token-cache/
multi-session.test.ts:54:9 › MemoryTokenCache Multi-Session Integration @nextjs › long-
running--next.appRouter.withSessionTasks › MemoryTokenCache multi-session - multiple us
ers in different tabs with separate token caches
View Logs
[chrome] › integration/tests/session-token-cache/
multi-session.test.ts:54:9 › MemoryTokenCache Multi-Session Integration @nextjs › long-
running--next.appRouter.withSessionTasks › MemoryTokenCache multi-session - multiple us
ers in different tabs with separate token caches
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:101:7 › sign in flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › can reset password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:101:7 › sign in flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › can reset password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:101:7 › sign in flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › can reset password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:136:7 › sign in flow @generic @nextjs › long-running--react.vite.w
ithEmailCodes › cannot sign in with wrong password but can sign in with email
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:26:7 › sign in flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign in with email and password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:26:7 › sign in flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign in with email and password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:26:7 › sign in flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign in with email and password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:26:7 › sign in flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign in with email and password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:26:7 › sign in flow @generic @nextjs › long-running--react.vite.wi
thEmailCodes › sign in with email and password
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:74:7 › sign in flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign in only with phone number
View Logs
[chrome] › integration/tests/
sign-in-flow.test.ts:74:7 › sign in flow @generic @nextjs › long-running--react.vite.wi
thEmailCodes › sign in only with phone number
View Logs
[chrome] › integration/tests/
sign-in-or-up-flow.test.ts:29:9 › sign-in-or-up flow @nextjs › long-running--next.appRo
uter.withSignInOrUpFlow › sign-in › flows are combined
View Logs
[chrome] › integration/tests/
sign-in-or-up-flow.test.ts:29:9 › sign-in-or-up flow @nextjs › long-running--next.appRo
uter.withSignInOrUpFlow › sign-in › flows are combined
View Logs
[chrome] › integration/tests/
sign-in-or-up-flow.test.ts:88:9 › sign-in-or-up flow @nextjs › long-running--next.appRo
uter.withSignInOrUpFlow › sign-in › sign in only with phone number
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:124:7 › sign up flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › sign up with first name, last name, email, phone and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:124:7 › sign up flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › sign up with first name, last name, email, phone and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:13:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › sign up with email and password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:163:7 › sign up flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › sign up, sign out and sign in again
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:163:7 › sign up flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › sign up, sign out and sign in again
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:163:7 › sign up flow @generic @nextjs › long-running--next.appRout
er.withEmailCodes › sign up, sign out and sign in again
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:163:7 › sign up flow @generic @nextjs › long-running--react.vite.w
ithEmailCodes › sign up, sign out and sign in again
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:39:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › can't sign up with weak password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:39:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › can't sign up with weak password
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:65:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › can sign up with phone number
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:65:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › can sign up with phone number
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:93:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › (modal) can sign up with phone number
View Logs
[chrome] › integration/tests/
sign-up-flow.test.ts:93:7 › sign up flow @generic @nextjs › long-running--next.appRoute
r.withEmailCodes › (modal) can sign up with phone number
View Logs
[chrome] › integration/tests/
unsafeMetadata.test.ts:42:7 › unsafeMetadata @nextjs › long-running--next.appRouter.wit
hEmailCodes › combined sign up persists unsafeMetadata
View Logs
[chrome] › integration/tests/
update-props.test.ts:25:7 › sign in flow @generic › long-running--react.vite.withEmailC
odes › updating props after initial loading does not override defaults set by Clerk.loa
d()
View Logs
[chrome] › integration/tests/
user-avatar.test.ts:35:7 › UserAvatar component integration tests @generic › long-runni
ng--react.vite.withEmailCodes › UserAvatar loads and renders correctly when user is sig
ned in
View Logs
[chrome] › integration/tests/
user-profile.test.ts:90:7 › user profile @generic › user profile with path routing
View Logs
[setup] › integration/tests/
global.setup.ts:7:6 › start long running apps ─────────────────────
View Logs


Fix in Cursor

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.changeset/old-wombats-tease.md (2)

5-5: Remove unnecessary Markdown escape sequence.

The backslash before the underscore in \_clerk_skip_cache is not needed in changeset descriptions and will render as a literal backslash in release notes. The changeset parser treats this as plain text, not Markdown.

Apply this diff to remove the unnecessary escape:

-Added \_clerk_skip_cache query string param to token requests initiated with skipCache option
+Added _clerk_skip_cache query string param to token requests initiated with skipCache option

5-5: Clarify description for release notes.

The change description could be more specific about when this parameter is added (i.e., when skipCache is true). This will help users understand the new behavior from release notes.

Consider updating to:

-Added _clerk_skip_cache query string param to token requests initiated with skipCache option
+Added _clerk_skip_cache query string parameter to token requests when the skipCache option is set to true
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7037be5 and d8830bd.

📒 Files selected for processing (1)
  • .changeset/old-wombats-tease.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/old-wombats-tease.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Static analysis
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

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.

3 participants