fix(mobile): don't mark Android VPN/Tailscale as offline when connected#3949
Conversation
On Android, isInternetReachable is often false on Tailscale/VPN even when the interface works, so pairing succeeded over HTTP but the supervisor never opened WebSocket. Prefer isConnected for offline detection.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved Small, straightforward bug fix that relaxes overly aggressive offline detection logic on Android VPN/Tailscale. Single-line change with clear intent and limited scope. You can customize Macroscope's approvability policy. Learn more. |
…r refresh (#7) * feat(web): copy branch name via right-click in the branch selector (pingdotgg#4275) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> * Add remote server updates and standalone service management (pingdotgg#4286) Co-authored-by: codex <codex@users.noreply.github.com> * Refine light-mode sidebar surfaces (pingdotgg#4268) Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: codex <codex@users.noreply.github.com> * fix(mobile): don't mark Android VPN/Tailscale as offline when connected (pingdotgg#3949) * improve and prevent silent thread branch drift and PR fetching (pingdotgg#2284) Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com> --------- Co-authored-by: Theo Browne <me@t3.gg> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com> Co-authored-by: Rushikesh Gaikwad <81632222+Wraient@users.noreply.github.com> Co-authored-by: legs <145564979+justsomelegs@users.noreply.github.com>
What Changed
Stop treating Android
expo-networkisInternetReachable: falseas offline when the interface is still connected.apps/mobile/src/connection/platform.ts, preferisConnectedfor online/offlineisInternetReachable === falseas offline when the interface is connectedWhy
On Android,
isInternetReachableoften staysfalseon Tailscale/VPN even when the active network works. Expo documents that this flag requires validated internet capability and, for VPN, non-zero downstream bandwidth.That made the mobile connection supervisor report offline after a successful HTTP pair, so it never requested a websocket ticket or opened
/ws. Server-side this showed as paired mobile sessions withlast connected: never.Checklist
Validation
Note
Low Risk
Single-condition change in mobile network status mapping; may report online in edge cases where there is no real internet, but restores correct behavior for VPN/Tailscale.
Overview
Fixes mobile connectivity on Android VPN/Tailscale by changing how
networkStatusinplatform.tsmapsexpo-networkstate into the sharedConnectivitylayer.Previously,
isInternetReachable === falseforced"offline"even whenisConnectedwas true. On Android that flag is often wrong on VPN/Tailscale, so the connection supervisor stayed offline after pairing and never opened the WebSocket.Now only
isConnected === falseyields offline; a connected interface with an unreliableisInternetReachablecan report"online"or"unknown"instead.Reviewed by Cursor Bugbot for commit bd40ea0. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix Android VPN/Tailscale connections being marked as offline in mobile app
The
networkStatusfunction in platform.ts previously returned"offline"whenisInternetReachablewas false, which incorrectly flagged VPN and Tailscale connections on Android as offline. The fix narrows the offline condition to only checkstate.isConnected === false, so a connected device with an unresolvableisInternetReachablereturns"online"or"unknown"instead.Macroscope summarized bd40ea0.