Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Mobile shows "Syncing threads…" for seconds after returning to the app, while the host is reachable #30833

Openlevelorbit(GitHub profile, opens in a new tab) opened this issue 1 comment

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. Pair the iOS app with a host over a remote route, such as its Tailscale address.
  2. Leave the app for more than 10 seconds, long enough for iOS to suspend it and drop its socket without a close event.
  3. Return to the app.

Without a phone: run the iOS simulator with the app connected through a TCP proxy on the host's tailnet address. While the app is in the background, make the proxy drop the app's open sockets but accept new ones, then bring the app back.

Expected behavior

The app picks up a fresh connection as soon as the host answers, without showing a reconnect.

Actual behavior

"Syncing threads…" or "Reconnecting to …" shows for several seconds. A new connection only starts after the old socket has stayed silent for the 2.5 s window remote routes get (#24677). Until then nothing is opening a replacement, even though the host has already answered a fresh request.

In the simulator setup above, the new socket opened 2.4 s after the app came back, and "Syncing threads…" showed for about 2.5 s.

The same break-then-reconnect also happens when the route changes:

  • Coming home, the move from a tailnet route to the LAN tears down a working session first, so a reconnect shows although nothing failed.
  • Leaving home, the dead LAN socket waits out the 3 s probe before a new connection starts.

This is not the reconnect loop in #16549: here the connection is healthy and reconnects once. The delay is the wait before the new connection starts.

Impact

Major degradation or frequent failure

Version or commit

main @ 8b44f42b14

Environment

iPhone 18 Pro simulator, iOS 27.0, T3 Code dev client. Host on macOS on the same machine, reached through its Tailscale address. Also reported on a physical iPhone over Tailscale.

Logs or stack traces

10:06:16.380Z mode pass -> blackhole   (old socket now dead)
10:06:17.388Z mode blackhole -> pass   (new sockets allowed)
10:06:28.393Z app back in the foreground
10:06:28.728Z #5 open                  (host check, fresh request)
10:06:30.879Z #6 open                  (new connection, +2.5 s)

Screenshots, recordings, or supporting files

before.mp4

Workaround

None needed. It recovers on its own after a few seconds.

  1. levelorbit(GitHub profile, opens in a new tab) added labelsneeds-triage

  2. Same symptom over the managed relay route (iOS 2.2.0, server 0.1.8-nightly.20261106.4262, Linux arm64 host).

    From the host's trace spans, 11 mobile sessions in one day: each socket lives only while the app is in the foreground (4–77 s, one 350 s). On every return the app opens a fresh /ws, and orchestration.subscribeShell arrives 1.1–2.5 s (median 1.5 s) after the socket opens. The host answers the shell and thread subscriptions in milliseconds. In a screen recording, "Reconnecting 2 environments" → "Syncing threads…" takes ~1.6 s, and the list stays dimmed ~3 s after launch.

    Two things that may add to it:

    • One of the two linked environments was offline (last reached ~5 h earlier) and was still retried on every open.
    • server.refreshProviders and vcs.refreshStatus (~2.3 s each on the host) fire on every reconnect.

Sign in to join this conversation.