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

Abierto
#3,264 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
C#
Estrellas
569
Forks
107
Merge medio
2 h 49 min
PR fusionados (30 d)
397

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fluentcms/FluentCMS

Todos los issues de fluentcms/FluentCMS

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.