Skip to content

[zwavejs] Fix connection recovery#20402

Open
lsiepel wants to merge 4 commits intoopenhab:mainfrom
lsiepel:zwavejs-reconnectlogic
Open

[zwavejs] Fix connection recovery#20402
lsiepel wants to merge 4 commits intoopenhab:mainfrom
lsiepel:zwavejs-reconnectlogic

Conversation

@lsiepel
Copy link
Copy Markdown
Contributor

@lsiepel lsiepel commented Mar 19, 2026

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

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel lsiepel requested review from a team and Copilot March 19, 2026 11:00
@lsiepel lsiepel added the bug An unexpected problem or unintended behavior of an add-on label Mar 19, 2026

This comment was marked as outdated.

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ZWaveJSClient reconnect scheduling to keep retrying until a successful onWebSocketConnect occurs (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.CommunicationException to the binding’s own api.exception.CommunicationException and 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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An unexpected problem or unintended behavior of an add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[zwavejs] If websocket connection is dropped, reconnect is only tried once

2 participants