Repository navigation
Conversation
…the PC's server The pairing host socket read .type on whatever JSON.parse returned, so a null frame from the relay threw inside the message listener and the Ovis server exited. Ignore parsed values that are not plain objects, as relay/pair-room.ts does for the host's text. Fixes #2884
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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.
Fixes #2884
Stacked on #2883 (
feat/relay-pair-code): the bug lives inserver/relay/pair-code.ts, which only exists on that branch. When #2883 merges, this PR retargets tomain.Problem
In
hold(), the PC parsed each text frame the relay sends on a pairing host socket and read.typeon the result without checking that it was an object. Anullframe from the relay threw aTypeErrorinside the WebSocket message listener. Nothing inserver/catches that error, so the Ovis server exited. The relay is treated as untrusted (docs/relay.md).Fix
Values parsed from the relay that are not plain objects are now ignored, the same way
relay/pair-room.tsalready handles the host's text.Validation
server/relay/pair-code.test.ts: it sendsnull,1and[]on the host socket and expects the code to stay showing. Before the fix it fails withTypeError: null is not an object (evaluating 'message.type')atpair-code.ts:153. After the fix it passes.bun test ./server/relay/pair-code.test.tsgives 5 pass.bun run check fastpassed (run on the heavy runner).