Skip to content
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

chore(clerk-js): Remove non-actionable error from Session poller #5494

Merged

Conversation

panteliselef
Copy link
Member

Description

Only perform actionable steps when Session poller fails to fetch a fresh token.

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:

@panteliselef panteliselef requested a review from a team March 31, 2025 16:59
@panteliselef panteliselef self-assigned this Mar 31, 2025
Copy link

changeset-bot bot commented Mar 31, 2025

🦋 Changeset detected

Latest commit: b3367df

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

Copy link

vercel bot commented Mar 31, 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 Apr 2, 2025 3:13pm

@panteliselef panteliselef force-pushed the elef/sdki-970-remove-non-actionable-errors-from-poller branch from dd304a5 to 74d22ca Compare March 31, 2025 17:02
Comment on lines 184 to 187
//throw if not a clerk api error (aka fapi error) and not a network error
if (!isClerkAPIResponseError(e) && !isClerkRuntimeError(e)) {
clerkCoreErrorTokenRefreshFailed(e.message || e);
}
Copy link
Member

Choose a reason for hiding this comment

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

will removing this impact the is4xxError check below? I think most likely not, but wondering if we want to early return on non clerk API / runtime errors (as this implicitly does today)

@jacekradko jacekradko requested a review from Copilot April 2, 2025 01:49
Copy link
Contributor

@Copilot 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 removes the non-actionable error handling from the Session poller.

  • Removed the clerkCoreErrorTokenRefreshFailed function from errors.ts.
  • Updated AuthCookieService.ts to eliminate throwing an error on non-4XX scenarios during token refresh.
  • Added a changeset entry confirming the patch release.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/clerk-js/src/core/errors.ts Removed the non-actionable error function.
packages/clerk-js/src/core/auth/AuthCookieService.ts Removed the error throw for non-clerk API/runtime errors, aligning with the PR purpose.
.changeset/fresh-numbers-sink.md Added changeset information for the patch release.

@panteliselef
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @panteliselef - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.0.17-snapshot.v20250402153214
@clerk/astro 2.4.6-snapshot.v20250402153214
@clerk/backend 1.26.0-snapshot.v20250402153214
@clerk/chrome-extension 2.2.24-snapshot.v20250402153214
@clerk/clerk-js 5.59.0-snapshot.v20250402153214
@clerk/elements 0.23.9-snapshot.v20250402153214
@clerk/clerk-expo 2.9.7-snapshot.v20250402153214
@clerk/expo-passkeys 0.2.1-snapshot.v20250402153214
@clerk/express 1.3.60-snapshot.v20250402153214
@clerk/fastify 2.1.33-snapshot.v20250402153214
@clerk/localizations 3.13.5-snapshot.v20250402153214
@clerk/nextjs 6.12.13-snapshot.v20250402153214
@clerk/nuxt 1.4.7-snapshot.v20250402153214
@clerk/clerk-react 5.25.6-snapshot.v20250402153214
@clerk/react-router 1.1.12-snapshot.v20250402153214
@clerk/remix 4.5.12-snapshot.v20250402153214
@clerk/shared 3.3.0-snapshot.v20250402153214
@clerk/tanstack-react-start 0.12.3-snapshot.v20250402153214
@clerk/testing 1.4.34-snapshot.v20250402153214
@clerk/themes 2.2.27-snapshot.v20250402153214
@clerk/types 4.50.2-snapshot.v20250402153214
@clerk/vue 1.4.6-snapshot.v20250402153214

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/[email protected] --save-exact

@clerk/astro

npm i @clerk/[email protected] --save-exact

@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/chrome-extension

npm i @clerk/[email protected] --save-exact

@clerk/clerk-js

npm i @clerk/[email protected] --save-exact

@clerk/elements

npm i @clerk/[email protected] --save-exact

@clerk/clerk-expo

npm i @clerk/[email protected] --save-exact

@clerk/expo-passkeys

npm i @clerk/[email protected] --save-exact

@clerk/express

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

@clerk/localizations

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/nuxt

npm i @clerk/[email protected] --save-exact

@clerk/clerk-react

npm i @clerk/[email protected] --save-exact

@clerk/react-router

npm i @clerk/[email protected] --save-exact

@clerk/remix

npm i @clerk/[email protected] --save-exact

@clerk/shared

npm i @clerk/[email protected] --save-exact

@clerk/tanstack-react-start

npm i @clerk/[email protected] --save-exact

@clerk/testing

npm i @clerk/[email protected] --save-exact

@clerk/themes

npm i @clerk/[email protected] --save-exact

@clerk/types

npm i @clerk/[email protected] --save-exact

@clerk/vue

npm i @clerk/[email protected] --save-exact

@panteliselef panteliselef merged commit 837d7ca into main Apr 2, 2025
30 checks passed
@panteliselef panteliselef deleted the elef/sdki-970-remove-non-actionable-errors-from-poller branch April 2, 2025 16:36
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