Skip to content

fix(ui): show OAuth transport failures in Connected Accounts - #10878

Open
wobsoriano wants to merge 3 commits into
mainfrom
rob/connected-accounts-transport
Open

wobsoriano wants to merge 3 commits into
mainfrom
rob/connected-accounts-transport

Conversation

@wobsoriano

@wobsoriano wobsoriano commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Description

In Electron apps, Connected Accounts in <UserProfile /> got stuck when the OAuth transport failed, for example when the system browser couldn't open or the callback timed out. The connect buttons stayed disabled with no error, and reconnect failed silently. The transport rejects with a plain Error, and handleError rethrows errors it doesn't recognize, so the card never went back to idle.

Transport failures are now wrapped in a ClerkRuntimeError with the something_went_wrong code. Connect and reconnect show "Something went wrong. Please try again.", and the connect buttons are enabled again.

await electronApplication.evaluate(({ shell }) => {
  shell.openExternal = async () => {
    throw new Error('No application is registered to open this URL');
  };
});
// Connect Google → before: button stays loading, no error. After: error shown, button enabled.

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:

🤖 Generated with Claude under Rob's supervision.

The connect button stays loading and no error appears when the
Electron OAuth transport rejects, for example when the system
browser cannot open. Reconnect also shows no error.
A transport rejects with a plain error. handleError rethrows plain
errors, so connect skipped card.setIdle and stayed loading, and
reconnect showed nothing. Wrap transport.open rejections in a
ClerkRuntimeError with the something_went_wrong code so both paths
show the localized error and connect resets its buttons.
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 18, 2026 6:24am UTC
mosaic-docs Error Error Nov 18, 2026 6:24am UTC
swingset Ready Ready Preview Nov 18, 2026 6:24am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9351fc4

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

This PR includes changesets to release 2 packages
Name Type
@clerk/ui Patch
@clerk/chrome-extension 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

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 832b3b1 and 9351fc4.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds openOAuthTransportWithClerkErrors to convert OAuth transport failures into Clerk runtime errors. Connected Accounts connection and reconnection flows use the helper. New tests verify error messages after transport rejection and check that the connection menu item remains enabled. An Electron test covers a failure when opening the system browser. A changeset records the patch.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Suggested reviewers: alexcarpenter, jeremy-clerk

Merge Risk: Minimal · previous review 832b3

This change shows a localized error and re-enables the connect buttons when the OAuth transport cannot open or times out. No merge-blocking risk was identified. An unconfirmed minor edge case with overlapping reconnect attempts could briefly leave a stale error alert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix and its scope: OAuth transport failures in Connected Accounts. The changeset wraps transport.open rejections in a ClerkRuntimeError so the existing error shows and connect butt…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description explains that Connected Accounts in the UserProfile component stayed stuck when the OAuth transport failed in Electron apps. It states the fix wraps transport failures in a ClerkRuntim…
Full details: Title check

Explanation

The title names the fix and its scope: OAuth transport failures in Connected Accounts. The changeset wraps transport.open rejections in a ClerkRuntimeError so the existing error shows and connect buttons re-enable. The title is specific and matches the main change.

Full details: Description check

Explanation

The description explains that Connected Accounts in the UserProfile component stayed stuck when the OAuth transport failed in Electron apps. It states the fix wraps transport failures in a ClerkRuntimeError with the something_went_wrong code, so connect and reconnect show an error and re-enable the buttons. It includes an Electron test snippet that matches the changeset and the test files. The description is specific and relevant to the changes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8229dfa and 832b3b1.

Files selected for processing: 6

  • .changeset/connected-accounts-transport-errors.md
  • integration/tests/electron/basic.test.ts
  • packages/ui/src/components/UserProfile/ConnectedAccountsMenu.tsx
  • packages/ui/src/components/UserProfile/ConnectedAccountsSection.tsx
  • packages/ui/src/components/UserProfile/__tests__/ConnectedAccountsSection.test.tsx
  • packages/ui/src/components/UserProfile/oauthTransport.ts
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 6 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-11-18T06:25:21.199Z

Summary

Metric Count
Packages analyzed 20
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on 9351fc4.

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10878

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10878

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10878

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10878

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10878

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10878

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10878

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10878

@clerk/upgrade

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

@clerk/vue

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

commit: 9351fc4

@blacksmith-sh

blacksmith-sh Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Matches Connect: failed transport shows error, re-enables

After a rejected transport, Connect shows "Something went wrong. Please try again." and the provider button is clickable again (a second click reached the transport); before, it stayed spinning and disabled with no error and an unhandled rejection.

Merge-base

Connect menu

This PR 832b3b12

Connect menu

Merge-base

Page state

This PR 832b3b12

Page state

Also checked · 2 match

Matches Reconnect: failed transport shows error
Matches Successful transport still connects

Proof on 832b3b12 · mocked: Clerk Frontend API (The sandbox's MSW UserButtonSignedIn scenario serves the signed-in user, with th...), @clerk/electron transport (A stub __internal_oauthTransport on the Clerk instance rejects open() with the I...) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

This branch was successfully deployed

2 active deployments
Preview – swingset — 9351fc43 Deployed Nov 18, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 9351fc43 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant