Repository navigation
Description
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
- On macOS, run an older nightly desktop build. Download an available update, but do not install it.
rm -rf ~/Library/Caches/t3code-updater- Click Restart to update. After about 6 s, the error "The network connection was lost." shows, and the backends restart on the old build.
- 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
- macOS desktop update started remotely via "update all" fails to install with "The network connection was lost." and retries fail until the app is relaunched #40605: same error and retry behaviour, closed as not reproducible. This could be the same root cause if that machine clears caches.
- [Bug]: macOS nightly: an already-applied update is re-installed on relaunch and the updater cache (2× nightly zip, ~365 MB) is never cleaned #32554: updater cache handling on macOS nightly.
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