Repository navigation
Server takes the listen resolver's address list as final (#15) - #18
Merged
Merged
Conversation
The server's interface path re-applied a loopback fallback the shared resolver already owns: an `addresses.length === 0 ? [loopback]` branch and a `?? loopback` on the URL host. Both were unreachable, because `resolveListenAddresses` always seeds loopback -- but the return type said the list could be empty, so every caller kept a guard. Type the resolver's addresses as a non-empty list, loopback first, and drop both guards on the server. The resolver builds the set of addresses beyond loopback directly, so its loopback-only verdict reads off that set instead of counting entries.
3 tasks
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.
Ticket: #15 (parent spec #1, ADR 0003). Closes #15.
The server takes the shared listen resolver's address list as final. The resolver's
addressesis now typed as a non-empty list (loopback always prepended; the loopback-only verdict reads off the set of addresses beyond loopback), and the server's localaddresses.length === 0 ? [loopback] : addressesfallback and the?? loopbackon the URL host are deleted — both now unrepresentable, not merely unreachable. The loopback-only policy lives in one place.One deviation from the ticket wording: the server does not add a literal read of the resolver's loopback-only verdict. That verdict answers "did the selection reach beyond loopback"; the server's reachability check answers "is any bound address non-loopback", and the two differ for a plain loopback selection (which must still report not remote-reachable, pinned by an existing test). Reading the verdict there would reintroduce a wrong branch. The fallback derivation is gone, which is the ticket's intent.
Verification: typecheck clean on server, tailscale and desktop. Seam 1 harness 9/9, listen address + listen interfaces 25/25, desktop exposure 24/24, runtime state / startup access / auth utils / bin 48/48 — all unchanged. Full server suite 4030 passed; the 12 failures are the known local-environment ones (symlink realpath, local npm/mise layout), none touching listen code.