Repository navigation
fix(connect): stop reporting a loading cloud session as a sign-in change - #11013
Project516 wants to merge 1 commit into
Conversation
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This focused fix changes cloud-session authorization from a blocked state to transient retry while the session is loading, while preserving blocking for identity changes during an attempt. Because production authorization code is modified, the sensitive auth-directory rule calls for additional scrutiny. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between b7b3ef1 and ceabaf43ce04b80537f31e56a86dd2296512ed68. 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughAuthorization now reports ChangesAuthorization session state
Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to Cloud-session loading now retries as a transient connection condition instead of showing a sign-in-change error, while genuine identity changes remain blocked. The change is covered by focused authorization tests and is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ceabaf4 to
f0b2a5e
Compare
f0b2a5e to
fd75b10
Compare
fd75b10 to
9f4e1c4
Compare
9389164 to
e06fab3
Compare
Before the web or mobile client finishes loading its Clerk session, the relay authorization path saw no cloud identity and failed with the blocked error "Your cloud sign-in changed", parking the supervisor and sending users to fix an auth problem that did not exist. On a slow host this window is easy to hit. A missing identity at the start of an attempt now fails with a transient session-pending error so the supervisor keeps retrying. A captured identity that goes away or changes mid-attempt still blocks as a sign-in change. Closes pingdotgg#11004
e06fab3 to
97efee6
Compare
Problem
While a client is still loading its T3 Connect cloud session, every relay authorization attempt fails with Your cloud sign-in changed. Sign in again to authorize the environment. The sign-in has not changed, and signing out and back in does nothing. The connection parks in a blocked state instead of retrying, and the status line carries the wrong reason into Failed to connect. Reconnecting.... On a slow or busy host the loading window is long enough to hit routinely.
On web and mobile the cloud identity is the
managedRelaySessionAtomvalue. It staysnulluntil Clerk loads andManagedRelayAuthProviderfinishes activating, and the connection supervisor can start attempts before then.Change
In
packages/client-runtime/src/authorization/service.ts, an attempt that starts with no cloud identity now fails with aConnectionTransientErrorwith reasonsession-pendingand the detail Waiting for the T3 Connect sign-in to load. The supervisor retries it with normal backoff instead of treating it as blocked.session-pendingis added to the transient reasons inconnection/model.ts.sessionChanged()still applies when an identity captured at the start of an attempt later disappears or is replaced, so a real sign-out or account switch is still blocked. A real sign-out does not retry forever, because both auth providers remove relay environments from the catalog when the account goes away.The 3s cached-endpoint websocket ticket timeout mentioned in the issue is a separate tuning question and is not changed here.
Scope and approval
Fixes #11004, which a maintainer triaged and accepted, confirming the bug on main and pointing at
sessionChanged()for aNoneidentity (triage).Verification
vp test run packages/client-runtime/src/authorization/layer.test.tson this branch: 24 passed. One new test covers the loading window. Authorizing with no identity yields the transientsession-pendingerror, and the same call succeeds once the session arrives. The existing logout-during-renewal tests still expect the blocked error. One existing assertion now expects the transient error because it authorizes with no identity at all. I later rebased onto main as of October 5 with no conflicts and did not rerun the tests locally, so CI covers the rebased commit.To confirm the tests exercise the bug, I ran the same test file against main's
service.tsandmodel.ts. Two tests fail, receivingConnectionBlockedError: Your cloud sign-in changed...whereConnectionTransientErrorwith reasonsession-pendingis expected:tsc --noEmitinpackages/client-runtimeis clean.Not checked: a live reproduction in a client. That needs a signed-in T3 Connect account and a relay environment on a host slow enough to widen the loading window, which I could not set up here. The only visible difference is the connection status detail text during the loading window: Waiting for the T3 Connect sign-in to load. instead of the sign-in-changed message, followed by a normal reconnect.
Claude Opus 5.5 via Claude Code in T3 Code.