Repository navigation
refactor(server): parse a viewer's commands once, and refuse malformed ones - #111
Closed
bjornpagen wants to merge 1 commit into
Closed
bjornpagen wants to merge 1 commit into
bjornpagen wants to merge 1 commit into
Conversation
…d ones Commands were split and parsed arm by arm, each in its own way, so a line could be well formed and still wrong where it arrived: - `sp,0,NaN` reached the input thread, whose scroll remainder then stayed NaN and every later pixel scroll moved nothing, for every viewer, until voxl restarted. - `m,65636,100` put the pointer at (100,100): X takes 16 bits. - `s,0,20,1` turned the wheel while `sp,0,600,1` did nothing: some arms ignored extra fields, others refused them. Now a line is split once into a `Command`, each field parsed into the type its input thread takes as it is, with exactly the fields the command has; anything else is no command. The `s` wheel command goes: the page has scrolled with `sp` since pixel scrolling landed, and only bench/macos/input.js still sent it. Testing: a property test drawing 200,000 lines against a model of each number's range; CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Commands were split and parsed arm by arm, each in its own way, so a
line could be well formed and still wrong where it arrived:
sp,0,NaNreached the input thread, whose scroll remainder thenstayed NaN and every later pixel scroll moved nothing, for every
viewer, until voxl restarted.
m,65636,100put the pointer at (100,100): X takes 16 bits.s,0,20,1turned the wheel whilesp,0,600,1did nothing: some armsignored extra fields, others refused them.
Now a line is split once into a
Command, each field parsed into thetype its input thread takes as it is, with exactly the fields the
command has; anything else is no command. The
swheel command goes:the page has scrolled with
spsince pixel scrolling landed, and onlybench/macos/input.js still sent it.
Testing: a property test drawing 200,000 lines against a model of each
number's range; CI.
🤖 Generated with Claude Code