Media purge and site deletion delete files the asset does not own

Aperta
#3,264 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Read MediaVariantCleanupJob.PurgeAsync in src/plugins/FluentCMS.Plugins.Media/MediaVariantCleanupJob.cs and DeletedSiteMedia.RemoveAsync in DeletedSiteMedia.cs, then compare their deletion logic with the replacement check and MediaTransferTests.AFileAnotherAssetNamesStaysWithItsVariants. Add coverage for deleting or purging either of two assets that name one key, including site deletion. Done means the remaining asset's file is preserved in each case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:storage plugin type:bug

Problem

MediaVariantCleanupJob.PurgeAsync (src/plugins/FluentCMS.Plugins.Media/MediaVariantCleanupJob.cs:100-116) and DeletedSiteMedia.RemoveAsync (DeletedSiteMedia.cs:285,295) call storage.DeleteAsync(asset.StorageKey) without checking asset.OwnsFile or the ReplacedFiles.NamedByOthers check that replace uses. An import can name an existing key (owned: false, see MediaTransferTests.AFileAnotherAssetNamesStaysWithItsVariants), so purging one asset deletes the original another live asset still serves, and with shared storage another instance's file.

Proposal

Delete the original only when the asset owns it and no other asset names it; otherwise remove only the row.

Acceptance

  • Deleting and purging either of two assets on one key keeps the other's file
  • The same for site deletion

Found in the code review of 17 Nov 2026 (B1).

Lingua principale
C#
Stelle
569
Fork
107
Merge medio
2h 49m
PR unite (30g)
397

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fluentcms/FluentCMS

Tutte le issue di fluentcms/FluentCMS

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.