Skip to content

feat(connect): deregister account environments from any client - #4844

Merged
juliusmarminge merged 8 commits into
pingdotgg:mainfrom
StiensWout:feat/deregister-t3-connect-hosts
Aug 12, 2026
Merged

feat(connect): deregister account environments from any client#4844
juliusmarminge merged 8 commits into
pingdotgg:mainfrom
StiensWout:feat/deregister-t3-connect-hosts

Conversation

@StiensWout

@StiensWout StiensWout commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

A destroyed or reinstalled T3 Connect host can remain registered to its account indefinitely, consuming a host space with no reachable server to unlink itself.

This moves account lifecycle management into an account-level T3 Connect page. Web and desktop expose it as a custom Clerk profile page beside Mobile clients, while mobile exposes the same environment list from its Account settings. Both clients can deregister any account environment directly through the Clerk-authenticated relay endpoint without contacting the host. Device-local connect and disconnect controls remain in Connections or Environments.

Validation:

  • vp run --filter @t3tools/client-runtime typecheck
  • vp run --filter @t3tools/web typecheck
  • vp run --filter @t3tools/mobile typecheck
  • targeted lint and formatting for changed files
  • mobile native static checks
  • focused coverage for Clerk-session deregistration and stale-account rejection

Closes #5070
Closes #5135

Implemented with GPT-5.6 Codex in the T3 Code Codex harness.

Web and desktop

Authentic desktop capture of T3 Connect inside the full Clerk account panel. Environment names are redacted.

T3 Connect inside the full Clerk account panel

Mobile layout

Approved native account-route layout. A simulator capture was unavailable on this Linux host.

T3 Connect mobile account route layout


Note

Medium Risk
Deregistration revokes tunnels and account binding via relay; session/account checks limit misuse, but mistakes are destructive and worth careful review.

Overview
Adds account-level deregistration for T3 Connect environments so unreachable or wiped hosts can be removed without contacting the server.

Runtime & web: deregisterManagedRelayEnvironment in client-runtime calls the relay unlinkEnvironment API with the current Clerk session and rejects stale account IDs. Web wires this through a serial deregisterManagedRelayEnvironmentCommand and a new Clerk profile tab T3 Connect that lists registered environments, inline confirm-to-deregister UI, optimistic list filtering, toasts (with trace ID on failure), and refresh.

UI polish: Shared ClerkUserProfilePage / row / refresh primitives; Mobile clients profile page restyled to match. AlertDialogPopup gains optional portalContainer for correct layering in Clerk modals.

Docs: remote-access.md documents the deregistration flow and that device connect/disconnect stays in Settings.

Reviewed by Cursor Bugbot for commit c3b2844. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add T3 Connect environment deregistration UI to user profile

  • Adds a new T3ConnectUserProfilePage component that lists linked environments per account and allows deregistering them via an inline confirmation flow, with success/error toasts and stale-entry filtering after removal.
  • Adds deregisterManagedRelayEnvironment in packages/client-runtime/src/relay/managedRelayState.ts, an Effect that validates the current session matches the given accountId, fetches a Clerk token, and calls unlinkEnvironment on the ManagedRelay client.
  • Exposes deregisterManagedRelayEnvironmentCommand in apps/web/src/cloud/managedRelayState.ts as a serialized-per-account runtime command to prevent concurrent deregistration mutations.
  • Registers the new page as a T3 Connect entry in the Clerk user menu alongside the existing Mobile Clients page.
  • Extracts shared layout primitives (ClerkUserProfilePage, ClerkUserProfileRefreshButton, ClerkUserProfileRow) and refactors MobileClientsUserProfilePage to use them.

Macroscope summarized c3b2844.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ee20843-a7f5-4622-8c81-661bd2ec64c8

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Jul 29, 2026
@StiensWout StiensWout changed the title feat(connect): deregister unreachable hosts feat(connect): deregister T3 connect registrered hosts Jul 29, 2026
@github-actions github-actions Bot added the size:L 100-499 changed lines (additions + deletions). label Jul 29, 2026
@StiensWout
StiensWout marked this pull request as ready for review July 29, 2026 14:34
Comment thread apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx Outdated
Comment thread apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx Outdated
Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new feature enabling users to deregister T3 Connect environments from the web UI, including new profile pages, account-level mutations, and workflow changes. New user-facing capabilities of this scope warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@StiensWout
StiensWout marked this pull request as draft July 29, 2026 14:47
@StiensWout
StiensWout marked this pull request as ready for review July 29, 2026 14:48
Comment thread apps/web/src/components/settings/ConnectionsSettings.tsx Outdated
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jul 30, 2026
Comment thread apps/mobile/src/features/connection/CloudEnvironmentRows.tsx Outdated
@StiensWout StiensWout reopened this Aug 12, 2026
@StiensWout
StiensWout force-pushed the feat/deregister-t3-connect-hosts branch from 8ff435b to e66ad13 Compare August 12, 2026 19:06
@StiensWout StiensWout changed the title feat(connect): deregister T3 connect registrered hosts feat(connect): deregister account environments from any client Aug 12, 2026
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. and removed vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Aug 12, 2026
Comment thread apps/mobile/src/features/settings/SettingsT3ConnectRouteScreen.tsx Outdated
Comment thread apps/mobile/src/features/settings/SettingsT3ConnectRouteScreen.tsx Outdated
Comment thread apps/web/src/components/clerk/T3ConnectUserProfilePage.tsx
@StiensWout
StiensWout force-pushed the feat/deregister-t3-connect-hosts branch from d107d08 to 2521427 Compare August 12, 2026 19:35
Comment thread apps/mobile/src/features/settings/SettingsT3ConnectRouteScreen.tsx Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6c1a14b. Configure here.

Comment thread apps/mobile/src/features/settings/SettingsT3ConnectRouteScreen.tsx Outdated
@StiensWout
StiensWout force-pushed the feat/deregister-t3-connect-hosts branch from 6c1a14b to 85a4d07 Compare August 12, 2026 19:58
StiensWout and others added 4 commits August 12, 2026 22:07
- Add shared Clerk profile layout, rows, and refresh controls
- Use inline T3 Connect deregistration confirmation
- Add coverage for confirmation and pending states

Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Keep account environment management on the web and desktop surfaces for now.

Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge merged commit d0b8d63 into pingdotgg:main Aug 12, 2026
18 of 19 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 12, 2026
## What's Changed
* fix(web): align update toast release notes link by @t3-code[bot] in pingdotgg/t3code#6322
* fix(web): render tooltips above dropdowns by @extoci in pingdotgg/t3code#6241
* fix(web): open modified PR clicks in browser by @t3-code[bot] in pingdotgg/t3code#6278
* Fix mobile command popover glass rendering by @juliusmarminge in pingdotgg/t3code#6370
* test(mobile): seed snoozed showcase threads by @PixPMusic in pingdotgg/t3code#5155
* fix(web): preserve appearance mode when changing themes by @extoci in pingdotgg/t3code#6343
* feat(connect): deregister account environments from any client by @StiensWout in pingdotgg/t3code#4844
* feat(web): pull request surfaces — filters & qualifiers, all-server listing, update branch, reactions, in-place editing, smarter diffs by @Bil0000 in pingdotgg/t3code#6039


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260812.1077...v0.0.34-nightly.20260812.1079

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260812.1079
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to remove a relay environment whose server no longer exists [Bug]: T3 Connect stale environment cannot be removed after uninstall

2 participants