-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Log a warning when replacing existing config entry with same unique id #130567
base: dev
Are you sure you want to change the base?
Conversation
One case that we should properly tackle, is mobile_app. The app can re-register and this directly uses this mechanic, so if we start logging we will get a load of issues on the apps |
I am wondering how many people activate this functionality on nightly though |
That's the point... we don't want to have too many people impacted by this until we know more how many integrations this concerns. |
The other possibility is to log always for core and core components (not for custom components) |
fc07992
to
ba763dc
Compare
homeassistant/config_entries.py
Outdated
# This causes the old entry to be removed and replaced when it | ||
# should most likely update the previous entry and abort the flow |
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.
Can we be clearer?
The flow should always be aborted.
In case of manual flows, integrations should implement options, reauth, reconfigure to allow the user to change settings.
In case of non user visible flows, the integration should optionally update the existing entry before aborting.
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.
Updated
"exists", | ||
core_behavior=ReportBehavior.LOG, | ||
core_integration_behavior=ReportBehavior.LOG, | ||
custom_integration_behavior=ReportBehavior.LOG, |
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.
Shuold we start with just logging core integrations?
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.
I'm not sure
I would start with logging all, and we can easily adjust later if it generates too much noise
Breaking change
When a config flow creates an entry with a colliding unique ID, the old entry is currently automatically removed and replaced with the new config entry.
This can lead to unexpected behavior, and is deprecated.
Proposed change
As follow-up to #130062
cc @emontnemery
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: