Skip to content

macOS: installing a downloaded update fails with "The network connection was lost." when the updater cache is deleted after download, and every retry fails until relaunch #42022

Done

Description

@ViaxCo

What happened

On the nightly desktop app (macOS), a downloaded update failed to install three times with
"Could not install update — Desktop updater install operation reported an error." The trace
cause was Error: The network connection was lost. The update had downloaded fine 34 minutes earlier.

Diagnosis

Between download (09:07) and install (09:41), a cache cleaner (Mole 1.74.0, mole clean
via a daily launchd job) removed ~/Library/Caches/t3code-updater (469.1 MB), including the
pending zip. It also removed ~/Library/Caches/com.t3tools.t3code.ShipIt.

With autoInstallOnAppQuit = false, electron-updater 6.8.9's MacUpdater serves the zip to
Squirrel.Mac from its localhost proxy only at quitAndInstall. The proxy calls
writeHead(200, {Content-Length}) and then createReadStream(downloadedFile). That stream
emits ENOENT, the handler calls response.end(), and its reject goes to a promise that has
already resolved. Squirrel sees a short body and reports NSURLErrorNetworkConnectionLost (-1005).
I reproduced this with a Node server that has the same handler and a URLSession client:
-1005 The network connection was lost.

installDownloadedUpdate (apps/desktop/src/updates/DesktopUpdates.ts) does not check that the
downloaded file still exists. recoverFailedInstall keeps downloadedVersion, and the state
error + errorContext: "install" stays installable, so every retry in the same process fails
the same way. Only a relaunch, which downloads the update again, recovers.

Possible fixes: before quitAndInstall, check the cached zip (exists, size/sha512). If it is
missing, download again, or reset the state to "available" and show a clear message. Route
autoUpdater.logger into the desktop trace, so Cannot pipe … is not lost.

Steps to reproduce

  1. On macOS, run an older nightly desktop build. Download an available update, but do not install it.
  2. rm -rf ~/Library/Caches/t3code-updater
  3. Click Restart to update. After about 6 s, the error "The network connection was lost." shows, and the backends restart on the old build.
  4. Click again. It fails the same way each time.

Version

Failed on 0.1.12-nightly.20261123.5151 (desktop app, local backend), installing 0.1.12-nightly.20261124.5178.

Environment

macOS 26.7.3 (25G342), Apple Silicon. Desktop app with local backend, nightly channel, electron-updater 6.8.9.
Cache cleaner: Mole 1.74.0 (mole clean). The same effect is expected from any tool that clears ~/Library/Caches.

Evidence

desktop.trace.ndjson (local time, UTC+1):

09:07:03 update downloaded 0.1.12-nightly.20261124.5178
09:41:50 ElectronUpdater.quitAndInstall
09:41:56 handleUpdaterError cause="Error: The network connection was lost." → recoverFailedInstall
09:42:14 / 09:42:37 same again

Mole operations.log:

[2026-11-24 09:35:48] REMOVED ~/Library/Caches/com.t3tools.t3code.ShipIt (12KB)
[2026-11-24 09:35:53] REMOVED ~/Library/Caches/t3code-updater (469.1MB)

(The previous day Mole also removed it at 09:37. That install worked only because it followed its download within seconds.)

Related issues

Fix applied or workaround

Relaunch the app, download again, and install right away. Add ~/Library/Caches/t3code-updater* to the cleaner's exclusion list.

Filed by

Claude Code (Claude Opus 5.5) via T3 Code triage.

Activity

  1. added
    via-triage
    on Nov 24, 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

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions