Site deletion can orphan entries, and the plugin and site caches reload under every request at once

Aperta
#3,306 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Start with Sites/SiteManager.cs:176-181 and Storage/SystemModelBuilder.cs to trace site deletion and document storage; compare SiteManager.cs:418-422 for the existing NOT EXISTS pattern. Then read the content write transaction and the cache refresh paths in Plugins/PluginState.cs:88-108, src/plugins/FluentCMS.Plugins.MultiSite/SiteHostMap.cs:36-56, and Sites/SiteCache.cs. Done means all four acceptance cases have tests and pass.

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

Descrizione

area:content area:storage type:bug

Problem

  1. Site deletion can orphan content. Sites/SiteManager.cs:176-181 checks for documents and then deletes the site as two statements with no transaction. cms_document has no foreign key to the site (Storage/SystemModelBuilder.cs), while locales and roles cascade. Other instances keep the site cached for 30 s (Sites/SiteCache.cs:15, Sites/SiteResolver.cs:107-110). An entry created between the check and the delete, or on another instance within 30 s, is left in a site that no longer exists and cannot be reached, restored or purged through the API.
  2. The plugin and site caches reload under every request at once. Plugins/PluginState.cs:88-108 and src/plugins/FluentCMS.Plugins.MultiSite/SiteHostMap.cs:36-56 have a fixed 30 s lifetime and no single-flight, so every request arriving after expiry runs the query. SiteCache.Invalidate() clears every key (Sites/SiteCache.cs:89-94).

Paths are under src/FluentCMS.Core/ unless they start with src/.

Proposal

  • Delete with NOT EXISTS in one statement, as RemoveLocaleAsync does (SiteManager.cs:418-422), and re-check the site inside the content write transaction.
  • Refresh each cache once, serving the previous copy to other callers meanwhile.

Acceptance

  • A site that gains an entry during deletion is not deleted
  • A write to a site deleted on another instance is refused
  • Concurrent requests after expiry run one refresh query
  • Tests for each

Found in the code review of 17 Nov 2026.

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.