fix(clients/rust): harden client resilience for v0.1.0 release

- Track serial timeout in field instead of returning hardcoded 2s
- Always restore timeout in drain_rx, even on read errors
- Handle EINTR/Interrupted in read_frame (retry instead of error)
- Use connect_timeout for TCP mux (no more 2-min hangs)
- Set write timeout on mux sockets (unix + tcp)
- Log unexpected unsolicited frames in recv via tracing::warn
- Add unix socket timeout test for WouldBlock handling
- Add CHANGELOG.md, remove resolved CLAUDE_TODO.md
This commit is contained in:
swaits committed 2026-04-06 14:00:42 -06:00
1 parent 03e1d7fa2e
commit 9aeec80d7a
6 files changed
+158 -23

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
# Changelog
## 0.1.0 — 2026-04-06
Initial release.
### Features
- High-level `Client<T>` with send/recv and command helpers (ping, set_config,
start_rx, stop_rx, transmit, get_config, get_mac, display_on, display_off)
- COBS wire framing via `ucobs` (matches firmware implementation)
- Auto-detection connection: TCP mux, Unix socket mux, direct USB serial
- Bounded RX packet buffering (256 packets, FIFO eviction)
- `FrameReader` accumulator for streaming byte sources
- USB device discovery by VID:PID with blocking wait
### Resilience
- Cross-platform timeout handling: `TimedOut` (Windows) and `WouldBlock`
(Linux/macOS) both treated as clean timeouts in `read_frame`
- `EINTR`/`Interrupted` signals retried automatically in `read_frame`
- `drain_rx` always restores the original timeout, even on I/O errors
- TCP mux connections use `connect_timeout` (bounded by caller's timeout)
- Mux sockets set both read and write timeouts
- `SerialTransport` tracks timeout accurately for save/restore
- Unexpected unsolicited frames logged via `tracing::warn` instead of silently
discarded