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
40f934b to
5e4d99a
Compare
Correct spelling error Add initial form of global alert workflow
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. |
What does this change intend to accomplish?
Surface backend errors to users better
Also mitigate some minor issues that required surfacing
Checklist
./scripts/test