From 8387473b268ab0b7433e343275fe7b1e9da3bb25 Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Wed, 24 Jun 2026 23:51:22 +0200 Subject: [PATCH] bigfix(gc): fix leak with GC and blob lifecycle call fire_blob_hooks to respect lifecycle dedup_service::garbage_collect_with_grac must call fire_blob_hooks() once blob are dropped so other services like thumbnail can proceed to their cleanup --- src/infrastructure/services/dedup_service.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/infrastructure/services/dedup_service.rs b/src/infrastructure/services/dedup_service.rs index cc9aa24e..a0de1aff 100644 --- a/src/infrastructure/services/dedup_service.rs +++ b/src/infrastructure/services/dedup_service.rs @@ -1972,6 +1972,16 @@ impl DedupService { DomainError::internal_error("Dedup", format!("GC decrement chunks: {e}")) })?; + // Fire the blob hooks against the **manifest's file_hash** — + // that's the key thumbnails are stored under (whole-file + // BLAKE3, not chunk hashes). Phase 2 below fires hooks for + // individual chunk hashes only; without this call, a + // CDC-chunked file's thumbnails leak on disk because the + // chunk-keyed hook never finds them. Symptom: orphan webp + // under `.thumbnails/{icon,preview,large}/.webp` + // after a user-cascade-delete of a video upload. + self.fire_blob_hooks(file_hash); + total_bytes += *size as u64; tracing::debug!( "GC: removed manifest {} ({} chunks)",