Repository navigation
Expose asynchronous HomeKit startup failures - #218
Merged
Merged
Conversation
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
yfre
requested changes
Nov 27, 2026
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
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.
HomekitRoot.start()discards the future returned by HTTP listener startup and its advertising callback. If binding fails asynchronously, the caller sees a normal return, the failure is not logged, and the root remains marked as started without a listener or mDNS advertisement.Add
startAsync()returning aCompletableFuture<Void>so integrations can observe successful HTTP startup and service registration, or handle their failure. Exceptions thrown synchronously during startup also complete this future exceptionally through the same cleanup path. Keep the existingvoid start()entry point and log its startup failures. Reject duplicate starts without interrupting a pending startup or an already-running listener.Failed startup resets the started state and stops the partially started root. This includes stopping the HTTP listener if only mDNS registration fails. This behavior also applies to the existing
start()method: previously, the HTTP listener could remain available to already-paired controllers after an advertising failure; it is now stopped. This is documented inCHANGES.mdand both entry points' API documentation.Recovery is not automatic. Integrations must create a new server and root for another attempt because the default
HomekitHttpServercannot be restarted. Automatic retries and network-change coordination remain outside this PR; openhab/openhab-addons#22495 consumes the new API and implements recovery by rebuilding failed instances.Related context: openhab/openhab-addons#13399 and openhab/openhab-addons#22221. The latter handles exceptions thrown during startup, but cannot observe a later failure hidden by HAP-Java.