Repository navigation
Pair with IP: the host shows its computer name next to its address - #60
Merged
Merged
Conversation
TheAnimatrix
force-pushed
the
direct-name-dial
branch
from
November 30, 2026 19:15
8eaafe5 to
75904f8
Compare
TheAnimatrix
force-pushed
the
direct-host-name
branch
from
November 30, 2026 19:17
02021bf to
308ebdc
Compare
…s; a failed hostname lookup leaves the name out; the CLI shows no name localhost, localhost.localdomain and names under either mean the joiner's own computer (RFC 6761 6.3), so invite.create leaves them out. The pinned gethostname panics when the Windows call fails; that now just leaves host_name out. The rule has unit tests with fixed names, and the reply test checks the exact value.
TheAnimatrix
force-pushed
the
direct-host-name
branch
from
November 30, 2026 22:16
308ebdc to
8221b98
Compare
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.
Part of the Pair with IP rollout (mousse-agent/mousse#2079), last of three engine steps toward joining by computer name. Follows #58, which dials a typed name. The host now reports its computer name next to the IP address and port it shows, so the person can read out a name instead of an address.
What changed
invite.create {kind: "direct"}(app/pairing/direct.rs) returns an optionalhost_name.address.join.directreads: it doesn't fit the route grammar's DNS labels, or it is a numeric spelling that Pair with IP: typed addresses and pending records carry a name #52 refuses.localhost,localhost.localdomain, or a name under either (RFC 6761 §6.3).gethostnamepanics when the Windows call fails; the lookup is caught, so the invitation still reaches the app.direct::typable_host_name()holds the rule, anddirect::host_name()reads the OS name withgethostname(already used for the computer name). Names are validated with coreDirectAddress::parse, the same readerjoin.directuses.docs/pair-with-ip-design.md§4 listshost_name?in theinvite.createreply and describes it in "Helper protocol as built".Tests
the_host_name_is_given_only_when_it_names_this_computer_to_a_joiner, with fixed names:Office-PCgivesoffice-pc;studio.example.lan,localhostboxandmylocalhostare given;localhost,LocalHost,box.localhost,localhost.localdomainanda.localhost.localdomainare not; nor are0x7f000001,127.1,desk_1, an empty name,localhost.or a 64-byte label.app_pair_ip::pairs_from_the_ops_end_to_endchecks the reply's exacthost_name(present or absent) for this computer's name. Removing the field, or giving a name a joiner can't type, fails it.direct-host-name-localhostinpair-with-ip.helper-units: alocalhostname is given.Review fixes (reviews of 308ebdc)
localhosthost name:localhost,localhost.localdomainand names under either are left out of the reply; the IP address and port stay. Unit test above; controldirect-host-name-localhost.host_nameis left out and the invitation reply still goes out.invite --directNAMEline, its field and its doc wording are removed. The app screen only needsinvite.create.Checks run (Windows x64)
Head
8221b98, on #58's head5bda28a(mainatd823b1ehas the same tree):cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -- -D warnings: clean.cargo test --workspace --no-fail-fast: 68 of 69 test binaries pass. The one failure wasmousse-relayrelay_admission::a_revoked_key_cannot_name_a_successor_before_the_next_read(a close seen without its code), in a crate this PR does not touch; it then passed 5 of 5 runs alone on this head.npm run check,npm test): pass.mousse-check, every control failing as required:phase0.core-vectors: 320 tests (wasm32: 291), 3 controls.phase0.second-implementation: pass, 1 control.pair-with-ip.sim(the pairing-direct sim drill): pass, 6 controls.pair-with-ip.helper-units: 124 tests, 6 controls, including the new one.pair-with-ip.helper: 26 tests, 20 controls. In the gate run,direct-no-startup-recoveryended before its tests ran, while the PC was under load from other work. Run again alone on this head, it failed 5 of 26 tests as required.