Repository navigation
[Bug]: Account controls and T3 Connect stay unavailable after Clerk UI load failure until Reload #15725
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/desktop
Summary
In T3 Code Nightly 0.0.46-nightly.20261004.2648 on macOS, a failed Clerk UI script download left the Settings footer with neither the account avatar nor the "Sign in to T3 Connect" control. A previously connected remote environment could not reconnect through T3 Connect. A separate shell HTTPS request to the exact Clerk UI script URL succeeded while the running app remained in this state. The failing renderer's connectivity before reload was not directly established. View > Reload restored the existing account and remote connection without signing in again or restarting the local server.
Steps to reproduce
The known case involved two Apple Silicon Macs running the same nightly build with identical app.asar hashes. Both had previously been signed in to the same T3 Connect account. The initial network transition was not captured and has not been deliberately reproduced.
- In the observed failing desktop app, open Settings > Connections. The account footer has neither an avatar nor a sign-in button, and the previously saved remote environment reports a cloud sign-in error.
- Inspect the renderer console. In this case the Clerk UI script reported ERR_NAME_NOT_RESOLVED and ERR_NETWORK_CHANGED, and the account initialization reported failed_to_load_clerk_ui.
- In the observed case, a separate unauthenticated shell HTTPS request to the exact Clerk UI script URL returned HTTP 200, while the running renderer still displayed the failure and the footer and remote connection remained unavailable. The renderer's own connectivity before reload was not directly established.
- Choose View > Reload. In the observed case, the account avatar and connected remote environment returned without another sign-in.
A proposed controlled reproduction is to make the Clerk UI script unavailable during renderer startup, then restore connectivity. That controlled transition was not run; the precise timing and conditions that produced the original failure are unknown. One existing failure and one successful reload recovery were observed, not a measured failure frequency.
Expected behavior
The desktop Settings > Connections workflow should expose the T3 Connect account controls and allow an already authenticated client to connect to its environment. If account initialization fails because a network dependency is temporarily unavailable, the UI should expose an actionable failure or retry path and permit recovery when connectivity returns. A valid saved login should remain usable.
Actual behavior
Both account controls were absent from the Settings footer. T3 Connect and activity publication switches were disabled. The saved remote environment showed "Connection failed: Your cloud sign-in changed. Sign in again to authorize the environment." There was no visible account initialization error or retry control in the footer.
The other Mac, running the identical desktop app bundle, still displayed its account avatar and a connected environment. This comparison was supplied by the user in a screenshot; installed version and bundle equality were checked directly. On the failing Mac, View > Reload restored the avatar, enabled the cloud controls, and changed the saved environment to "T3 Connect · Connected." The local server PID and start timestamp were unchanged. No sign-in, sign-out, token clearing, pairing change, network setting change, or host restart was performed.
Evidence
- Expected source: docs/user/remote-access.md, T3 Connect section, documents the desktop Settings > Connections sign-in and environment workflow. The installed nightly source also renders signed-in and signed-out controls in apps/web/src/components/clerk/T3ConnectSidebarSignIn.tsx and includes them in apps/web/src/components/settings/SettingsSidebarNav.tsx.
- Failure source: Direct observation of the affected macOS desktop Settings > Connections footer and renderer console on version 0.0.46-nightly.20261004.2648, followed by direct observation of successful recovery through View > Reload. The relevant sanitized console messages are included below.
- Evidence provenance: observed
- Local verification: reproduced
- Reproduction completeness: incomplete
- Missing fact: The exact initial DNS or network transition and timing that caused the Clerk UI script download to fail. No controlled network-disruption rerun was performed.
Clerk: Failed to load Clerk UI
(code="failed_to_load_clerk_ui")
https://clerk.t3.codes/npm/@clerk/ui@1/dist/ui.browser.js
Failed to load resource: net::ERR_NAME_NOT_RESOLVED
Failed to load resource: net::ERR_NETWORK_CHANGED
Connection failed: Your cloud sign-in changed. Sign in again to authorize the environment.
The stack pointed to ElectronManagedAuthShell-CMN_Cdip.js:95 and dist-Z7xPpGBj.js:19. Source for the installed nightly is commit 5a96895. T3ConnectSidebarSignIn.tsx returns no account or sign-in control while Clerk isLoaded is false, and apps/web/src/cloud/managedAuth.tsx does not activate cloud authentication while it is false. These source observations support the failure path; they do not establish which network change initiated it.
The nightly resolves @clerk/electron 0.0.44. Its published React adapter loads Clerk UI from the CDN and caches the loading promise. See https://unpkg.com/@clerk/electron@0.0.44/dist/esm/react/index.js. The reload result shows the existing saved login remained usable in this case. It does not prove that an app update caused the failure.
Related issue #11004 concerns the misleading sign-in message while cloud identity is pending. This report focuses on recovery and visible feedback after the desktop Clerk UI download fails, with that message recorded as a downstream symptom.
Restoration check
Using a valid existing desktop login, cause the Clerk UI dependency to fail during initialization and then restore its availability. The app should show a visible actionable initialization failure or recovery control and recover the account controls and remote T3 Connect connection without clearing credentials, re-pairing, or restarting the local server. Verify both the avatar and a functioning remote connection, since displaying the avatar alone would not restore the full observed workflow. Keep the exact original transition marked unknown until a controlled reproduction establishes it.
Affected area
apps/desktop, with the account UI implemented in apps/web.
Runtime or environment
macOS, Apple Silicon, desktop app 0.0.46-nightly.20261004.2648. Both comparison machines ran the same app.asar bytes.
Impact
Major degradation: remote T3 Connect work was unavailable on the affected client until the renderer was reloaded. Local work and the other desktop client remained available.
Version or commit
0.0.46-nightly.20261004.2648
Workaround
View > Reload restored the account avatar and remote T3 Connect connection without another login or restarting the local server.
Activity
juliusmarminge commentedon Oct 4, 2026
Note
Grok responding on behalf of Julius.
Triage
Thanks for the careful write-up, and for separating this from the misleading status text, @coygeek. I didn't rerun the original network change. The stuck state after
failed_to_load_clerk_uiis still there onmainat4ee6bfd50e. Nightly5a96895is an ancestor of that commit, and these files haven't changed since.What I found
This is separate from #11004. That issue covers the "cloud sign-in changed" message while a session is pending, and it recovers by itself. Here Clerk never finishes loading.
useAuthreportsisLoaded: falseandisSignedIn: undefined.ConfiguredT3ConnectSidebarAvatarandConfiguredT3ConnectSidebarSignInboth return null in that state, so the footer shows no controls, no error, and no retry. The app doesn't use Clerk'sClerkFailedstate.ManagedRelayAuthProviderexits early while!isLoaded, soactivateManagedRelayAuthenticationnever runs. The saved remote environment has no cloud identity,assertSessiontreats that assessionChanged(), and the row shows "Your cloud sign-in changed." The T3 Connect and activity switches stay disabled.@clerk/react6.16.1 startsgetEntryChunks()once. If that rejects, it sets status to"error"and never callsclerk.load().@clerk/electron0.0.44 caches the UI-loading promise for the publishable key, including a rejected one, so later renders get the same failure.Likely fix area
"error".ClerkProviderin the same document isn't enough on its own. OnceisLoadedrecovers, the existing activation path should pick up the saved login.A maintainer will decide on the fix direction.
josephv123 commentedon Oct 10, 2026
Hit this today on desktop 0.0.46-nightly.20261010.2935, on macOS 27.0.1 (Apple Silicon). It happened right after a macOS update reboot, on a phone hotspot while the network was still coming up.
Connection failed: Your cloud sign-in changed. Sign in again to authorize the environment.clerk.t3.codes,relay.t3.codes/healthand the host's tunnel/.well-known/t3/environmentall returned 200. The host's server logs showed no connection attempt from this client since the reboot.null(see [Bug]: T3 Connect reports "Your cloud sign-in changed" when the host is just overloaded #11004). The row's ⋯ menu has no retry action, so the only way out the UI hints at, signing in, wasn't available.I didn't capture the renderer console, so I can't say whether it was the UI-script failure or the FAPI failure. Reading the dependencies, neither recovers:
@clerk/clerk-js6.32.1, the Electron load path (#tg) fetches/v1/environmentand/v1/clientwith 4 tries whennavigator.onLineis true. On failure it rethrows, because no__internal_getCachedResourcesfallback is wired.load()then sets status to"error". Nothing listens foronlineor focus to try again.@clerk/react6.16.1,getEntryChunks()runs once from the constructor. Its catch only emitsstatus: "error", soloadedstaysfalse.useAuth()returnsisLoaded: falsefor both"loading"and"error".@clerk/electron0.0.44,loadClerkUIcaches the UI-script promise at module level, including a rejected one. So remountingClerkProvideralone would not recover the UI-script case.useClerk().status, so"error"is shown the same as "still loading".Suggested direction: watch
useClerk().status === "error". Ononline, focus, or a periodic retry, remount the provider under a new key, and reset the cached UI promise. Show a visible "Couldn't reach T3 Connect · Retry" state in the account footer instead of rendering nothing.rwflan commentedon Oct 16, 2026
Additional affected environment: Linux desktop 0.1.0
Reporting a Linux instance of the missing account/sign-in controls symptom. This is a potential match to this issue, not confirmation of the same Clerk download failure. The original triggering transition and renderer console error have not been captured.
Environment
.deb, packaget3code 0.1.0.v0.1.0, commit81493efb71e8e8244f95d3e9f71d8369654ab151./opt/T3 Code (Beta)/resources/app.asarSHA256:54e2346258da31c28761984a0cca48bba5de4918e506ce65e340c2a28d000c16.7.3.0-9-generic, Intel i7-8550U, 16GB RAM.4.20.4-1, X11 through xrdp0.10.6.1-2ubuntu1.gnome-keyring 51.1-1andlibsecret-1-0 0.21.7-2build1installed. A separate Chrome launch reported a locked default keyring, so keyring availability/unlock in this desktop process is not established. This is not an assertion that Secret Service is functioning or that [Bug]: Desktop T3 Connect sign-in fails on Linux without a keyring — Clerk tokens can't persist, prepare_first_factor 401s #7689 is ruled out./tmp/dbus-*session bus; systemd user services use/run/user/1000/bus. A physical Xfce login also exists for this user.localEnvironmentEnabled: false); an independentt3code.serviceowns the local environment. Desktop process executable is the packaged Electron app, not a browser tab or source/dev build.Observed workflow
This was observed before and after successfully authorizing the separate host CLI; CLI credentials should not be presumed to sign in the desktop client. We are not reporting that the desktop must automatically inherit CLI credentials. The defect is the missing client account/sign-in entry point.
Expected
An unsigned-in Linux desktop client, including remote-only mode, should expose T3 Connect account sign-in. If authentication initialization cannot finish, show an actionable error/retry instead of hiding the entry point. The upstream remote-access docs explicitly support T3 Connect and remote-only desktops; the account component has no Linux exclusion.
Checks and boundaries
app.asar: Clerk publishable-key, JWT-template and HTTPS relay configuration are present. No private credentials or bundled telemetry values are included here.apps/web/src/components/clerk/T3ConnectSidebarSignIn.tsxreturns null whileuseAuth().isLoadedis false.apps/web/src/cloud/publicConfig.tsadditionally gates on public config. This supports a possible initialization failure path, but the running renderer's isLoaded value has not been measured.desktop.trace.ndjsonincludes a successfuldesktop.clerk.configurespan. That alone does not establish completed renderer authentication/UI initialization.https://clerk.t3.codes/npm/@clerk/ui@1/dist/ui.browser.jsreturned HTTP 200. This does not establish the renderer can fetch it.t3 connect login --headlesscompleted, thent3 connect link --headlessinstalled the managed relay client. After restarting the independent background service,t3 connect status --base-dir ~/.t3reported Exposure enabled, stored authorization, environment provisioned and relay provisioned. Service logs recorded multiple registered tunnel connections. This restores host exposure, not the missing desktop sign-in UI.Impact: desktop users cannot discover/initiate their account login from the UI; CLI host exposure is a partial workaround. Browser/provider logins and all application data were left intact. Root cause and whether this is specific to xrdp, private D-Bus, locked keyring, or another startup condition remain unconfirmed. Please split into a separate issue if the Linux failure is distinct.
juliusmarminge commentedon Oct 22, 2026
Fresh triage on main at b5a226e49c: inspected the account footer and Electron Clerk provider. Both account controls still return nothing while Clerk is unloaded. This is source inspection, not a runtime reproduction. Checked 947 open issues; the discovery failure in #17106 and saved-environment deletion in #17917 describe different symptoms.
The restoration check requires an authenticated desktop client and a saved T3 Connect environment; that session is unavailable here. No network-disruption or reload recovery test was run. Recovery involves authentication initialization, which this triage workflow reserves for maintainer review. Leaving this issue open for Julius; no fix PR. This is classified as an ordinary bug, with no exploitable vulnerability reported.
coygeek commentedon Oct 22, 2026
Rechecked v0.1.1 and main at 96bae54. I would keep this open. Both account controls still disappear while Clerk is unloaded, and there is no initialization-error/retry state in the footer. A focused probe of the pinned Clerk Electron loaders (0.1.1 and 0.1.3) also confirms that a failed UI load remains cached after connectivity is restored. #11013 fixes the downstream missing-session diagnosis/retry behavior, but does not recover Clerk or restore the account controls. This was source inspection plus a pure loader probe, not a new desktop network-disruption reproduction; recovery of both the saved login and remote connection still needs a controlled desktop check.
THEtheChad commentedon Nov 1, 2026
A hosted-web case of the same stuck state. It differs from desktop in four ways: it is in the browser, the clerk-js script failed rather than the UI bundle, it followed a sleep/wake, and it landed on a thread route. Seen on app.t3.codes 0.1.6 in Chrome 154 on macOS, with server 0.1.2 on Linux. This is from a report, not reproduced independently.
Observed
navigateentry, not a reload, anddocument.wasDiscardedwas false. What triggered the navigation is unknown.Clerk: Failed to load Clerk JS (code="failed_to_load_clerk_js"), thrown fromgetClerkJsEntryChunk.scriptLoadTimeout. It isn't confirmed, because the resource-timing buffer was already full before the script request.window.Clerkwas still undefined 12+ minutes later./ws. A manualfetchof the environment's/.well-known/t3/environmentfrom the same tab returned 200 in about 150 ms.online,focusandvisibilitychangein the tab didn't help. A plain reload fixed it immediately.How it maps to the code (source reading on
mainat 7195b69)apps/web/src/cloud/managedAuth.tsxnever sees a user, so the relay session stays unset.getDpopTokeninpackages/client-runtime/src/authorization/service.tsthen fails with the transientsession-pendingerror added in fix(connect): stop reporting a loading cloud session as a sign-in change #11013, and the supervisor keeps retrying.session-pendinghas nohop, solocate()inpackages/client-runtime/src/connection/diagnosis.tsfalls through to theserverhop. The headline then blames the host: "T3 Code on ‹host› did not answer".getEntryChunks()fails, nothing restarts it. That includesonlineandvisibilitychange. Theonlinelistener inapps/web/src/connection/platform.tsonly feeds the connection supervisor.So this is the same defect reaching the browser through clerk-js, with a misleading banner on top.
Investigated with Claude Opus 5.5 in T3 Code; reviewed by GPT-6 Astra via Codex.