Media files shared between assets: ownership after replace, other instances, kept rows and a purge race

Offen
#3,472 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
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
csharp
Bereich
backend

Rechercherichtung

Read the media specification and the code under src/plugins/FluentCMS.Plugins.Media/, especially the ownership, purge, and import paths; the issue does not name specific files or tests. Decide how each of the four cases should behave, then add a test for each behavior where the code changes. Done means the media specification records the decisions and tests cover ownership handoff, cross-instance references, re-importing a kept id, and the purge race.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area:storage plugin type:bug

Follow-ups of the rule that a media file is deleted only by the asset that owns it, when no other asset names it (#3264, #3467), found in its review. Paths are under src/plugins/FluentCMS.Plugins.Media/.

  • A replaced file that another asset still names ends up owned by no row. When an owner is replaced while an asset that does not own the file names its old key, the old file and its variants are kept, which is right, but no row owns them afterwards. Once the other asset goes, nothing deletes them. Before #3467, purging that other asset deleted the file whatever it owned. Hand the ownership of the old file to an asset that still names its key, or record why the leftover is accepted.
  • A purge on one instance deletes a file that another instance's imported asset names. With storage shared between instances, an import on instance B can name a key of instance A. When A purges its owner, B's asset loses its file: ReplacedFiles.NamedByOthers sees only A's database.
  • A deleted asset kept for a shared file blocks re-importing its id. An owner kept as a deleted row while another asset names its file makes an import of the same id fail with TransferIdTaken for as long as that asset lives; before, the id was free after 30 days.
  • An import can name the key of a deleted owner that the purge is about to delete. The import checks that the file exists, then the purge deletes it. Low.

Wanted

  • A decision on each, in the media section of the specification, with a test where the code changes.

Found in the review of #3467. Bundle 30.

Vorherrschende Sprache
C#
Sterne
567
Forks
107
Ø Merge
1 Std. 19 Min.
Gemergte PRs (30 T.)
353

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.