Skip to content

[Bug]: Desktop update installs the build found at the last 4-hour check, so a newer nightly is offered right after relaunch #37462

Closed

Description

@CaseyBlackburn

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Related but different: #31487 (quitting from the menu discards a downloaded update, so the same version is offered again) and #32554 (an update that was already applied is reinstalled on relaunch). Here the install succeeds, but the build it installs had already been replaced by a newer one when I clicked.

Area

apps/desktop

Steps to reproduce

  1. On the nightly channel, keep the desktop app open. It checks for updates 15 s after launch and then every 4 hours (AUTO_UPDATE_POLL_INTERVAL), and shows an update offer when it finds one.
  2. A new nightly is published after the last check but before the next one. Nightlies currently come out about every 6.5 hours, so this happens often.
  3. Click the sidebar update pill to download, then restart and install.
  4. After the relaunch, the startup check offers the newer nightly, so you download and restart a second time.

Expected behavior

Starting an update installs the newest build available at that moment: one click, one restart, and you're up to date.

Actual behavior

The app downloads and installs whatever version the last background check found, and that check can be up to 4 hours old. If a newer nightly came out since then, the app restarts into an outdated build and offers another update within seconds of relaunching.

From the source (main @ 6b7027b):

  • apps/desktop/src/updates/DesktopUpdates.ts turns automatic downloads off (setAutoDownload(false)) and checks only 15 s after launch and then every AUTO_UPDATE_POLL_INTERVAL = "4 hours".
  • The pill's download action (SidebarUpdatePill.tsx: downloadLocalUpdate calls bridge.downloadUpdate()) doesn't check first. downloadAvailableUpdate calls electronUpdater.downloadUpdate directly, which downloads whatever electron-updater's last checkForUpdates result held.
  • installDownloadedUpdate doesn't check either. A build downloaded hours ago gets installed as-is, unless a 4-hour poll replaced it in the meantime.

With checks every 4 hours and nightlies about every 6.5 hours, the last check is on average about 2 hours old when you click. A click at a random moment downloads an outdated build roughly a third of the time.

The remote update flow already avoids this: in the logs below, a remote-update check runs right before its download.

Impact

Minor bug or occasional failure

Version or commit

0.1.10-nightly.20261116.4761 (also seen on 0.1.10-nightly.20261113.4656)

Environment

Windows 11 Pro, T3 Code (Nightly) desktop app, nightly channel. Seen on Windows; the code path is the same on every platform.

Logs or stack traces

# desktop.trace.ndjson, summarised. Times in UTC; publish times from GitHub releases.

# Case 1: two downloads and two restarts in 5 minutes
2026-11-15 19:59:11  checkForUpdates (poll)    update available 0.1.10-nightly.20261115.4749
2026-11-15 23:59:11  checkForUpdates (poll)    4749 still the newest; offer unchanged
2026-11-16 01:26:07  v0.1.10-nightly.20261116.4761 published
2026-11-16 02:59:41  downloadAvailableUpdate   downloading update            # no check first
2026-11-16 03:02:21  applyUpdateDownloaded     update downloaded 4749        # already outdated
2026-11-16 03:02:26  install -> before-quit -> relaunch
2026-11-16 03:03:05  checkForUpdates (startup) update available 0.1.10-nightly.20261116.4761
2026-11-16 03:04:13  downloadAvailableUpdate   downloading update
2026-11-16 03:06:57  applyUpdateDownloaded     update downloaded 4761
2026-11-16 03:07:02  install -> before-quit -> relaunch   # second restart

# Case 2
2026-11-14 03:48:27  v0.1.10-nightly.20261114.4669 published
2026-11-14 03:54:44  downloadAvailableUpdate   downloading update            # no check first
2026-11-14 03:57:52  applyUpdateDownloaded     update downloaded 0.1.10-nightly.20261113.4656
2026-11-14 03:57:57  install -> before-quit -> relaunch
2026-11-14 03:58:43  checkForUpdates (startup) update available 0.1.10-nightly.20261114.4669
2026-11-14 04:07:28  downloadAvailableUpdate   downloading update
2026-11-14 04:09:49  install -> before-quit -> relaunch

# For comparison: the remote update flow checks right before it downloads
2026-11-15 00:08:29  checkForUpdates (remote-update)
2026-11-15 00:08:31  update available 0.1.10-nightly.20261114.4709, downloading update

Workaround

Run a manual update check right before you download. Or, after the update relaunches, wait about 15 s for the startup check and update again.

Suggested fix

  • In downloadAvailableUpdate, run checkForUpdates under the same reservation (the "held" mode channel changes already use) before calling electronUpdater.downloadUpdate, and download whatever is offered after that check. If the check fails (for example, offline), fall back to downloading the known offer.
  • Do the same before installDownloadedUpdate calls quitAndInstall. If a newer build turns up, download that instead of restarting into the outdated one, or tell the user and let them choose.
  • Checking for updates more often would make this rarer, but checking when the user starts an update fixes it however often the background check runs.
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions