Skip to content

fix(settings): flag pairing links that only work on this network - #69

Merged
enisze merged 1 commit into
mainfrom
fix/pairing-local-network-hint
Aug 28, 2026
Merged

fix(settings): flag pairing links that only work on this network#69
enisze merged 1 commit into
mainfrom
fix/pairing-local-network-hint

Conversation

@enisze

@enisze enisze commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Stacked on #68 (which adds the isPrivateNetworkHostname predicate this uses). Base is that branch, so review the top commit only; retarget to main once #68 lands.

Problem

The desktop pairing row hands the other device a LAN address — http://192.168.1.21:3773/pair#token=... — with nothing saying it is a LAN address. The requirement to be on the same network is only discoverable by failing on the other device, where it arrives as a transport error with no context.

#68 makes that failure explain itself on the receiving device. This says it before you walk over to the phone.

Change

resolveLocalNetworkPairingHost (in pairingUrls.ts, alongside the existing helpers) returns the backend host when a pairing URL points somewhere local-network only, and null otherwise. The pairing row renders it under the link:

192.168.1.21:3773 is reachable only from this network — the other device has to join it too. Mobile data can't reach it, and the address changes when this computer joins another network.

It follows the backend host inside a hosted link's host parameter rather than the hosted app's own domain, so a hosted link wrapping a LAN backend is flagged too. Tailnet addresses stay unflagged — they route over the tailnet, where the advice would be wrong.

Tests

6 cases in pairingUrls.test.ts: direct LAN URLs (IP and .local), the hosted-link host parameter, routable and tailnet hosts staying quiet, and non-URL input. src/components/settings suite green (9 files, 55 tests); lint, format, and typecheck clean.

🤖 Generated with Claude Code

The pairing row hands over a LAN address without saying it is one, so the
requirement to be on the same network is only discoverable by failing on the
other device — where it arrives as a transport error.

Name the host and the constraint next to the link, following the backend host
inside hosted links rather than the hosted app's own domain. Tailnet addresses
stay unflagged, since they route over the tailnet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@enisze
enisze force-pushed the fix/pairing-local-network-hint branch from f13502e to 046166a Compare August 28, 2026 18:24
@enisze
enisze changed the base branch from fix/pairing-local-network-diagnostics to main August 28, 2026 18:24
@enisze
enisze merged commit 5237461 into main Aug 28, 2026
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