Commit 40661ca
Ravi Singh
fix: WebSocket /api/live silently dropped + atoms.tsx missing useRef/useEffect imports
Two compounding bugs from the previous comprehensive rewrite that
together produced "distance shows 0 + console useRef error":
1. Server-side route table overflow.
esp_http_server cfg.max_uri_handlers was 32. The previous PRs added
/api/mesh GET/POST, /api/topology GET/POST, /api/factory_reset,
/api/ping, /api/system GET/POST, /api/radar/diag — bringing total
route count to 33. The WS route is registered last, so it silently
failed registration. No client could subscribe to live data, so the
Live screen distance stayed at 0 forever. Bumped to 48.
Verified post-flash: WS handshake returns 101 Switching Protocols
from python ws client; chunked HTML still serves intact at 81 KB.
2. Client-side missing imports.
atoms.tsx uses useRef (in DualHandleRange) and useEffect (in
DualHandleRange + LineChart) but only imported useState from
preact/hooks. Errors only fired on LEDs/Motion tabs where those
components render. Added the missing imports.
Build: same 1.16 MB, both C3s flashed, all 11 endpoints verified live.1 parent 5d6419a commit 40661ca
4 files changed
Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
1080 | | - | |
| 1080 | + | |
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
0 commit comments