Repository navigation
fix: keep idle WebSocket connections open through proxies - #1217
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A drained burst can leave a connection in queued mode indefinitely, suppressing keepalive pings and allowing proxy idle timeouts to recur.
1 open issue
What changed in this PR
This PR addresses #1213 by adding WebSocket keepalives and improving dashboard recovery from dropped connections.
Changes:
- Send periodic server pings and terminate unresponsive clients, while deferring to backpressure handling during queued sends.
- Attempt one automatic dashboard reconnect and register event listeners only once.
- Reject client connection attempts when the server closes before sending server information, with regression coverage.
| File | Description |
|---|---|
| packages/ws-controller/test/WsBackpressureLatencyReproTest.ts | Adapt the socket fake to the keepalive interface. |
| packages/ws-controller/test/WebSocketConnectionTest.ts | Test ping intervals, responses, termination, backpressure, and disposal. |
| packages/ws-controller/src/server/WebSocketConnection.ts | Add keepalive timers and unanswered-ping tracking. |
| packages/ws-client/test/WsClientTest.ts | Test connection rejection on early server closure. |
| packages/ws-client/src/connection.ts | Reject pending connection setup when the socket closes. |
| packages/dashboard/src/pages/matter-dashboard-app.ts | Add automatic reconnect and avoid duplicate listeners. |
| CHANGELOG.md | Document keepalive and connection-recovery changes. |
Review effort: Balanced
…e mode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.

Addresses #1213.
Nothing sent traffic on an idle WebSocket connection. Browsers never send WebSocket pings themselves, and the server did not send any either. A relay that closes idle connections, such as Home Assistant Cloud remote access, therefore dropped the dashboard every 1–2.5 minutes. The Home Assistant frontend stays connected over the same path because its server pings every 55 s. Supervisor and Core ingress pass ping/pong frames through.
connect()now fails when the server closes the connection before it is ready. Before, the call never returned, which could leave the dashboard on "Connecting…".Not done from the issue: showing the result of a running commissioning after a reconnect. Once the connection stays up, that case is rare.
Remote-path behaviour is not yet confirmed; the reporter will recheck after a release.
🤖 Generated with Claude Code