Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): allow stale environments to be deregistered #9761

ClosedRowan-Paul(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/9761/headopened View on GitHub

Problem

Mobile shows stale or unhealthy T3 Connect environments, but unconnected rows only expose a connect switch. Users cannot deregister an environment when its managed endpoint is unavailable.

Fix

  • add a destructive deregistration action beside unconnected T3 Connect environments
  • confirm before revoking account access and removing the managed tunnel
  • refresh relay discovery after successful deregistration
  • report a clear error if the T3 Connect session disappears
  • update the mobile user documentation

Before

The unavailable environment only has a disabled connection switch.

Mobile Environments screen before the fix, showing an unavailable T3 Connect environment without a deregister action

After

Unavailable T3 Connect environments have a destructive deregister action beside the connection switch.

Mobile Environments screen after the fix, showing a deregister button beside an unavailable T3 Connect environment

Verification

  • vp test run packages/client-runtime/src/relay/managedRelayState.test.ts apps/mobile/src/features/connection/environmentSections.test.ts
  • vp run --filter @t3tools/mobile typecheck
  • targeted lint for the changed mobile files
  • iPhone 17 Pro simulator: verified the trash action and confirmation dialog with safe showcase fixtures

Generated by GPT-5.6-sol using the T3 Code Codex harness.


Note

Medium Risk Deregistration revokes account-level T3 Connect access and is irreversible from the UI; the discovery refresh concurrency change affects all clients using that command but is covered by a new test.

Overview Lets mobile users deregister unconnected T3 Connect environments (e.g. stale or unreachable) without relying on a working connect path.

Mobile: Adds deregisterManagedRelayEnvironmentCommand (serial per account) and wires it into the T3 Connect environment rows—a confirmation dialog, destructive trash control beside the connect switch, per-row loading/disable state, relay list refresh on success, and alerts when the session is missing or the API fails.

Client runtime: Changes relay environment discovery refresh from singleFlight to latest so a refresh kicked off after deregistration (or other mutations) always runs a new pass instead of reusing an in-flight refresh that started before the mutation; adds a test for that behavior.

Docs: Updates mobile deregistration steps to Settings → Environments and the deregister control beside the environment.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b78cf0d506b2e9bb12e79a398e6eebf57713fecf. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add deregisterManagedRelayEnvironmentCommand runtime command for mobile

  • Adds a shared atom command scheduler and exports a runtime command that deregisters a managed relay environment, accepting an account ID and environment ID
  • Deregistration requests for the same account execute serially through the managed relay atom runtime
  • Risk: concurrent deregistration calls for different accounts are no longer guaranteed to share a single queue; callers relying on global serialization should verify managedRelayMutationScheduler per-account behavior in managedRelayState.ts
Macroscope summarized c798356.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Cursor Bugbot has reviewed your changes using default 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](https://www.cursor.com/dashboard/bugbot).

      Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c987072da41133abe40359be76b9da6a47c3895a. Configure [here](https://www.cursor.com/dashboard/bugbot).
    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR adds a destructive mobile workflow that revokes T3 Connect access and removes managed tunnels, alongside a shared refresh-scheduling behavior change affecting mobile and web. The combination of authenticated side effects, new user-facing capability, and cross-client runtime impact warrants human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Note

      This comment is posted by Julius' dot

      The supplied screenshots stop at a confirmation dialog, and the stated manual check covers only the trash action and dialog. There is no reported result for completed deregistration and the fresh discovery pass that removes the row. This does not meet the verification requirement. Please add focused results for the removal and refresh path and a short recording showing an unavailable environment disappearing after confirmation, then request reconsideration.

    5. juliusmarminge closed this

Sign in to join this conversation.