Skip to content

Desktop: Server menu shows no Connect servers and no reason when the sync is skipped #1753

Closed

Description

@Joesirven

Summary

When the desktop app has no local runtime and no cached Connect credential, Window ▸ Server lists no Connect servers and gives no indication why. The code knows exactly which of three conditions failed, but that reason only reaches a log file. From the menu, "we could not fetch your servers" is indistinguishable from "you have no servers."

This matters most in the exact situation where the menu is the recovery path.

What I hit

My desktop app was pointed at a saved custom server target that had become unreachable (the server moved to a loopback-only bind in 0.36.0, so the old http://<host>.<tailnet>.ts.net:38886 URL stopped answering). The app opened on the startup error screen — see #1494 — whose only escape is Window ▸ Server.

That menu offered "This Mac" and "Set Server URL…" and nothing else. My account has a paired Connect server (bb connect status on the server reports it connected), but it was not listed and nothing explained its absence. I assumed the pick-list feature did not exist and was about to file a feature request for it before reading the source.

Where it goes wrong

All references on main.

apps/desktop/src/connect-server-sync.ts, fetchServers():

const serverUrl = args.getLocalServerUrl();
if (serverUrl !== null) {
  return fetchConnectAccountServers({ serverUrl, fetchImpl: args.fetchImpl });
}
const credential = args.getCredential();
if (credential === null) {
  return null;
}

The fallback path for a remote target with no local runtime is deliberate and well commented ("remote target keeps a live server list with no local runtime"). It just requires a cached credential, and returns null without one.

runSync() then logs:

connect server sync skipped (plugin disabled, not paired, or no local server and no cached credential)

That string enumerates three distinct, actionable causes. None of them reach the UI. listMenuConnectServers() in apps/desktop/src/main.ts simply maps an empty connectAccountServers, and createServerMenuItems() in apps/desktop/src/menu.ts renders the resulting empty list with no affordance.

Expected

When the Connect server list is empty because the sync was skipped rather than because the account has no servers, say so in the menu. Something as small as a disabled item would be enough:

  • No Connect servers — sign in to bb Connect (no cached credential)
  • No Connect servers — Connect not paired (plugin disabled or unpaired)

A "Sign in to bb Connect…" item that triggers the existing authentication flow would be better still, since that is the actual remedy and there is currently no way to reach it from this menu.

Why this compounds #1494

#1494 covers the startup error screen being a dead end with no controls. This issue is the other half: the menu that screen implicitly depends on can itself be empty for reasons it will not disclose. Together they mean a user whose saved target breaks has no in-app path back, and no information about why the obvious alternative is missing.

Environment

  • bb desktop on macOS (M1), server 0.38.0 on Ubuntu 22.04
  • Connect paired and reporting connected on the server side
  • Desktop app had no cached Connect credential, having never authenticated to a Connect target from that machine

Activity

  1. Joesirven commented on Aug 18, 2026

    @Joesirven
    Author

    Prototype branch, since this is a UI change and CONTRIBUTING asks for sign-off before a pull request:

    https://github.com/Joesirven/bb/tree/prototype/connect-server-list-skip-reason

    Three small changes:

    • connect-server-sync.ts tracks which condition caused a sync to yield nothing (no-credential, unauthorized, unavailable) and exposes it via getSkipReason(), cleared on a successful sync.
    • menu.ts takes an optional serversNote and renders it as a disabled item.
    • main.ts maps the reason to a label, only when the Connect list is actually empty.

    Result is one disabled line in the Server menu, e.g. No Connect servers — sign in to bb Connect, instead of nothing at all.

    Two things I did not do, since they seem like your call:

    1. Making it actionable. A clickable "Sign in to bb Connect…" item would be better than a disabled label, since signing in is the actual remedy and there is currently no way to reach it from this menu. That is a larger UI decision.
    2. Distinguishing "plugin disabled" from "not paired". The current skip reasons collapse both into unavailable, because fetchConnectAccountServers does not report which it was.

    Happy to reshape this however you prefer, or drop it if you would rather solve it alongside #1494.

  2. added theissue type on Aug 18, 2026
  3. added
    desktop
    connect
    on Aug 18, 2026
  4. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1753.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): createConnectServerSync.runSync() treats a null fetchServers() (no local runtime + no cached credential, or any RPC/gate failure) as a log-only silent no-op and never informs main.ts, so buildMenuServerItems maps an empty list and createServerMenuItems renders no empty-state row; in the reporter's flow the startup sync is not even reached because applyServerTarget() rejects on loadURL for the dead custom host (Desktop: an unreachable saved remote server target leaves the app on a dead-end startup error #1494), so the first (skipped) sync fires from menu-will-show into an already-built popup and nothing ever rebuilds the menu.
    • Linked PR review: #0 → REQUEST CHANGES (reporter's prototype branch Joesirven/bb@prototype/connect-server-list-skip-reason, no PR opened) — A skipped sync never triggers refreshApplicationMenu(), and in the reporter's exact flow the startup syncNow() (main.ts:2288) and the refresh at main.ts:1235 are never reached at all: applyServerTarget() rejects on loadURL for the unreachable custom host (verified empirically with Electron 41.7.0: E
    • Proposed fix: In apps/desktop/src/connect-server-sync.ts make the sync outcome a value: return a discriminated result from fetchServers (no-local-server-no-credential; local-plugin-disabled from RPC 503; local-not-paired from {code:'handler_error',message:'not_paired'}; local-unreachable; gate-unauthorized/gate-unreachable from ConnectListError) by parsing rpcFailureSchema instead of discarding it, and add an onSkipped(reason) callback next to onServers. In main.ts store the reason beside connectAccountServers and call refreshApplicationMenu() from onSkipped too (Electron menus are immutable after build); b…
    • Caveats: No macOS available; the Server submenu was rendered with the real, unmodified menu.ts inside Electron 41.7.0 under Xvfb on Linux with the servers array main.ts produces for the reporter's state (isMac:false; template is platform-independent apart from role items). The prototype's main.ts was not run; its trigger defect is from reading base main.ts control flow plus the empirical loadURL-rejects pr…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  5. added
    confirmed-repro
    on Aug 18, 2026
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-reproconnectdesktop

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions