Conversation
…2380) SpotHub (DX cluster / RBN) did not automatically reconnect after a Wi-Fi drop or any other failed connection attempt. The app would try once when the network came back, fail, and stop retrying — requiring a manual reconnect. Root cause: Qt's QAbstractSocket only emits disconnected() on a Connected → Unconnected transition. When a socket fails during ConnectingState (host blocked, refused, or timed out), Qt emits errorOccurred but NOT disconnected. The reconnect timer was only armed inside onDisconnected(), so a single failed connect attempt permanently halted the backoff chain. Two additional failure paths had the same gap: onSocketError() emitted the UI error only and never re-armed the timer, and the 10-second connect timeout lambda called abort() without scheduling a retry. Fix: extracts a scheduleReconnect() helper called from all three failure paths, with two guards — m_intentionalDisconnect (don't override user-initiated disconnect) and m_reconnectTimer->isActive() (prevents double-scheduling when errorOccurred and the connect timeout both fire for the same failed attempt). A per-call epoch counter (m_connectEpoch) captured by the timeout lambda ensures a stale timeout from attempt N cannot abort a later attempt N+1 that has since succeeded. connectToCluster() also now rejects calls when the socket is already in ConnectingState to prevent overlapping attempts during rapid retries. Backoff sequence is unchanged: 5 s → 10 s → 20 s → 40 s → 60 s (cap). Cherry-picked from PR #2388 (M7HNF-Ian). The rest of that branch contained already-merged commits (#2349 Spot Lines toggle, #2386 TCI crash fix), the rejected #2387 spectrum fix, and two unrelated spot-lines naming-refinement commits that belong in their own focused PR. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 6, 2026
This was referenced May 7, 2026
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
Cherry-picks @M7HNF-Ian's cluster auto-reconnect fix from PR #2388 onto a clean base. The rest of his branch contained already-merged commits (#2349 Spot Lines toggle and #2386 TCI crash fix), the rejected #2387 spectrum fix, and two drive-by spots-naming refinements that belong in their own focused PR.
Closes #2380.
Bug
SpotHub (DX cluster / RBN) didn't automatically reconnect after a Wi-Fi drop or any failed connection attempt. The app would try once when the network came back, fail, and stop retrying — requiring a manual reconnect.
Root cause
Qt's
QAbstractSocketonly emitsdisconnected()on a Connected → Unconnected transition. When a socket fails duringConnectingState(host blocked, refused, or timed out), Qt emitserrorOccurredbut notdisconnected. The reconnect timer was only armed insideonDisconnected(), so a single failed connect attempt permanently halted the backoff chain. Two additional failure paths had the same gap:onSocketError()emitted the UI error only and never re-armed the timer, and the 10-second connect-timeout lambda calledabort()without scheduling a retry.Fix
Extracts a
scheduleReconnect()helper called from all three failure paths, with two guards —m_intentionalDisconnect(don't override user-initiated disconnect) andm_reconnectTimer->isActive()(prevents double-scheduling whenerrorOccurredand the connect timeout both fire for the same failed attempt). A per-call epoch counter captured by the timeout lambda ensures a stale timeout from attempt N cannot abort a later attempt N+1 that has since succeeded.connectToCluster()also now rejects calls when the socket is already inConnectingStateto prevent overlapping attempts during rapid retries.Backoff sequence unchanged: 5 s → 10 s → 20 s → 40 s → 60 s (cap).
Hardware-validated
@ten9876 tested against a real cluster on FLEX-8600 fw 4.1.5: firewall-block triggers retries at the expected intervals; unblock mid-backoff connects without manual intervention; user-initiated disconnect doesn't auto-retry; backoff resets on successful reconnect.
Reported by luigiverdicchio1-prog (Lou) on Windows 10 with a FLEX-6400.
Co-authored-by: Ian M7HNF [email protected]
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]