Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Android app doesn't handle network changes gracefully, particularly bad network connectivity #12573

ClosedMarkGStacey(GitHub profile, opens in a new tab) opened this issue 3 comments

Before submitting

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

Area

apps/web

Steps to reproduce

Start the app on cellular, move into an area and connect to WiFi, and move to a place where the cellular signal is lost. Connections need to be manually reconnected

Expected behavior

App should detect network change and re establish web sockets

Actual behavior

Phone doesn't detect network change

Impact

Major degradation or frequent failure

Version or commit

No response

Environment

No response

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

No response

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

  2. Triage

    This is a real mobile reconnect gap on current main. The form listed apps/web, but the title and repro are the Android app. No existing issue looks like a duplicate.

    What happens

    The connection stack treats the network as a boolean: unknown / offline / online. Mobile maps expo-network down to that using only isConnected, and ignores interface type (wifi vs cellular):

    https://github.com/pingdotgg/t3code/blob/dfbb11bdd7c3f1a5575cb55d3e3abb12be025727/apps/mobile/src/connection/platform.ts#L37-L45

    A connected session is only torn down on a network event when the status becomes offline:

    https://github.com/pingdotgg/t3code/blob/dfbb11bdd7c3f1a5575cb55d3e3abb12be025727/packages/client-runtime/src/connection/supervisor.ts#L404-L408

    Same-status updates are dropped, so CELLULAR → WIFI (or “Wi‑Fi up, then cell drops”) never becomes a reconnect signal if isConnected stays true:

    https://github.com/pingdotgg/t3code/blob/dfbb11bdd7c3f1a5575cb55d3e3abb12be025727/packages/client-runtime/src/connection/supervisor.ts#L749-L759

    The live WebSocket is not probed on a path change. A liveness probe / forced replace happens on app resume, not while the app stays in the foreground:

    https://github.com/pingdotgg/t3code/blob/dfbb11bdd7c3f1a5575cb55d3e3abb12be025727/apps/mobile/src/connection/app-state-wakeups.ts#L10-L18

    Session death is only observed from socket/subscription close. There is no client ping timeout that would notice a half-open socket still bound to the old interface:

    https://github.com/pingdotgg/t3code/blob/dfbb11bdd7c3f1a5575cb55d3e3abb12be025727/packages/client-runtime/src/rpc/session.ts#L388-L391

    That matches the report: start on cell, join Wi‑Fi, lose cell, stay “online,” and the environment has to be reconnected by hand. Android dual-stack / default-route handoff is the usual trigger; iOS can hit the same shared path.

    • #5154 (fix(mobile): probe network changes and refresh activity leases) targeted this exact miss — emit network-path-changed when the interface changes while still online, then probe. Closed unmerged; that wakeup does not exist on main.
    • #5179 is adjacent (keep Android connections alive in the background), not a substitute for foreground interface handoff.

    Workaround

    Background the app and come back (a resume of 10s+ forces application-active-reconnect), or reconnect the environment from the UI.

    Helpful extras (not blocking)

    App version, Android version, and whether this is LAN / Tailscale / T3 Connect. Also whether the app stayed in the foreground the whole time.

  3. juliusmarminge added labelsaccepted

  4. juliusmarminge added labelsvia-triage

  5. juliusmarminge removed labelsneeds-triage

  6. Happens on both Android 16 and 17, Pixel 9, running via Tailscale

    App version now upgraded to 1.40

  7. Note

    🤖 Claude Opus 5.5 responding on behalf of Theo

    Thanks for the report. This is fixed on main in #15467. Please test on the nightly built from main on 2026-10-21, or on the next stable release. If the problem still occurs there, please open a new issue that links to this one, with your version and steps to reproduce it.

Sign in to join this conversation.