[zwavejs] Fix connection recovery#20402
Conversation
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes the Z-Wave JS binding’s WebSocket recovery logic so reconnect attempts continue beyond the first retry, aligning behavior with the expectation in #20250 (recover after prolonged backend downtime).
Changes:
- Reworked
ZWaveJSClientreconnect scheduling to keep retrying until a successfulonWebSocketConnectoccurs (and only then cancel the reconnect job). - Improved connection lifecycle handling with explicit shutdown behavior and more structured cleanup of session/keepalive/reconnect futures.
- Switched from
javax.naming.CommunicationExceptionto the binding’s ownapi.exception.CommunicationExceptionand adjusted call sites accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.../handler/ZwaveJSBridgeHandler.java |
Updates exception handling/imports to use the binding-specific CommunicationException. |
.../api/ZWaveJSClient.java |
Fixes reconnect behavior, refactors lifecycle management (shutdown/reconnect/keepalive), and adjusts logging and binary-frame handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…binding/zwavejs/internal/api/ZWaveJSClient.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: lsiepel <leosiepel@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes: #20250
Not all path's lead to the reconnection logic, that is now corrected. Tested and confirmed.
Candidate for backporting to 5.1.x