Keep add-on update entity in progress across post-install refresh#168756
Merged
Conversation
Supervisor emits the `addon_manager_update` job `done=True` WebSocket event a few milliseconds before `/store/addons/<slug>/update` returns. Clearing `_attr_in_progress` on that event while the coordinator data still holds the pre-update version caused the UI to briefly flip back to "Update available" before `async_install` could refresh the coordinator. Mirror the pattern already used by the Supervisor update entity: snapshot the pre-install version, set `_update_ongoing`, and clear it only once the coordinator confirms a new `installed_version`. `in_progress` OR-combines the ongoing flag with the job-driven `_attr_in_progress`, so the installing state survives both the WS done event and the base `UpdateEntity` reset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Hey there @home-assistant/supervisor, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Hass.io add-on update entity so the UI “installing” state remains active until the add-ons coordinator refresh confirms the installed version changed, preventing a brief regression to “Update available” when the Supervisor job WS event marks done=True slightly before the HTTP update call returns.
Changes:
- Add
_update_ongoing+_version_before_updatetracking toSupervisorAddonUpdateEntityand combine it into thein_progressproperty. - Clear the ongoing flag only when coordinator data shows the installed version differs from the pre-install snapshot.
- Add tests covering “done=True mid-install” and “installed version changed but latest changed too” scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
homeassistant/components/hassio/update.py |
Keeps add-on update in_progress true across WS job completion and until coordinator refresh reflects the new installed version. |
tests/components/hassio/test_update.py |
Adds regression tests to ensure in_progress persists until refresh and clears on any installed-version change. |
If a WS progress event has already bumped _attr_update_percentage before update_addon raises, the entity would otherwise keep showing a stale percentage after _attr_in_progress has been reset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
joostlek
approved these changes
Apr 24, 2026
MartinHjelmare
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
Supervisor emits the
addon_manager_updatejobdone=TrueWebSocket event a few milliseconds before/store/addons/<slug>/updatereturns. Clearing_attr_in_progresson that event while the coordinator data still holds the pre-update version caused the UI to briefly flip back to "Update available" beforeasync_installcould refresh the coordinator.Mirror the pattern already used by the Supervisor update entity: snapshot the pre-install version, set
_update_ongoing, and clear it only once the coordinator confirms a newinstalled_version.in_progressOR-combines the ongoing flag with the job-driven_attr_in_progress, so the installing state survives both the WS done event and the baseUpdateEntityreset.This PR is similar to my previous improvement to the Supervisor update entity in #168712, however the window between installation and coordinator data refresh is much narrower.
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: