fix: hangs, lost errors and unchecked input found in review #23

Merged
jwarykowski merged 1 commit from fix/review-findings into main 2026-10-20 09:13:12 +00:00
Owner

Fixes from a code review of the CLI and pkg/.

  • Missing cava no longer hangs keybars: source.Cava closes its frames on every return, so the error shows at once and keybars start doesn't report a false start.
  • run waits for cava's result, so a crash no longer exits 0.
  • Keymapp calls time out after 5s.
  • gen: a timeout on QMK fetches, fallbacks after a network error, and an unreadable local file is reported.
  • OpenRGB packets are capped at 16 MiB; the matrix bounds check can't overflow.
  • -fps, -smooth, -gain are range-checked; -source can't hold line breaks.
  • stop checks the pid file names keybars before signalling.
  • find -to defaults to -1, so -to 0 works.
  • pkg/bars uses rgb types instead of keymapp's (no grpc dependency in the renderer).
  • CI runs tests with -race.

Coverage 53.6% -> 69.7% (keymapp 35 -> 91%, source 41 -> 92%, main 13 -> 40%).

Fixes from a code review of the CLI and `pkg/`. - Missing cava no longer hangs keybars: `source.Cava` closes its frames on every return, so the error shows at once and `keybars start` doesn't report a false start. - `run` waits for cava's result, so a crash no longer exits 0. - Keymapp calls time out after 5s. - `gen`: a timeout on QMK fetches, fallbacks after a network error, and an unreadable local file is reported. - OpenRGB packets are capped at 16 MiB; the matrix bounds check can't overflow. - `-fps`, `-smooth`, `-gain` are range-checked; `-source` can't hold line breaks. - `stop` checks the pid file names keybars before signalling. - `find -to` defaults to -1, so `-to 0` works. - `pkg/bars` uses `rgb` types instead of `keymapp`'s (no grpc dependency in the renderer). - CI runs tests with `-race`. Coverage 53.6% -> 69.7% (keymapp 35 -> 91%, source 41 -> 92%, main 13 -> 40%).
fix: hangs, lost errors and unchecked input found in review
All checks were successful
CI / test (pull_request) Successful in 1m59s
32ddf2e325
- source.Cava closes frames however it returns: a missing cava hung
  keybars with the error unread, and keybars start reported success
- run waits for cava's result, so a crash no longer exits 0
- Keymapp calls time out after 5s
- gen: a timeout on QMK fetches, fallbacks after a network error, and an
  unreadable local file is reported, not looked up online
- OpenRGB packets are capped at 16 MiB and the matrix bounds check can't
  overflow
- -fps, -smooth and -gain are range-checked; -source can't hold line breaks
- stop checks the pid file names keybars before signalling it
- find -to defaults to -1, so -to 0 works
- pkg/bars uses rgb types, not keymapp's, dropping its grpc dependency
- CI runs the tests with -race

Tests: fake cava, a fake Keymapp gRPC server, a hostile OpenRGB server,
fuzz tests for both parsers, paint, latest, gen, stop and status.
Coverage 53.6% -> 69.7%.
jwarykowski deleted branch fix/review-findings 2026-10-20 09:13:12 +00:00
Sign in to join this conversation.
No description provided.