Repository navigation
feat(mobile): show phone tailscale guidance after route failures - #366
Merged
Merged
Conversation
nixuuu
added a commit
that referenced
this pull request
Nov 10, 2026
Repeated failures against an unreachable paired gateway made the mobile sheet alternate between “Reconnecting…” and “Gateway unavailable”. Route probes erased their previous results, the sheet changed height, and the sidebar banner could unmount an open sheet. Independent requests could also start another failed route race as soon as the preceding race finished. Availability and retry activity now use one shared domain state machine across mobile and web/desktop. After 3 failures or 12 seconds without success, “Gateway unavailable” stays until a successful stream snapshot/resynchronization. Retry activity appears in a reserved line. Retries use 1/2/4/8/16/30-second backoff with 80–100% jitter; network/foreground/manual reconnect reset the delay without clearing unavailable. - Mobile route rows retain their last result while checking, use fixed heights and a bounded scroll area. All requests share the failed route race’s cooldown; no sent RPC is replayed. - The mobile sheet remains mounted through retries, manual reconnect and recovery. The sidebar banner overlays the list. Web/desktop has a matching status popover, manual reconnect and an overlay banner below the header. - Documented states, transitions, route cooldown and lifecycle resets in `docs/mobile.md` and `docs/ui-api.md`. No native, dependency or protocol changes. ## Validation - Passed: `bun install`, `bun run gen:check`, `bun run typecheck`, root `bun run lint`, `bun run format:check`, and the production web build. - Focused domain/transport/route tests: 32 passed, 333 assertions, 0 failed. Coverage includes sticky unavailable, hanging opens, exponential backoff/cap/jitter, lifecycle/manual resets, late callbacks, linked-computer outages, diagnostics retention and independent-request cooldown. - Browser: stopped and restarted a disposable gateway; sampled title, open state, panel/button geometry and content positions every 200 ms. No unavailable-to-reconnecting bounce, sheet closure or content movement; automatic recovery succeeded. Checked light/dark and desktop/phone widths with short and long thread names. Measured retry intervals grew exponentially to the capped range; manual reconnect restarted immediately without clearing unavailable. - Both production fingerprints generated with `[email protected]` are unchanged: iOS `6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android `5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. Limitations: native iOS/Android visual QA was unavailable. Full `check:tmp` was not run; this task’s verification scope permits focused tests. Additional Expo ESLint reports existing errors in unchanged files; changed mobile UI files have no ESLint errors (the keyed recovery memo has one dependency warning). Root oxlint and all requested checks above pass. Evidence is kept outside the repository. ## Copy audit — docs/copy.md §8 1. “No route in use” / “Checking routes…” → “Routes”; per-route replacement status → last result plus “Checking route” activity. These distinguish availability from an attempt without rewriting the heading. Added “Retrying in N s” / “Retrying…” in a reserved line; digits are localized, units spaced, sentence case retained. 2. Glossary unchanged. “Reconnect now”, “Copy details” and “Open Tailscale” name actions. The web popover explains the last known state and automatic reconnect; technical failures remain in Details. Tailscale guidance stays in the description while the availability title remains stable. 3. No new empty states, duplicated availability heading, optional-dependency warning or expressive sentence. Existing failure copy retains its automatic resolution/manual reconnect action. 4. Short, typical and long thread titles checked at desktop and phone widths in both themes; route hosts keep middle truncation and results have a fixed row. Native text sizing/layout remains unverified as noted above. 5. Availability and countdown have text labels; checking activity has an accessible label. Color is supplementary and spinners respect reduced motion. ## Regression attribution The merged diff for #361 explicitly introduced `down && stale === subscriptionKey && !routes.pending`, which returns the availability presentation to reconnecting whenever a new probe begins. This fixes that condition and the resulting presentation instability. #366’s Tailscale hint and fixed retry interval were checked as context; they did not introduce that condition. Fixes: #361 Related: #366
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When every route fails and all Tailscale probes end in DNS errors or timeouts, Canopy now points users to Tailscale on their phone. Previously, the banner blamed an unresponsive gateway even when the phone's VPN was off or stuck.
Behavior
isInternetReachablein the network event key. RPCs that may have reached the computer are never replayed.tailscale://navigate/main/devices, with instructions to open the app manually if the link fails. Add Polish phone setup and troubleshooting guidance indocs/mobile.md.Platform evidence and limits
Installed
expo-network58.0.4 was inspected on both platforms, alongside Expo SDK 58 network documentation.Android's
getConnectionTypechecks cellular and Wi-Fi beforeTRANSPORT_VPN. A working VPN can therefore still reportCELLULARorWIFI; those values cannot prove that Tailscale is off. Android reachability uses INTERNET/VALIDATED capabilities and VPN downstream bandwidth, but it is not a Tailscale traffic check. iOS mapsNWPathto interface type and connection state, without a VPN flag;isInternetReachablemirrorsisConnected. Both platforms use the cautious generic message. The fixed foreground retry pause covers VPN toggles that leave all exposed fields unchanged.Android's navigation URL is registered by Tailscale's manifest and handled by its DeepLinkNavigator. React Native 0.88.1 opens it directly with ACTION_VIEW; no
canOpenURL, manifest queries, native dependency, or native configuration change is needed. Anintent:string would not be parsed as an Android intent by React Native'sLinking.openURLimplementation. A market URL opens a store rather than the VPN controls.The iOS action is omitted: no supported navigation URL was confirmed for its client, and adding
LSApplicationQueriesSchemesis outside this OTA change. Real-phone VPN recovery and app-launch behavior were not smoke-tested. No UI/E2E tests, native builds, APKs, or OTA publication were run.Copy audit — docs/copy.md §8
§8.1–8: plain active copy, sentence case, punctuation and glossary checked; no new jargon, duplicated facts, empty states, or decorative copy. Existing Details, Copy details, and Reconnect now remain. §8.9: the new text interpolates no names or addresses; source review confirms wrapping banner/sheet text and a wrapping action row. Real-device light/dark and viewport checks remain unverified. §8.10: the message and labeled actions convey the guidance without relying on color or icons.
Native fingerprint — production profile
Generated before and after with the pinned CLI from
apps/mobile:2a0ef03a2a0fda8e7fad2e3df8609803d2edbda32a0ef03a2a0fda8e7fad2e3df8609803d2edbda3c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07dc5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07dBoth native fingerprints are unchanged. The diff contains only TypeScript/TSX, the focused classifier test, and Polish documentation.
Verification
bun install— passed; no manifest or lockfile changes.bun run gen:check,bun run typecheck,bun run lint, mobile ESLint, andbun run format:check— passed. Formatting was applied withbun run format.bun run check:tmp— passed: 1,833 passed, 161 skipped, 0 failed across 325 files; nothing left in the checked temp directory. Opt-in live tests remained disabled.bun test tests/integration/mobile-tailscale-hint.test.tsandbun run check:tmp tests/integration/mobile-tailscale-hint.test.ts— 16 passed, 0 failed; nothing left in the temp directory. Covers DNS/timeouts, all-timeout stuck tunnel, pin/refusal, no Tailscale route, successful routes, incomplete/aborted checks, pending retries, request/probe separation, and active-route recovery.bun run --filter @canopy/web build— passed. Existing mobile route integration tests also passed, including waking tunnels, shared probes, reset/cancellation, and no replay after lost headers/body.