Skip to content

Connect settings page shows stale status after tunnel reconnect (no refetch on realtime reconnect) #4272

Closed

Description

@brsbl

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 by Machine tunnel connected about 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 when useRealtimeConnectionState() 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: useRealtime could 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

  1. added theissue type on Sep 24, 2026
  2. added
    remote
    connect
    confirmed-repro
    on Sep 24, 2026
  3. bb-slop-cop commented on Sep 24, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classification: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproconnectremote

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions