Repository navigation
fix(pair): pairing again opens a fresh connection instead of a stopped one - #59
Merged
Merged
Conversation
…d one
A connection the host refused stops trying for a day. Pairing again with
that host reused it, so the channel step reported the old refusal at once
("the other computer does not accept this device") although the host had
just accepted this device. A pairing now starts the connection again
unless it is online, and the hub also restarts a connection whose host
key changed.
The channel step's advice no longer says the machine will connect by
itself when the connection has stopped: a refused device is told to check
the other computer and pair again, a version mismatch to update Leon.
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.
What was wrong
When a host refuses a device (it was revoked, or its pairing removed), that device's connection to the host stops trying for a day. Pairing with that host again reused the stopped connection, so the last step reported the old refusal straight away:
But the host had just accepted the device and listed it as paired. Restarting Leon on the client was the only way out.
The change
RelayHub::ensure_paired(used by the pairing flow): keeps a connection that is online and starts any other one again. Live terminals on an online connection stay open.RelayHub::ensurenow also starts the connection again when the host key changed, not only when the relay URL changed.Tests
pairing_again_after_being_revoked_opens_the_channel: pair, revoke on the host, wait until the client stops trying, then pair again. Without the fix it fails with the error above.only_a_connection_that_keeps_trying_is_said_to_connect_by_itself: the advice for each failure kind.Ran
scripts/check.shon Linux (Arch): format, CRLF, Cargo.lock, clippy, workspace tests and the key registry pass. The "tests as windows" step failed once onevery_option_of_every_section_fits_its_row_at_every_width_and_size(settings layout, unrelated to this change). It passes alone on this branch 3 times out of 3, passes onmain, and the whole step then passed on a re-run (2160 passed). The steps after it, run by hand, pass: path spellings, clippy without the POSIX tests, and generated docs.