Repository navigation
Refresh Connect status when realtime connectivity recovers - #4273
Merged
Merged
Conversation
A reconnect refetch can race the mount fetch; a late failure or older status must not replace the newer result. Co-Authored-By: Claude Opus 5.5 <[email protected]>
SawyerHood
force-pushed
the
slopcop/issue-4272
branch
from
October 5, 2026 18:20
f92b345 to
45d073c
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.
🚨 SLOP COP 🚨 ·
new-issue-autopilotHuman comments
What was wrong
Connect settings fetched remote-access status once on mount, then relied only on realtime pushes.
useRealtimedoesn't replay signals that arrive while the browser's realtime socket is down. When the app is opened through Connect, that socket runs over the same tunnel that just dropped, so the status change that follows a reconnect can be missed. The page then keeps showing a stale status, or a stale initial load error, until it's reloaded. Reproduction and root-cause report.What changed
plugins/connect/app.tsx: the shareduseConnectStatushook (used by Connect settings and Mobile pairing) watchesuseRealtimeConnectionState()and refetchesstatuswhenever the state changes back toconnected. The mount fetch stays as is: there is no extra request when the page mounts already connected, and none when connectivity is lost.plugins/connect/app.test.tsx: regression tests for repeated reconnects, recovery from an initial load error, and a superseded load that settles late.main.mainhad moved the status logic intouseConnectStatus; the fix now lives there and covers both consumers. No wire, CLI, or SDK changes.How you verified
main'splugins/connect/app.tsxand pass with this change. The superseded-load test also failed on the original PR code without the request guard ("Failed to load…" replaced "Connected").pnpm exec turbo run test typecheck lint --filter=bb-plugin-connect: 138 tests passed; typecheck and lint are clean./settings/plugins/connect: I closed the app's realtime socket (/ws), leaving Vite HMR alone so the page didn't reload, and let the app reconnect on its own. With this change, the reconnect issued 1 new ConnectstatusRPC. Withmain'sapp.tsx, it issued 0. In both runs, the new socket reconnected without a page navigation. This simulates a dropped realtime socket; it doesn't interrupt a live Connect tunnel.Fixes #4272