Repository navigation
Improve Home Assistant HTTP config restart recovery - #79
QuinnDamerell wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9037351fbd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| shouldRetry, result = self._GetHttpConfigApiResult("confirm", response, allowEmptyResult=True) | ||
| if result is not None: | ||
| self._ClearPendingHttpConfigOwnedByHomeway() | ||
| haConnection.ClearServerRestartExpected() |
There was a problem hiding this comment.
Keep fast reconnect armed until the queued restart occurs
When http/config/configure returns restart: true, the code immediately promotes the configuration, and a successful promotion reaches this call before Home Assistant's queued restart closes the socket. Clearing ServerRestartExpected here makes that imminent disconnect take the normal reconnect path in ConnectionThread—including an initial five-second backoff—instead of the newly added fast-reconnect path. Clear this state only after the post-restart connection is established or after it is known that no restart will occur.
Useful? React with 👍 / 👎.
Home Assistant's HTTP configuration restart can close the WebSocket before configure or confirmation responses arrive. These changes track the normalized configuration staged by Homeway so interrupted updates can be recovered without confirming unrelated user changes.
Validation
Using an isolated Python 3.12.7 environment with the repository requirements:
pwdimport is unavailable on Windows.Review note
The successful pre-restart promotion path clears
ServerRestartExpectedinConfigManager._PromotePendingHttpConfigbefore Home Assistant's queued restart occurs. That disconnect therefore uses normal reconnect backoff instead of the new fast path. The existing regression test currently asserts that early clearing. This timing issue remains for review.