Skip to content

Make the bb-app self-update check and upgrade command configurable for downstream distributions #3167

Description

@apsknight

The workflow

We ship bb as a downstream distribution: a thin launcher package pins [email protected] as an ordinary npm dependency, applies our default settings (telemetry off, connect disabled, loopback only), and is itself installed and upgraded through our own packaging. Users open Settings → Updates to see the state of their machine.

What happens today

The first row ("bb-app 0.42.1") is produced by createAppVersionService, which has two hardcoded constants and no configuration surface:

  • const NPM_LATEST_URL = "https://registry.npmjs.org/bb-app/latest";
    const NPM_LATEST_TIMEOUT_MS = 5_000;
    const NPM_LATEST_CACHE_TTL_MS = 60 * 60 * 1000;
    const UPGRADE_COMMAND = "npx bb-app@latest";
const NPM_LATEST_URL = "https://registry.npmjs.org/bb-app/latest";
const UPGRADE_COMMAND = "npx bb-app@latest";

Every hour the server fetches the public npm registry, and the response is:

$ curl -s http://127.0.0.1:38899/api/v1/system/version
{"currentVersion":"0.42.1","latestVersion":"0.42.1","source":"npm","updateAvailable":false,"isDevelopment":false,"upgradeCommand":"npx bb-app@latest"}

Two problems for a downstream distribution:

  1. The moment upstream publishes 0.43.0, the row flips to "Update available" and tells the user to run npx bb-app@latest — the one path our distribution exists to avoid. The pinned version is intentional; the user cannot act on the advice, and following it would install an unmanaged second copy.
  2. The check itself is unconditional egress to registry.npmjs.org. The only way to suppress it is config.isDevelopment (
    if (config.isDevelopment) {
    ), which is derived from NODE_ENV !== "production" — and bb-app forces NODE_ENV=production on its children. Even if it could be set, isDevelopment also changes error verbosity, unhandled-provider-event display, and dev app-port proxying, so it is not a usable lever.

What you would expect

Two server environment variables, read where ServerRuntimeConfig is built and passed into createAppVersionService:

  • BB_UPDATE_CHECK — on (default) or off. When off, skip the npm fetch and return latestVersion: null, updateAvailable: false. The Updates row then shows the current version with no action, exactly like a development build does today.
  • BB_UPGRADE_COMMAND — overrides the string returned as upgradeCommand, so a distribution can show its own instruction (e.g. brew upgrade bb) when it does keep the check on.

Both are additive and default to today's behavior. The desktop app and npx users see no change. Roughly 20 lines plus a test in app-version.test.ts covering the off path and the override.

Context and alternatives

Checks

  • I searched open and closed issues for the same request.
  • If an agent wrote this, the body ends with > AGENT GENERATED.

AGENT GENERATED

Activity

  1. added
    desktop
    cli
    on Sep 6, 2026
  2. bb-slop-cop commented on Sep 6, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classification:

    • Type: Feature
    • Priority: Medium
    • Effort: Low
    • Labels: desktop, cli

    No reproduction report or pull request was created because the verified Type is Feature, and this rule only reports or fixes Bugs.

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

    clidesktop

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions