Repository navigation
Description
Summary
The Connect settings page (/settings/plugins/connect) can keep showing an outdated remote-access status after the Connect tunnel briefly drops and reconnects. On two different machines, the same page kept reporting the machine as not connected even though the host daemon had already reconnected. The page showed the correct state only after a reload.
What happened
- The host daemon log shows a short tunnel outage:
machine tunnel rejected: HTTP 500, followed byMachine tunnel connectedabout 4 seconds later. - After that, the daemon stayed connected to
*.getbb.app: its connections were established, and nothing else went wrong in the log. https://<handle>.getbb.app/settings/plugins/connect, already open on two machines, still showed the old state. Reloading the page showed it as connected.
Likely cause
ConnectSettingsSection in plugins/connect/app.tsx fetches the status once, when the page loads, and after that relies only on realtime pushes:
useEffect(() => {
refetch(); // rpc.call("status"), mount only
}, [refetch]);
useRealtime(CONNECT_REALTIME_CHANNEL, (payload) => { ... setStatus(next) });useRealtime (apps/app/src/lib/plugin-sdk-hooks.ts) only subscribes to wsManager.onPluginSignal. It doesn't replay missed signals or trigger a refetch after the websocket reconnects.
When the app is opened through Connect, that realtime websocket travels over the same tunnel that just dropped. So the status change that follows the reconnect (e.g. reconnecting → connected) is broadcast while no browser is subscribed. Nothing fetches the status again afterward, so the page stays out of date until it's reloaded.
Suggested fix
- Call
refetch()again whenuseRealtimeConnectionState()goes back to connected. The status RPC is cheap, and this also covers any other gap in realtime delivery. - Optionally, poll slowly (e.g. every 30–60s while the page is visible) as a backstop.
- Consider a general fix:
useRealtimecould expose a "resubscribed/reconnected" callback so other plugin pages that rely on push-only state get the same protection.
Environment
- bb CLI/daemon
0.43.5-nightly.35773768107.1, macOS (Darwin 24.2.0) - Seen on two machines viewing the same server at the same time
🤖 Generated with Claude Code
Activity
bb-slop-cop commentedon Sep 24, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Bug · Priority: Medium · Effort: Low ·
remote,connect.Reproduction report: REPRODUCED, high root-cause confidence. Applied
confirmed-repro.Connect settings fetch on mount and status signals, but never refetch when realtime connectivity recovers. Two regression tests reproduced stale status and failed-load recovery in two clean checkouts of trusted main. The missed signal was simulated; the original live tunnel outage was not recreated.
Fix: PR #4273, ready for review, not merged. Both regressions pass after the fix; all 111 Connect tests and typecheck pass. The change totals 73 text lines across two files.
Refresh Connect status when realtime connectivity recovers (get-bb#4273)