Skip to content

fix: add heartbeat ping sweep and fix connection leak in WebSocket service#839

Merged
Mosas2000 merged 1 commit into
StellaBridge:mainfrom
supreme2580:fix/websocket-heartbeat-timeout-disconnect
Jul 20, 2026
Merged

fix: add heartbeat ping sweep and fix connection leak in WebSocket service#839
Mosas2000 merged 1 commit into
StellaBridge:mainfrom
supreme2580:fix/websocket-heartbeat-timeout-disconnect

Conversation

@supreme2580

Copy link
Copy Markdown
Contributor
  • Add pendingPing tracking to ClientState for protocol-level pong detection
  • Rewrite heartbeat to send pings every 30s and terminate clients that miss pong
  • Fix removeClient() to do soft removal instead of hard delete, preserving client state for heartbeat cleanup and resume functionality
  • Add ping/terminate to SocketConnection interface
  • Register socket pong/close handlers for liveness tracking
  • Add shutdown() method for clean interval teardown
  • Add 9 new tests covering heartbeat timeout, pong handling, close handling
  • Fix existing test assertions for empty topic subscriber cleanup

Closes: #832

…rvice

- Add pendingPing tracking to ClientState for protocol-level pong detection
- Rewrite heartbeat to send pings every 30s and terminate clients that miss pong
- Fix removeClient() to do soft removal instead of hard delete, preserving
  client state for heartbeat cleanup and resume functionality
- Add ping/terminate to SocketConnection interface
- Register socket pong/close handlers for liveness tracking
- Add shutdown() method for clean interval teardown
- Add 9 new tests covering heartbeat timeout, pong handling, close handling
- Fix existing test assertions for empty topic subscriber cleanup

Resolves StellaBridge#832
@Mosas2000
Mosas2000 merged commit a57ccf8 into StellaBridge:main Jul 20, 2026
18 checks passed
Alaka-ibr pushed a commit to Alaka-ibr/Bridge-Watch that referenced this pull request Jul 21, 2026
…artbeat-timeout-disconnect

fix: add heartbeat ping sweep and fix connection leak in WebSocket service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Fix WebSocket Heartbeat Timeout Disconnect Handshake

2 participants