Repository navigation
fix(adapters): recognize already-removed items when emptying Trash - #2093
Conversation
A failed delete is now counted as deleted when the error is NotFound, or when it is not cancellation and a follow-up query of the child returns NotFound. Any other error still counts as a failure, and up to eight error messages are kept, so an item that is still present remains a failure. Tests cover an already removed file for both NotFound and a generic failure, and errors where absence is not confirmed. Fixes lgse#1854
Pulls the NotFound/probe condition out of record_deletion into a predicate and notes why a failed delete is probed.
Each row now fails under a distinct mutation of already_removed. Drops the double-delete axis, which no mutation of the NotFound short-circuit could fail, the dangling-symlink row (GIO falls back to lstat for broken links, so it never guarded NOFOLLOW_SYMLINKS), the GIO premise probe, and fixture-existence assertions that record_deletion cannot affect. Present-directory failures stay owned by deletion_caps_errors_and_still_processes_successful_siblings.
Review and cleanupMerged Title. It failed Review against the description and #1854. Confirmed: a failed delete now counts as deleted when the error is Fixes pushed
Tests removed
Validation
Follow-ups outside this PR
CI: all checks green as of 2026-11-08 19:14 UTC ( |
|
Thanks for merging this, @l0gicgate. Good to have Empty Trash stop reporting already-removed items as failures. |
Description
Emptying the Trash can report failures for items that were actually deleted. On an ntfs3 volume, 22 of 150 trashed items were reported as failed after all 150 were gone. Every error from deleting a trash child was counted as a failure, including errors returned after the item was already gone. NotFound was not treated as success, and a generic failure was not followed by a check that the child was still present, so the failure count stayed above zero and the partial-failure report appeared.
A failed delete is now counted as deleted when the error is NotFound, or when it is not cancellation and a follow-up query of the child returns NotFound. Any other error still counts as a failure, and up to eight error messages are kept, so an item that is still present remains a failure. Tests cover an already removed file for both NotFound and a generic failure, and errors where absence is not confirmed.
Visual evidence
No user-visible surface changes in this PR, so there is nothing to show.
How to test
The test result for the strata EmptyTrashOutcome change was not available when this description was written.
Related issue
Closes #1854
AI was used for assistance.