fix(daemon): drain UI channel in headless mode to prevent panic#1063
fix(daemon): drain UI channel in headless mode to prevent panic#1063DevenDucommun wants to merge 1 commit into
Conversation
|
Fixing panics when notification/UI channels close during shutdown. When the receiver drops (e.g. during graceful shutdown), the daemon panics with an .expect() backtrace instead of handling it cleanly. This replaces those with warn!() logging so it exits gracefully. This contribution was developed with AI assistance. I have reviewed, understood, and tested the change. |
|
i think the fix is to not return in the pinephone UI code. this fix would just spam warnings when running on pinephone. |
On PinePhone (headless display), the UI update receiver was dropped immediately, causing sends from diag.rs to fail with SendError and panic. Spawn a task that drains the channel until shutdown. Fixes EFForg#657 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cf788bd to
479d0df
Compare
|
You're right, updated the fix. The headless display was dropping the receiver immediately, so now it spawns a task to drain the channel until shutdown. Single file change, no more warn!() spam. |
|
I assume you didn't test it but this feels simple enough to merge as-is. one note though: please don't let AI write comments for you |
The headless display (PinePhone) was dropping the UI update receiver immediately without consuming it. This caused sends from diag.rs to fail with SendError and panic. Fix: spawn a drain task in headless mode that consumes messages until shutdown, consistent with all other display implementations.
Affected location:
Fixes #657
Pull Request Checklist
cargo fmt.You must check one of: