Skip to content

fix: graceful-missing-trash-file#145

Merged
Byron merged 1 commit intoByron:masterfrom
ZlordHUN:fix/graceful-missing-trash-file
May 3, 2026
Merged

fix: graceful-missing-trash-file#145
Byron merged 1 commit intoByron:masterfrom
ZlordHUN:fix/graceful-missing-trash-file

Conversation

@ZlordHUN
Copy link
Copy Markdown
Contributor

@ZlordHUN ZlordHUN commented May 3, 2026

Fixes #119

Opened a PR for the same problem in cosmic files however, one of the maintainers recommended this be fixed here instead.

…e missing trash files

When a .trashinfo file references a file in trash/files that no longer
exists, the assert! in metadata() and restore_all() would panic instead
of returning a proper error. This caused cosmic-files to crash when
encountering such orphaned trash entries.

Replace assert! with ensure_virtually_exists() which returns a proper
Error::FileSystem instead of panicking, allowing callers to handle
the missing file gracefully.
Copy link
Copy Markdown
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

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

@Byron Byron merged commit 75bb3b7 into Byron:master May 3, 2026
4 checks passed
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.

Panic assertion failed: virtually_exists(&file).map_err(|e| fs_error(&file, e))?

2 participants