-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notify on corrupt SQLite database #131367
base: dev
Are you sure you want to change the base?
Conversation
… SQLite database is re-created due to a corrupt database file. Updated unit tests to check issue is created.
…nd firing an event
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
I feel like Repairs is the correct location with this (as you had in your initial commits) -- curious why you switched to a persistent_notification instead. |
Create a persistent notification and fire a 'recorder_database_corrupt' event to inform | ||
users that their recorder database has been rebuilt due to database corruption. | ||
""" | ||
persistent_notification.create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We consider persistent notifications to be user space nowadays, we should not be using that to send users system messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @frenck ,
Is there another mechanism we can use to display these sort of errors in the UI?
I can see value in there being some sort of proactive alert/notification as the database corruption is effectively handled silently, so users would not know to check the logs for the error.
Best,
Ryan
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Currently, when Home Assistant detects that the recorder SQLite database is corrupt, the database is recreated and the error is logged to the application logs. Often users may not notice this error message, as the database corruption is handled without user interaction.
This PR provides additional visibility for users by creating a persistent notification in the Home Assistant UI. As well as this we fire an event to allow for further automation.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: