fix(deployment): flatten reads compositions off the loaded template instead of a second per-template query (review 2026-10-21 04/U5)
This commit is contained in:
@@ -240,9 +240,14 @@ public class FlatteningPipeline : IFlatteningPipeline
|
||||
{
|
||||
if (!processedTemplateIds.Add(template.Id)) continue;
|
||||
|
||||
// The chain's templates come from GetTemplateWithChildrenAsync, which already
|
||||
// Includes Compositions — read them off the loaded entity rather than issuing a
|
||||
// second per-template composition query.
|
||||
var loaded = template;
|
||||
var compositions = await session.GetCompositionsAsync(
|
||||
template.Id,
|
||||
id => _templateRepo.GetCompositionsByTemplateIdAsync(id, cancellationToken));
|
||||
_ => Task.FromResult<IReadOnlyList<Commons.Entities.Templates.TemplateComposition>>(
|
||||
loaded.Compositions.ToList()));
|
||||
if (compositions.Count == 0) continue;
|
||||
|
||||
compositionMap[template.Id] = compositions;
|
||||
|
||||
Reference in New Issue
Block a user