Fix periodic WebSocket disconnection#83
Merged
Merged
Conversation
ICubE01
force-pushed
the
bugfix/periodic-websocket-disconnection
branch
from
July 18, 2026 20:15
9ad5e4c to
7731c86
Compare
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.
Summary
Backend
Bugfix
WebSocketConfig.configureMessageBrokerenable STOMP heartbeats (10s each way) on the simple broker.SimpleBrokerMessageHandlerleaves its heartbeat value unset unless aTaskScheduleris supplied, so the broker advertised0,0and an idle connection carried no traffic at all — nginx then closed it at the default 60sproxy_read_timeout.WebSocketConfig.setMessageBrokerTaskSchedulerinject the built-in scheduler through a@Lazysetter, per the reference documentation, to avoid a cycle between the built-in WebSocket configuration and this configurer. Qualified by name so heartbeats stay on the WebSocket pool if anotherTaskScheduleris ever declared.Frontend
Bugfix
useStomp.tsxadvertise a 10s heartbeat in both directions instead of disabling heartbeats, so the negotiated value is non-zero.useStomp.tsxconnectnow takes a token factory and re-issues the token frombeforeConnecton every attempt. The previous single token was captured at mount and, with its 5s TTL, was always expired by the time an automatic reconnect fired —JwtAuthenticationInterceptorrejected the CONNECT, so reconnects looped rather than recovering.Enhancement
useStomp.tsxreconnect with exponential backoff capped at 60s, and drop the stale token when issuing a new one fails. A persistent failure previously retried once a second forever, each attempt re-sending a credential that could not succeed.Chore
useStomp.tsxdrop thedebugcallback. It logged every frame and, once heartbeats are enabled, roughly 1000 lines per hour per open tab.