fix(selfcheck): never touch the user's real trash - #30
Open
photuris wants to merge 1 commit into
Open
Conversation
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.
Fixes #29.
emptyTrash()now honours a selfcheck-onlyOMAFILES_SELFCHECK_TRASH_ROOToverride (same env-gated pattern asOMAFILES_SELFCHECK_SLOW_TRASH_MOUNT_MS), read synchronously before the job is queued so the check can clear it on the next line. The emptyTrash check seeds a fixture trash root and empties that instead of the real one.That also uncovered a second leak: the trash round-trip checks leave ~54 fixture items in the real trash per run, and the old check was the only thing removing them. A final sweep now deletes only entries whose
.trashinfoorigin is under~/.cache/omafiles-selfcheck-*(any run, so a crashed run's litter is reclaimed too;/../origins are refused).Verified:
gio trash somefile && omafiles --selfcheckleaves exactly that file in the trash and nothing else.--selfcheck161/162, the failure being the pre-existing .7z check without p7zip.