Skip to content

fix: download plugin to temp file first, then atomically replace - #15

Merged
NewAmazingPVP merged 2 commits into
NewAmazingPVP:mainfrom
KujouMolean:main
Aug 27, 2026
Merged

fix: download plugin to temp file first, then atomically replace#15
NewAmazingPVP merged 2 commits into
NewAmazingPVP:mainfrom
KujouMolean:main

Conversation

@KujouMolean

Copy link
Copy Markdown
Contributor

Previously the download wrote directly to the target JAR file. If the server restarted or crashed during the download, the plugin would be corrupted (half-written JAR). Now we write to a .tmp file first, and only after a successful download do an atomic move to the target path. On failure the temp file is cleaned up, leaving the original plugin intact.

Previously the download wrote directly to the target JAR file. If the
server restarted or crashed during the download, the plugin would be
corrupted (half-written JAR). Now we write to a .tmp file first, and
only after a successful download do an atomic move to the target path.
On failure the temp file is cleaned up, leaving the original plugin intact.
@NewAmazingPVP

Copy link
Copy Markdown
Owner

Looks great, thanks!

Validate downloaded JARs, preserve existing plugins on every failure, clean up unique temporary files, and run regression tests in CI.

Co-authored-by: Molean <cnmolean@gmail.com>
@NewAmazingPVP
NewAmazingPVP merged commit 7efb4ef into NewAmazingPVP:main Aug 27, 2026
1 check passed
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.

2 participants