Skip to content

connectOverRoutes lets a silent route's network error override an answered route's ConnectionBlockedError #43666

Done

Description

@ynp-repos

What happened

On the iOS mobile app (2.3.0, build 248) connecting to a Linux host running T3 Code with Tailscale Serve (--lan --tailscale-serve) and T3 Connect disabled, the app failed to connect and looped indefinitely retrying with a misleading network error:

  • Headline: T3 Code connection to <host>: T3 Code on <host> did not answer
  • Cause: network, Route: Direct, Attempts: 5
  • Error: Failed to fetch remote environment endpoint https://<host>.<tailnet>.ts.net/.well-known/t3/environment (HttpClientError: Transport error ...)

Opening https://<host>.<tailnet>.ts.net/.well-known/t3/environment from Safari on the same iPhone succeeded with 200 OK, and the server's trace showed the iOS app itself was reaching the host and getting 401 (SessionTokenRevokedError) on POST /api/auth/websocket-ticket/rpc rather than failing to reach the server.

Diagnosis

Two routes were saved on the iOS app for the host: a direct Tailscale HTTPS route whose older bearer session had been revoked (401 SessionTokenRevokedError -> ConnectionBlockedError), and a T3 Connect / learned LAN route whose relay was disabled on the host (ConnectionBlockedError).

In packages/client-runtime/src/connection/driver.ts (connectOverRoutes, lines 108–157 at commit 620cf4770d99, unchanged on main as of b99dab9495):

  1. When an answered route fails with ConnectionBlockedError, blocked ??= result.failure is recorded while transient remains undefined.
  2. In the fallback loop (for (const { route } of [...answeredLate, ...stillSilent])), the early exit at line 143 only triggers when transient !== undefined. Because transient is still undefined, connectOverRoutes proceeds to attempt any stillSilent route (e.g. an unreachable LAN route while off-LAN, or Tailscale HTTPS during a brief VPN hiccup while LAN answered).
  3. Attempting that stillSilent route fails with a ConnectionTransientError (Transport error / timeout), setting transient.
  4. Line 149 returns transient ?? blocked ?? ..., so the stillSilent route's transient network error overrides the answered route's ConnectionBlockedError.

Because EnvironmentSupervisor receives a ConnectionTransientError instead of ConnectionBlockedError (packages/client-runtime/src/connection/supervisor.ts, lines 1263–1328), the client never enters phase: "blocked" to tell the user the session was revoked (or T3 Connect is disabled), and instead retries forever on backoff reporting Cause: network / T3 Code on <host> did not answer.

Steps to reproduce

  1. Connect the iOS app (2.3.0) to a host via T3 Connect (so it learns the host's LAN route) and via a directly paired Tailscale HTTPS route (https://<host>.<tailnet>.ts.net).
  2. Revoke the direct pairing session on the host and disable T3 Connect on the host.
  3. Put the iPhone in a state where one saved route answers (returning 401 SessionTokenRevokedError or T3 Connect disabled -> ConnectionBlockedError) and another saved route is unreachable (stillSilent, e.g. LAN unreachable off-Wi-Fi, or Tailscale briefly down while on LAN).
  4. Open the iOS app and inspect the connection diagnostics.
  5. Expected: The app reports the ConnectionBlockedError from the answered route (e.g., "T3 Code on <host> did not accept this device — Pair it again") instead of retrying indefinitely with a network error.
  6. Actual: connectOverRoutes still attempts the stillSilent route, hits a ConnectionTransientError, and returns transient ?? blocked, hiding the revoked-session / disabled-T3-Connect error behind Cause: network and looping on retry backoff.

Version

iOS app 2.3.0 (build 248); host server 0.1.12-nightly.20261122.5098 (triage CLI version: 0.1.12-nightly.20261122.5098). Verified still present on main (b99dab9495).

Environment

Client: iOS (T3Code/248, app 2.3.0). Host: Linux x64 (kernel 4.4.302+, Synology DSM), Node v26.13.1, Tailscale 1.104.7 (tailscale serve proxying HTTPS 443 to http://127.0.0.1:3773, --lan --tailscale-serve --no-browser).

Evidence

# Client diagnostics copied from iOS app:
T3 Code connection to <host>: T3 Code on <host> did not answer
This device: ok
T3 Code on <host>: FAILED
Cause: network
Attempts: 5
Route: Direct
App version: 2.3.0
Host version: 0.1.12-nightly.20261122.5098
Error: Failed to fetch remote environment endpoint https://<host>.<tailnet>.ts.net/.well-known/t3/environment (HttpClientError: Transport error (GET https://<host>.<tailnet>.ts.net/.well-known/t3/environment)).

# Server trace (server.trace.ndjson) during the same window showing repeated 200 on descriptor +
# 401 SessionTokenRevokedError on websocket-ticket, yet the client kept retrying on backoff:
2026-11-26T17:02:49.322Z GET /.well-known/t3/environment (https://<host>.<tailnet>.ts.net, UA T3Code/248) -> 200
2026-11-26T17:02:50.157Z SessionStore.verify Failure: SessionTokenRevokedError: Session token revoked.
2026-11-26T17:02:50.157Z POST /api/auth/websocket-ticket/rpc -> 401
... (repeated at 17:03:04, 17:03:20, 17:03:38, 17:04:00, 17:07:25, 17:07:39, 17:07:56)
# Brief window where LAN answered 200 twice per attempt (checkRoute + verifyDirectEndpoint) before
# T3 Connect bootstrap failed, while Tailscale was silent -> surfaced Tailscale Transport error:
2026-11-26T17:08:11.621Z-17:08:55.442Z GET http://<lan-ip>:3773/.well-known/t3/environment (UA T3Code/248) -> 200 (18 requests, 2 per attempt)
# Tailscale resumed answering immediately after, continuing to hit 401 SessionTokenRevokedError on retries:
2026-11-26T17:08:56.396Z GET /.well-known/t3/environment -> 200
2026-11-26T17:08:56.422Z POST /api/auth/websocket-ticket/rpc -> 401 (SessionTokenRevokedError)
... (repeated at 17:10:40, 17:10:53, 17:10:57, 17:11:02, 17:11:31)

Related issues

Fix applied or workaround

Updated host to 0.1.13-nightly.20261125.5258, removed the old environment/routes on iOS, and re-paired both direct routes with t3 pair --tailscale and t3 pair. Both routes connected immediately.

Filed by

Antigravity (Gemini 4 Neon High) via t3 triage

Activity

  1. added
    via-triage
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions