Repository navigation
fix(stream/engine): end a pairing the host refuses by code alone - #87
Draft
enricobuehler wants to merge 1 commit into
Draft
enricobuehler wants to merge 1 commit into
enricobuehler wants to merge 1 commit into
Conversation
A host refuses a pairing with its close code and no sentence, and leaves the wording to the client. The engine ended a pairing only on a sentence, so a PIN the host would not take left the sheet on "Pairing…" for good. The pairing gate's codes read as the page's own sentences wherever the host sends none: in a pairing, a request for access, a dial.
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.
A PIN the host refuses left the pairing sheet on "Pairing…" for good, with no sentence. Found while checking 0.6.1 against a 0.47.0 host; 0.6.0 does the same.
Cause
The host refuses a pairing with its close code and an empty sentence, and leaves the wording to the client.
onClosedended a pairing only when a sentence came with the close, so a code alone changed nothing and the state stayedpairing.The case that showed it: a browser that reaches the host through the page server typed a PIN armed for any device. The host wants a PIN bound to that browser and closes with 0x60. Its log says so; the page said nothing.
Change
PAIR_REFUSED: the pairing gate's close codes (0x60 to 0x67) with the sentences the monorepo already has for them (reject_not_armed,reject_bound_other,reject_rate_limited, …).onClosedreads the host's sentence, else the code's. A pairing then ends aspair-refusedwith that sentence. A request for access and a dial get the same sentence where the host sent none: a denied request no longer falls back to the wrong-PIN line, and a dial no longer says "the host closed the session (code 96)".Words; the page installs them.Checks
npm run check,npm test(142 + 19). The new test pairs, refuses with 0x60 and no sentence, and expectspair-refusedwith thereject_not_armedtext.Not in this PR
The sentence for 0x60 says pairing isn't started on the host. For a browser behind the page server the real cause is that the PIN is not bound to this device. Telling the two apart needs the host to say which, or a code of its own.