Skip to content

fix: remove a stale .new before every update - #14

Merged
bfirestone merged 1 commit into
mainfrom
fix/sweep-stale-new
Sep 9, 2026
Merged

bfirestone merged 1 commit into
mainfrom
fix/sweep-stale-new

Conversation

@bfirestone

@bfirestone bfirestone commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

An install interrupted between writing <target>.new and renaming it into place left that file beside the binary. Tab completion then offered myapp and myapp.new until the next release shipped, since only replaceFile ever touched the name.

Update now calls a new optional Sweeper interface before the release check. ArchiveInstaller implements it by removing <target>.new when it is a regular file. A directory or symlink by that name is left alone, since the suffix is ours only by convention. Running before the check means the cleanup happens even when nothing new is available or the network is down. A sweep failure prints a warning and the update proceeds. replaceFile also removes a stale file before writing, for callers that drive the installer without Updater.

Verify with go test -race -count=1 ./... and golangci-lint run ./....

@bfirestone

Copy link
Copy Markdown
Contributor Author

This change is part of the following stack:

Change managed by git-spice.

Base automatically changed from fix/installer-followups to main September 9, 2026 03:52
An install interrupted between writing .new and renaming it left the file beside the binary, where it showed up in tab completion until the next release shipped. Update now asks an installer that implements the new Sweeper interface to remove it before the release check, so the cleanup runs even when nothing is available. Only a regular file by that name is removed.
@bfirestone
bfirestone merged commit e6538cc into main Sep 9, 2026
3 checks passed
@bfirestone
bfirestone deleted the fix/sweep-stale-new branch September 9, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant