Draft
Prevent post-install update entity flicker to “upgradable”#78
Conversation
Copilot
AI
changed the title
[WIP] Fix bug with update entities showing as upgradable after container upgrade
Prevent post-install update entity flicker to “upgradable”
Jul 18, 2026
gensyn
reviewed
Jul 18, 2026
| @@ -133,7 +133,9 @@ async def async_install( | |||
| try: | |||
| await self.coordinator.create() | |||
| finally: | |||
Owner
There was a problem hiding this comment.
@copilot Is an empty finally block in python valid and reasonable?
Contributor
Author
There was a problem hiding this comment.
Yes—try ... finally without an except is valid Python, and it’s commonly used for guaranteed cleanup. In this case the outer finally is not empty; it ensures we always run the post-install refresh/cleanup path even if create() raises.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
After a container upgrade is triggered from the update entity, the entity could briefly return to
on(update available) during the reload window before coordinator data settled. This change keeps the entity in an explicit install-in-progress phase until refreshed state is available.Update entity state sequencing
DockerContainerUpdateEntity.async_install,in_progressnow remainsTrueuntilcoordinator.async_request_refresh()completes.in_progress=Falseis deferred to the finalization block after refresh, avoiding an intermediate stale “upgradable” presentation.Behavioral guardrail in tests
in_progressis stillTruewhile refresh is executing, and only resets afterward.Illustrative change