Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This change consistently normalizes IPv6 addresses when identifying SSH hosts that refer to the local machine. Existing port and proxy safeguards remain intact, keeping the change limited to equivalent address representations. You can add or adjust custom eligibility rules. Learn more. |
…edundant IPv6 cases Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate 0182fed
Evidencescenarios:prove from current origin/main, running the real base/head web app and server in isolated worktrees and fresh scenario data; deterministic e2e browser, 1280×800, light theme, Linux, OpenSSH 9.6p1. Synthetic project seeded through t3.project; real SSH CLI and real local IPv6 interface; no mocks. On fresh state on each commit, create a synthetic project and open Settings → Devices. Temporary real OpenSSH aliases use port 22 and no proxy: lower/upper spellings of the machine's own Tailscale IPv6 interface, expanded loopback 0:0:0:0:0:0:0:1, and remote 2001:DB8::1. For lower, expanded, remote, then upper: Add source → Machine over SSH; fill name and alias; Test connection; capture the completed result (expand errors); Save host; capture Device sources and read the isolated settings.json. Restore SSH config afterward. Scenario: Uppercase local IPv6 SSH sources use the local device summaryProven: the scenario fails on base 8fc71a2eec and passes on head 0182fedb8f.
| Recordings | Before interaction | After interaction | Base attempts SSH to the uppercase self alias and retains it in Device sources and settings.json. Head uses the local summary and excludes it from both. Lowercase and expanded loopback are local on both; the remote control remains remote on both. Not shown:
|

















Problem
isLocalSshDeviceHostinapps/server/src/device/localSshDeviceHost.tsfails to recognize SSH device hosts whose resolvedssh -Ghostnameis an expanded, zero-padded, or uppercase IPv6 loopback or local interface address (for example0:0:0:0:0:0:0:1,::0001,FD7A:115C:A1E0::1, orfd7a:115c:a1e0:0:0:0:0:1). AlthoughunmapIPv4already canonicalizes IPv6 vianew URL(\http://[${address}]`).hostname, it discards the canonical value for non-::ffff:addresses and compares the raw string against"::1"andos.networkInterfaces(), so self-targeting SSH hosts are kept as remote hosts inWS_METHODS.serverUpdateSettings(apps/server/src/ws.ts) andDeviceService.reconcile(apps/server/src/device/DeviceService.ts), and probed over SSH instead of returninglocalHost.summary`.Deterministic repro on
origin/main(93f2c5190dfaf92733697f0ab375e2aa57b84c58):Run from
apps/serveragainst real/usr/bin/ssh -G(OpenSSH 9.6p1) withLocalDeviceHostAddresses = new Set(["fd7a:115c:a1e0::1"]):origin/main:[0:0:0:0:0:0:0:1],[::0001],FD7A:115C:A1E0::1, and[fd7a:115c:a1e0:0:0:0:0:1]all returnlocal:false, keptRemote:1.local:true, keptRemote:0, while the remote control2001:DB8::1remainslocal:false, keptRemote:1.Change
Renamed
unmapIPv4tonormalizeIpAddressinapps/server/src/device/localSshDeviceHost.tsand returnedcanonical.slice(1, -1)(the RFC 5952 lowercase compressed IPv6 form from the WHATWG URL parser) for non-IPv4-mapped IPv6 addresses instead of the raw string, and normalizedLocalDeviceHostAddresseswith the same helper before membership checks. Extendedapps/server/src/device/localSshDeviceHost.test.tswith expanded/padded loopback, uppercase/expanded local IPv6, and remote IPv6 control cases. Server-only change covering all callers (WS_METHODS.serverUpdateSettings,DeviceService.reconcile, andDeviceServicehost probing); no client, contract, or i18n surfaces are affected.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
93f2c5190dfaf92733697f0ab375e2aa57b84c58) -> Head (6dcc806e19f363e600bdb0917901f32fedde7d66):vp test run apps/server/src/device/localSshDeviceHost.test.ts: failed on base (1 failed | 2 passed,AssertionError: expected false to be true), passed on head (3 passed (3)).isLocalSshDeviceHostandremoteSshDeviceHostsvia real/usr/bin/ssh -G: all four non-canonical local IPv6 inputs flipped fromlocal:false, keptRemote:1on base tolocal:true, keptRemote:0on head; remote control2001:DB8::1stayedlocal:false, keptRemote:1.vp run check:changedexited0(format,lint,knip,graphql (apps/server),typecheck (3 packages), andtest (2 files, 5 passed)).localSshDeviceHost.tsaddress normalization and the isolated environment has no remote SSH device hub configured.Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown
host-0and add aserver.updateSettingsresponse assertion for scenario-ready evidence.vp run check:changedrun. Attach its output with HEAD6dcc806e19f363e600bdb0917901f32fedde7d66recorded, or note that the run was reported but not independently verified.93f2c519as the candidate base, not currentorigin/main; the remote main tip wasb429a6bc, where the reviewer independently reproduced the same bug.