fix(#711): drain serial on each callback; never drop bytes silently
Two app-side halves of the #702 fix. The native USB service read one 8 KB chunk per flserial callback, which left the rest of a burst waiting in the native ring. It now drains until the ring is empty, bounded at 32 reads (the ring's 256 KB) so a stuck read cannot spin. The frame decoder skipped bytes it could not frame (noise, an oversized length) without a word, so when bytes were lost upstream, whole frames vanished with no trace. It now counts them and keeps the first 16; the native USB, web USB and TCP services log each batch as an error with the count and a hex sample (SAFELANE 6). The web service shares the decoder, so it gets the same logging, matching the plan's "all transports" intent. Tests cover no report on clean input, noise before a frame, an oversized header, take-once, the capped sample and reset; with the count disabled, 4 fail. Epic #702. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>pull/743/head
parent
a430a47561
commit
845b0f1e55
Loading…
Reference in new issue