fix(app_state): stop overwriting UI_ERROR before it can render #16
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/connect-failure-flash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix: a failed connect was completely silent
What this is
main/app_state.c's connect-failure path setUI_ERRORand returned toIDLEin the same breath, and
enter(APP_IDLE)immediately setsUI_IDLE. The ringtask samples every 33 ms, so the error state was never observed: a failed
connect produced a brief blue ring and then nothing at all.
That is the failure chased on hardware during the fleet TLS-only work: the
device joined its network, obtained an IP, and then died at the WebSocket
upgrade because the server serves
wss://while the flashed build spokeplaintext
ws://. A plaintext upgrade into a TLS listener is closed with zerobytes, so the symptom read as "the wake word stopped working" — and the one
signal that could have said otherwise was never drawn.
Change
Surface the error after the app has settled into idle, and hold it past one ring
animation cycle, then return to idle:
UI_ERRORis a notification, not a state — the ring animates a triple flashover 12 steps and then restores
s_prev— so the hold is what makes it visible.The trailing
ui_ring_set(UI_IDLE)makes the end of the flash deterministicrather than dependent on the auto-revert. This also gives the mid-conversation
retry failure an indication it never had.
Verification
Induced three real connect failures on hardware (temporarily pointing the build
at a dead port): the log shows
connect stages: ... -> failed→state -> IDLEeach time, and the ring showed the red triple flash each time.
power_idle_set()only flips the ring's low-power flag (speaker amp off, slowerkey poll) and never cuts an LED rail, and the
UI_ERRORbranch deliberatelyignores that flag — so it renders in low-power idle.
No automated test, and that is a gap rather than a claim: the host suite
covers only the pure-logic components (
protocol,ed25519,creds), and thisis ordering/timing inside the FreeRTOS state machine. A ring-state test seam
would be a reasonable follow-up.
Notes
Independent of the per-device Wi-Fi feature; cherry-picked onto
develafterthat branch merged, so it can be reviewed on its own.