Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): don't delete offline files from disk when trash empties #14777

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

etnoy
Copy link
Contributor

@etnoy etnoy commented Dec 18, 2024

Right now, immich deletes files after 30 days that are excluded or outside of import paths, including original files.

I can't find the original bug report (github? reddit?)

Also adds some e2e tests related to offline files

@etnoy etnoy force-pushed the fix/empty-offline-files branch from 44f240d to 91b3b6a Compare December 18, 2024 14:31
Comment on lines +253 to +261
let willDelete = deleteOnDisk;

if (asset.isOffline) {
/* We don't want to delete an offline asset because it is either...
...missing from disk => don't delete the file since it doesn't exist where we expect
...outside of any import path => don't delete the file since we're not responsible for it
...matching an exclusion pattern => don't delete the file since we're not responsible for it */
willDelete = false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic already exists outside of this job. Why is it duplicated here again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants