Skip to content

fix(selfcheck): never touch the user's real trash - #30

Open
photuris wants to merge 1 commit into
Percius04:masterfrom
photuris:selfcheck-trash-root
Open

fix(selfcheck): never touch the user's real trash#30
photuris wants to merge 1 commit into
Percius04:masterfrom
photuris:selfcheck-trash-root

Conversation

@photuris

@photuris photuris commented Sep 4, 2026

Copy link
Copy Markdown

Fixes #29.

emptyTrash() now honours a selfcheck-only OMAFILES_SELFCHECK_TRASH_ROOT override (same env-gated pattern as OMAFILES_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 .trashinfo origin is under ~/.cache/omafiles-selfcheck-* (any run, so a crashed run's litter is reclaimed too; /../ origins are refused).

Verified: gio trash somefile && omafiles --selfcheck leaves exactly that file in the trash and nothing else. --selfcheck 161/162, the failure being the pre-existing .7z check without p7zip.

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.

--selfcheck empties the user's real trash

1 participant