Error Surfacing - #1091
Conversation
| return code_response(ctrl, ctrl.play_media(media)) | ||
|
|
||
|
|
||
| @api.patch("/api/alert/hide") |
There was a problem hiding this comment.
This pathing might need some work. It made more sense when I had multiple alert endpoints being added here but I found 2/3 of the endpoints didn't make sense as I kept devving on this
There was a problem hiding this comment.
Having only a single endpoint for this is useful since it reduces the scope on this. I wish we had a place for odds and ends like this that don't focus on the actual functionality of the unit.
There was a problem hiding this comment.
Since it is only exposed via api/info does it make sense to be there?
Maybe /api/info/hide-alerts or /api/info/alerts/hide ?
There was a problem hiding this comment.
I'm not sold on any of those options tho.
There was a problem hiding this comment.
I wish we had a place for odds and ends like this that don't focus on the actual functionality of the unit.
It would be trivial to add a api-utils.py or something similar that uses the same FastAPI instance without having it in the same file as the primary functionality if that's what you mean
Also for the routing opinions, I like /api/info/alerts/hide because I do see a world where we might want a /api/info/alerts/add endpoint, the main case being if the frontend finds an error that should become global to all users, or a world where we might want /api/info/alerts as a GET request to return just that portion of the info block (this could be fairly useful to raise these issues to home assistant's notification scheme, for example)
There was a problem hiding this comment.
The MUI alert component that we use has a "severity" property that has 4 possible values - error, success, warning, and info. I have had no particular use for warning and info thus far, so I flattened it into just success or error. Within that, I generally only needed error so I had it be a store_true arg for whether it shows success or fail, I've upgraded that with full granularity to future proof these changes.
Luckily the other two AlertBar style components we use don't have the same controls so I didn't need to upkeep those for full feature parity in this PR
260a293 to
40f934b
Compare
8015464 to
aa4c2ba
Compare
5e4d99a to
35f8495
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## VersionWarning #1091 +/- ##
=================================================
Coverage ? 50.73%
=================================================
Files ? 41
Lines ? 7478
Branches ? 0
=================================================
Hits ? 3794
Misses ? 3684
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
To record a conversation we've had in the office: |
|
After 24 hours of testing, this is looking good. I'm going to keep my automated testing script going while I'm on vacation next week and I suspect that once I'm back on the 15th this will be good to merge. |
|
It is now the 15th, and my minute-by-minute script has yet to trip the sensor on this one. We ought to be fine for standard user day-to-day operation without having a big threatening error screen. |
16ea23c to
e859500
Compare
97ba840 to
f5a5e24
Compare
2f95b08 to
8d44e90
Compare
d1eb8ea to
688d861
Compare
8d44e90 to
05d01e3
Compare
688d861 to
76370ce
Compare
… that notifies the user when the fix is unsuccessful
When the preamp microcontroller hangs it stops ACKing and every I2C write fails with OSError 121 (EREMOTEIO). The existing fallback only reopens the SMBus handle, which recovers a transient bus glitch but not a hung preamp - zone control stays dead until someone power-cycles the unit. Escalate: when the reopened-bus retry also fails, reset the preamps in place, re-assign I2C addresses, reopen the bus and re-flush all cached register values so zone state (mute/source/volume) survives, then retry the write. Rate-limited to once per 20s so a benign one-off glitch never resets audio. Observed live on our unit 2026-06-04 (zone control dead until manual reboot); with this patch the same wedge self-heals in under a second. Signed-off-by: Stamate Viorel <stamate.viorel@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
05d01e3 to
5b0b256
Compare
What does this change intend to accomplish?
Surface backend errors to users better
Also mitigate some minor issues that required surfacing
Checklist
./scripts/test