feat(ios): reachability R1 — Tailscale-first pairing + honest errors + no -999 crash#202
Merged
Conversation
…+ no -999 crash Fixes the reported "Can't reach Lisa" that dumped a raw NSError (Code=-999 "cancelled", http://192.168.3.42:5757/…) on cellular. Three defects: 1. Tailscale-first pairing (Mac): src/web/pairing.ts gains isTailscaleIPv4 + detectTailscaleHost (the 100.64.0.0/10 range Tailscale assigns); `lisa pair` now offers the tailnet address as the "reachable anywhere" option (the LAN IP only works on the same Wi-Fi). +tests. 2. Honest errors (iOS): new Sources/ConnectionError.swift classifies failures into friendly, actionable messages; RosterView renders those instead of `"\(error)"`. ServerConfig.isPrivateLAN detects 192.168/10/172.16 hosts so an off-Wi-Fi LAN pairing says "reach your Mac over Tailscale, or switch to LISA Cloud" (a Tailscale 100.64/10 host is NOT flagged). 3. No -999 crash (iOS): NSURLErrorCancelled is transient (superseded request / network switch) and is now ignored, never shown. LisaClient gives short REST calls a 10s timeout (SSE opts out so the stream isn't killed on idle) so an unreachable host fails fast + clean instead of hanging or masking as -999. Plan + 正反方 debate: docs/PLAN_IOS_REACHABILITY_v1.0.md (R2–R4 sequenced: Mac-app pair-window Tailscale toggle, NWPathMonitor banner, one-tap Cloud switch). Verified: node suite 0 fail + typecheck; iOS build.sh test → 27 tests, 0 failures. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
oratis
added a commit
that referenced
this pull request
Jul 1, 2026
…ne-tap Cloud (#203) Builds on R1 (#202): - R2 (Mac app): PairController detects the Tailscale address (100.64/10) and adds a "Same Wi-Fi / Anywhere (Tailscale)" segmented toggle to the Pair window that regenerates the QR + details for the chosen host — GUI parity with `lisa pair`. - R3 (iOS): AppState watches NWPathMonitor (`onCellular`); RootView shows a ReachabilityBanner when paired to a private-LAN host while on cellular ("You've left your Mac's Wi-Fi"). - R4 (iOS): AppState.switchToCloud() flips to the LISA Cloud data plane + lands on Settings; wired to a one-tap "Use LISA Cloud" in the banner and the roster cannot-reach error (ConnectionProblem.offersCloud). Verified: iOS build.sh test → 27 tests, 0 failures; Mac `swift build` clean. Plan/status: docs/PLAN_IOS_REACHABILITY_v1.0.md (R1–R4 all landed). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes the reported "Can't reach Lisa" that dumped a raw
NSError(Code=-999 "cancelled",http://192.168.3.42:5757/…) full-screen on cellular. Three stacked defects, plan + 正反方 debate in docs/PLAN_IOS_REACHABILITY_v1.0.md.Fixes (R1)
pairing.tsgainsisTailscaleIPv4+detectTailscaleHost(100.64.0.0/10);lisa pairnow offers the tailnet address as the "reachable anywhere" option (a LAN IP only works on the same Wi-Fi). +tests.ConnectionError.swiftclassifies failures into friendly, actionable messages;RosterViewrenders those instead of"\(error)".ServerConfig.isPrivateLAN(192.168/10/172.16) → an off-Wi-Fi LAN pairing says "reach your Mac over Tailscale, or switch to LISA Cloud." (a Tailscale100.64/10host is not flagged).NSURLErrorCancelledis transient (superseded request / network switch), now ignored, never shown.LisaClientgives REST calls a 10s timeout (SSE opts out so the stream isn't killed on idle) → an unreachable host fails fast + clean instead of masking as -999.Not forced, only offered
The Mac can't know the phone is on Tailscale, so the LAN QR stays the default and Tailscale is surfaced in copy — not auto-switched (see debate §裁决). No relay; no
NWPathMonitoryet (R3).Verified
node suite 0 fail + typecheck; iOS
build.sh test→ 27 tests, 0 failures (incl. newisPrivateLAN+classify).🤖 Generated with Claude Code