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

Ouverte
#3,306 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
csharp

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
C#
Étoiles
569
Forks
107
Merge moyen
2 h 49 min
PR mergées (30 j)
397

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de fluentcms/FluentCMS

Toutes les issues de fluentcms/FluentCMS

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.