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

Offen
#3,264 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
62/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
csharp
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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).

Vorherrschende Sprache
C#
Sterne
569
Forks
107
Ø Merge
2 Std. 49 Min.
Gemergte PRs (30 T.)
397

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus fluentcms/FluentCMS

Alle Issues in fluentcms/FluentCMS

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.