[Bug]: Android app doesn't handle network changes gracefully, particularly bad network connectivity #12573
MarkGStacey(GitHub profile, opens in a new tab) added labelsbug
MarkGStacey(GitHub profile, opens in a new tab) added labelsneeds-triage
juliusmarminge added labelsaccepted
juliusmarminge added labelsvia-triage
juliusmarminge removed labelsneeds-triage
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
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 mapsexpo-networkdown to that using onlyisConnected, and ignores interface type (wifivscellular):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 ifisConnectedstaystrue: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.
Related work#
fix(mobile): probe network changes and refresh activity leases) targeted this exact miss — emitnetwork-path-changedwhen the interface changes while still online, then probe. Closed unmerged; that wakeup does not exist onmain.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.