Skip to content

fix(decomposedfs): return NotFound when restoring a missing trash item - #982

Merged
micbar merged 2 commits into
mainfrom
port-740
Nov 6, 2026
Merged

micbar merged 2 commits into
mainfrom
port-740

Conversation

@butonic

@butonic butonic commented Nov 6, 2026

Copy link
Copy Markdown
Member

Restoring a trash item that was already restored or purged returned a bare *fs.PathError, so the storage provider answered with a 500 instead of a 404. We now map ErrNotExist to errtypes.NotFound in the decomposedfs trashbin (like PurgeRecycleItem already does) and in the posix trashbin, which fails earlier when reading the .trashinfo file.

The new recycle spec runs for both the decomposedfs and the posix env.

Assisted by Claude Code (claude-opus-5-5): it ported the change, wrote the posix fix and spec adaptation, and drafted this description.

mzner and others added 2 commits November 6, 2026 13:57
Restoring a trash item whose trash-symlink no longer exists (already
restored or purged) returned a bare *fs.PathError, surfacing as 500
CODE_INTERNAL instead of 404. Mirror PurgeRecycleItem's existing
ErrNotExist -> errtypes.NotFound mapping.
The posix trashbin reads the .trashinfo file before anything else when
restoring to the original location. The first restore removes that
file, so restoring the same key again returned the bare *fs.PathError
from os.ReadFile and the storage provider answered with a 500 instead
of a 404.

We now map ErrNotExist to errtypes.NotFound like the decomposedfs
trashbin does. The shared recycle spec runs for the posix env too and
covers this.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@butonic butonic self-assigned this Nov 6, 2026

@micbar micbar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@micbar
micbar merged commit 0b238ad into main Nov 6, 2026
19 of 20 checks passed
@micbar
micbar deleted the port-740 branch November 6, 2026 14:57
@openclouders openclouders mentioned this pull request Nov 6, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants