Conversation
🦋 Changeset detectedLatest commit: 2377201 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 GitHub.
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
|
||
| describe('with offline browser and network failure', () => { | ||
| beforeEach(() => { | ||
| // Use real timers for offline tests to avoid unhandled rejection issues with retry logic |
d134aeb to
c230146
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis pull request adds a patch release for 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
992a3ba to
2377201
Compare
| // Throw when offline and no token so retry() in getToken() can fire. | ||
| // Without this, _getToken returns null (success) and retry() never calls shouldRetry. | ||
| if (result === null && !isValidBrowserOnline()) { | ||
| throw new ClerkRuntimeError('Network request failed while offline', { code: 'network_error' }); |
There was a problem hiding this comment.
Recommend that we re-use ClerkOfflineError here
| return cachedToken.getRawString() || null; | ||
| result = cachedToken.getRawString() || null; | ||
| } else { | ||
| result = await this.#fetchToken(template, organizationId, tokenId, shouldDispatchTokenUpdate, skipCache); |
There was a problem hiding this comment.
does this throw if offline? should we avoid fetching if we're offline in the first place?
Description
When offline, two code paths in
Session.tsemittoken:updateevents with empty tokens.AuthCookieServiceinterprets empty tokens as signed-out and removes the__session cookie— even though the session is still valid server-side. On the next page load or visibility change, the missing cookie makes the user appear signed out.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit