[Feature] keep filename and checksum in the asset deletion audit (tombstone) #31994
hmnijp
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have searched the existing feature requests, both open and closed, to make sure this is not a duplicate request.
The feature - keep filename and checksum in the asset deletion audit (tombstone)
Summary
When an asset is permanently deleted, Immich keeps only a minimal tombstone in
asset_audit(id,assetId,ownerId,deletedAt) plusalbum_asset_audit(
albumId,assetId,deletedAt). All identifying metadata is removed:originalFileName,checksum(SHA1),originalPath,type. As a result it isimpossible to reconstruct what was deleted — only that something was removed,
when, and from which album.
Motivation / use case
Self-hosters who curate their library (duplicate review, album pruning, bulk
delete) need a durable audit trail:
accident;
Today, once the trash retention expires (or when deleting directly/permanently),
that information is gone, making any post-mortem impossible.
Current behavior
assetwithstatus='trashed',deletedAtset; the file remains on disk; restorable.asset,asset_exif,asset_file, etc. areremoved and the files are deleted from disk; only
asset_audit/album_asset_audittombstones remain, with no name/checksum/path.asset_auditis already exposed via the audit API used by client sync, butcarries no asset identity.
Proposed solution
Persist identity in the deletion record, e.g. add to
asset_audit:originalFileName,checksum,originalPath,fileCreatedAt,type(or a dedicated
asset_historytable capturing a snapshot on delete).Optionally:
Alternatives considered
it is coarser — daily granularity).
permanent/force delete bypasses it).
Additional context
Privacy trade-off: retaining deleted filenames could conflict with
"right to be forgotten" expectations. A reasonable design could be an opt-in
admin setting, or storing a hash-only record by default with an option to keep
full names.
Observed on a self-hosted instance: 657 permanent deletions produced 657
tombstones with only
asset_id+ timestamp — no way to tell which files theywere, even though the corresponding rows existed moments before.
Environment
Platform
All reactions