Repository navigation
fix(nextjs): settle onBeforeSetActive when cache invalidation fails - #10852
wobsoriano wants to merge 6 commits into
Conversation
…-active-rejection
In a tab from a previous deployment, router.refresh() gets a payload from the new build, and Next.js falls back to a full page reload. The reload starts while signOut() removes the session or setActive() navigates, and can stop the request before it completes. The after-transition hook already refreshes the router. Co-authored-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 425cb08 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
|
Co-authored-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
Co-authored-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>

Description
Takeover of #10088 by @RaphaelFakhri, who found and fixed this. Their commits are kept as-is.
Added in the takeover:
window.__internal_onBeforeSetActiveno longer callsrouter.refresh()wheninvalidateCacheAction()fails. In a tab from a previous deployment, that refresh made Next.js reload the whole page whilesignOut()was removing the session. In a local repro after a redeploy, the user stayed signed in on 5 of 5 sign-out attempts. The hook now only resolves.window.__internal_onAfterSetActivestill refreshes the router after the transition.Fixes #9987
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude under Rob's supervision.