Skip to content

refactor(server): parse a viewer's commands once, and refuse malformed ones - #111

Closed
bjornpagen wants to merge 1 commit into
tembo:mainfrom
bjornpagen:pr/commands
Closed

bjornpagen wants to merge 1 commit into
tembo:mainfrom
bjornpagen:pr/commands

Conversation

@bjornpagen

Copy link
Copy Markdown
Contributor

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.

🤖 Generated with Claude Code

…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>
@bjornpagen bjornpagen closed this Nov 20, 2026
@bjornpagen
bjornpagen deleted the pr/commands branch November 20, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant