Repository navigation
feat: clean up leftover staging folders from interrupted operations - #124
Merged
Merged
Conversation
Every temporary ControlFS creates in the user's folders (extraction staging, dedicated-folder placeholder, partial copy and partial archive) is registered in a journal in the app data folder before it is created, and the entry is removed only once the temporary is gone. On startup, entries whose owner process is no longer running are resolved: staging folders are deleted only when their manifest carries the registered token, partial files and empty placeholders only by their exact random name; links are never followed. The bottom bar reports what was removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nextestudios
force-pushed
the
feature/82-staging-cleanup
branch
from
September 27, 2026 03:17
16f07e6 to
56487be
Compare
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.
Summary
ITemporaryJournal(Core) andTemporaryJournal(Infrastructure.Windows): one small JSON entry per active temporary in<app data>/operations, written before the temporary is created and removed only after it no longer exists. Each entry records path, kind, manifest token (staging) and the owner process (PID + start time)..controlfs-staging-*(the manifest now carries a random token), the dedicated-folder placeholder.controlfs-new-*, partial copies.controlfs-copy-*.part(FileOperationService) and partial archives.controlfs-new-*.part(ArchiveCreator).AppController.Start, background) entries whose owner process is gone are resolved: a staging folder is deleted only if it is a real folder (not a link) with the expected prefix and a manifest containing the registered token; partial files/empty placeholders only by their exact random name. Deletion never follows links. Entries of a still-running ControlFS instance are kept; anything not provably ours is left untouched and its entry dropped. The bottom bar reports the count and where.MainWindow(same journal for archives, file operations and the controller). Guide (EN/pt-BR), security model, architecture, TESTING and both changelogs updated.Tests
LeftoverCleanupTests.Next_launch_removes_the_owned_leftovers_of_a_crashed_operation_and_nothing_elsesimulates a crashed process (journal with a dead PID) and checks that the next launch removes the owned staging folder and partial copy, keeps a look-alike folder that is not registered, a registered folder whose manifest token does not match, and the active staging of a live instance, and shows the status notice.Finished_operations_leave_no_journal_entries_behind(extract, compress, copy).Closes #82
🤖 Generated with Claude Code