Skip to content

feat(ios): reachability R1 — Tailscale-first pairing + honest errors + no -999 crash#202

Merged
oratis merged 1 commit into
mainfrom
feat/ios-reachability
Jul 1, 2026
Merged

feat(ios): reachability R1 — Tailscale-first pairing + honest errors + no -999 crash#202
oratis merged 1 commit into
mainfrom
feat/ios-reachability

Conversation

@oratis

@oratis oratis commented Jul 1, 2026

Copy link
Copy Markdown
Owner

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)

  1. Tailscale-first pairing (Mac)pairing.ts gains isTailscaleIPv4 + detectTailscaleHost (100.64.0.0/10); lisa pair now offers the tailnet address as the "reachable anywhere" option (a LAN IP only works on the same Wi-Fi). +tests.
  2. Honest errors (iOS) — new ConnectionError.swift classifies failures into friendly, actionable messages; RosterView renders 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 Tailscale 100.64/10 host is not flagged).
  3. No -999 crash (iOS)NSURLErrorCancelled is transient (superseded request / network switch), now ignored, never shown. LisaClient gives 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 NWPathMonitor yet (R3).

Verified

node suite 0 fail + typecheck; iOS build.sh test27 tests, 0 failures (incl. new isPrivateLAN + classify).

🤖 Generated with Claude Code

…+ 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 oratis merged commit 01ed7a1 into main Jul 1, 2026
1 check passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant