Export reads one row at a time without a snapshot, and import crashes on a locale for a non-localized type

Ouverte
#3,305 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é
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
25/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
csharp, sql

Piste de recherche

Start with the named transfer paths under src/FluentCMS.Core/: Content/EntryTransfer.cs, Transfer/TransferExporter.cs, Transfer/TransferImporter.cs, and the referenced store, service, import, and authorization files. Trace export queries and transaction handling, then follow how import handles locales and author fields; check the tests for each acceptance item. Done means all four behaviors meet the acceptance criteria and each has a test.

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

Description

area:content performance type:bug

Problem

  1. Export reads entries one row at a time. Only cms_document is read in chunks of 100 (Content/EntryTransfer.cs:67-69). Each locale row then calls store.ReadAsync per state (:82-83), 2–3 queries each (Content/EntryStore.cs:143-153): up to 6 queries per locale row.
  2. Export is not a snapshot. Transfer/TransferExporter.cs:125-140 opens no transaction; ids, document rows and field rows are separate statements. A save during the export can pair an old version with new fields, or leave a reference to an entry missing from the package.
  3. A non-localized item that carries a locale crashes. The locale is kept as sent (Transfer/TransferImporter.cs:424-427) but the row is written under "" (Content/ContentService.cs:1256), so written.Find(...)! throws a NullReferenceException (Content/ContentService.Import.cs:113-116). The item is reported as an unexpected failure. Only hand-made packages do this.
  4. The package decides who owns imported entries. Keeping the author fields is specified (spec 4.14), but the own-entries rule keys on CreatedBy (Authorization/AuthorizationBuilder.cs:16), and there is no way to import as oneself.

Paths are under src/FluentCMS.Core/.

Proposal

  • Read shared rows, locale rows and references per chunk with IN (ids).
  • Run the export in one snapshot or repeatable-read transaction.
  • Refuse the line as an invalid item, with a message.
  • Add authors=keep|importer to import, default keep.

Acceptance

  • Exporting N entries issues a number of queries proportional to N / chunk size
  • A save during an export does not change what the package contains
  • A non-localized item with a locale is reported as invalid, not as an unexpected failure
  • authors=importer records the importer as creator and updater
  • Tests for each

Found in the code review of 17 Nov 2026.

Langage dominant
C#
Étoiles
567
Forks
107
Merge moyen
1 h 19 min
PR mergées (30 j)
353

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.