Repository navigation
fix(electron-updater): AppImage install no longer deletes the running app before the new one is in place - #10386
Merged
mmaietta merged 6 commits intoOct 24, 2026
Conversation
… app before the new one is in place doInstall unlinked the running AppImage first and then ran `mv` through PATH. When `mv` failed (e.g. `spawnSync mv ENOTCONN` from a dead AppImage FUSE mount left on PATH), the old AppImage was already gone and the app could no longer be launched. Stage the new AppImage next to the destination (hard link, falling back to a copy) and rename it over the destination with fs calls only. A failure leaves the old AppImage untouched and removes the staged file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
🦋 Changeset detectedLatest commit: 38249b6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
The three failed jobs (Test Linux shard 6, Test Snap core22, e2e Auto Updater Linux debian/dpkg) all broke on registry downloads: HTTP 503 or a timeout fetching npm/pnpm through corepack. None of them touch `AppImageUpdater`, and Test Updater passed. npm has an open incident for this, Degraded Package Install and Publishing, which started at 02:33 UTC, before these jobs ran. Could a maintainer re-run the failed jobs once it's resolved? |
mmaietta
reviewed
Oct 23, 2026
…nstall that already succeeded Co-Authored-By: Claude Opus 5.5 <[email protected]>
…install cleanup Co-Authored-By: Claude Opus 5.5 <[email protected]>
mmaietta
approved these changes
Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AppImageUpdater.doInstalldeletes the running AppImage first (unlinkSync(appImageFile)) and only then runsexecFileSync("mv", ["-f", installerPath, destination]), which resolvesmvthroughPATH. Ifmvfails, the old AppImage is already gone and the user has no app to launch.Real-world report: pingdotgg/t3code#23188.
mvfailed withspawnSync mv ENOTCONNbecause the dead FUSE mount dir ($TMPDIR/.mount_*) of an earlier AppImage launch was onPATH. The next install attempt then failed withENOENTon the unlink, and the app could not be launched (exit 127).Related: #8698 reports the same failure: the old AppImage was removed, then
mvfailed to move the download.Fix
APPIMAGEchecks, missinginstallerPath) now runs before any file is touched. The unlink-first step is gone..<old name>.updatenext to the destination (linkSync, falling back tocopyFileSynconEXDEVor a filesystem without hard links), thenrenameSyncd over the destination. That swap is atomic and runs no external command. On any error the staged file is removed and the error is rethrown, so the old AppImage stays in place.mvdid). When the file name changed, the old AppImage is removed andappimage-filename-updatedis emitted, as before.Verification
Two new tests in
test/src/updater/baseUpdaterUnitTest.ts(AppImageUpdater doInstall file replacement):PATHpointed at an empty dir, and the AppImage holds the new content.On
master(without the fix), both fail:With the fix:
TEST_FILES=baseUpdaterUnitTest,linuxUpdaterUnitTest pnpm ci:test: 2 files, 67 tests passedpnpm compile && pnpm ci:validate: passedpnpm format:check: passedA changeset (
electron-updater: patch) is included.🤖 Generated with Claude Code