Skip to content

iOS cold start waits about 4 s on tailnet routes the phone can't reach before connecting over LAN #44273

Backlog

Description

@jravolio

What happened

Threads take a long time to load on my iPhone, long enough that I often give up and use the computer instead. It's worst after the app was closed: the list comes up, but statuses and messages lag, while the Live Activity on the lock screen is already up to date. (Context: thread with @jullerino on X.)

Happy to provide more context or help with a PR for this, just let me know!

Diagnosis

I measured a cold start (force-quit, tap icon) with the phone's network log (idevicesyslog, process T3Code) lined up against the host's server.trace.ndjson. The phone's nw_connection ready and the server's GET /ws agree to within 30 ms.

Both of my environments (this Mac and a Windows PC) advertise a LAN and a tailnet direct endpoint (kind: "lan" / "tailnet" in apps/server/src/environment/DirectEndpoints.ts). The phone was on the same Wi-Fi with Tailscale off, so the two tailnet routes can never answer.

On cold start, the LAN routes answer their descriptor check about 85 ms after probing starts (+3.53 s after the tap). The client doesn't start sign-in (POST /api/t3-connect/mint-credential) until +7.42 s. In between, the two silent routes time out at 1.5 s, are retried, and are cancelled again after 2.5 s (+7.47 s); sign-in starts in the same window. The server's own work on the whole path is about 0.5 s.

An A/B with Tailscale on on the phone (same Wi-Fi, force-quit first) reaches subscribeShell at +3.34 s instead of +8.79 s. The second run also skipped mint-credential/oauth/token because the credential was cached, which is worth about 0.5 s. The remaining ~4.5–5 s is the tailnet routes.

On main (c103563), connectOverRoutes in packages/client-runtime/src/connection/driver.ts gives direct routes a 500 ms head start (ROUTE_CHECK_HEAD_START_MS) before treating them as silent, and ROUTE_CHECK_TIMEOUT_MS is 2,500. So the wait I measured is either in 2.4.0's build of this path or outside connectOverRoutes (for example, the relay credential path that runs before the LAN socket). I couldn't pin it down from the outside: the app's JS logs don't reach syslog in release builds, and iOS hashes hosts in the network log.

While it waits, the list shows cached statuses (filed separately).

Steps to reproduce

  1. Link two environments that are both on Tailscale and on the same LAN as the phone.
  2. Turn Tailscale off on the iPhone and stay on that Wi-Fi.
  3. Force-quit T3 Code and open it. Time tap → live list, or compare against the host's server.trace.ndjson.
  4. Turn Tailscale on and repeat. Cold start is about 5 s faster.

Version

Mobile 2.4.0 (iOS). Host server 0.1.13-nightly.20261126.5305 at first measurement and 0.1.14-nightly.20261127.5332 for the device-log runs (desktop app, local server).

Environment

iPhone 14, iOS 26.6.1, Wi-Fi, phone Tailscale off. Host macOS 27 (arm64) desktop app. Second environment: Windows PC desktop app, up and answering on LAN and tailnet in ~15 ms.

Evidence

# Cold start, tap = 14:28:14.640Z. Device lines from idevicesyslog (T3Code), server lines from server.trace.ndjson.
+3.44 device  [C7..C10] preparing   4x IPv4#…:3773 route checks, plus [C11] Hostname#…:443
+3.53 device  [C7] [C9] ready       LAN routes answer
+3.56 server  GET /.well-known/t3/environment   1ms
+4.95 device  [C8] [C10] cancelled  silent routes, 1.5 s; retried as [C12] [C13]
+7.42 server  POST /api/t3-connect/mint-credential   20ms
+7.47 device  [C12] [C13] cancelled silent routes, 2.5 s
+7.73 server  POST /api/t3-connect/health   13ms
+7.87 server  POST /oauth/token   10ms
+7.91 server  POST /api/auth/websocket-ticket/:use   9ms
+7.95 server  GET /ws   (connectionMethod=relay label; device [C21] is a direct IPv4:3773 connection)
+7.97 server  GET /api/orchestration/shell   446ms (readShellSnapshotRows 332ms)
+8.79 server  ws.orchestrationV2.subscribeShell   25ms

# Same cold start, phone Tailscale on, tap = 14:42:50.408Z (server only; USB syslog dropped when the VPN came up)
+1.29 server  GET /.well-known/t3/environment
+3.10 server  POST /api/auth/websocket-ticket/:use
+3.34 server  ws.orchestrationV2.subscribeShell

Related issues

#34963 (open PR: a better route connects before the live session is replaced) changes mid-session route switching, not the first connect. #13687 (open PR) is about retrying relay credentials on a slow server. #31829 is about reconnecting after background on a headless server through T3 Connect. None of these covers cold start waiting on silent tailnet routes.

Fix applied or workaround

Keep Tailscale on on the phone. That cut cold start from about 8.8 s to 3.3 s. Nothing was changed on the host.

Filed by

Claude Code (Opus 5.5), following the T3 Code triage playbook (not launched through t3 triage)

Activity

  1. added
    via-triage
    on Nov 27, 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