feat(transport): restore composition + alarm-script edges on bundle import

This commit is contained in:
Joseph Doherty
2026-05-24 06:16:24 -04:00
parent cef77e1378
commit 8e73e60f4a
4 changed files with 579 additions and 21 deletions

View File

@@ -221,10 +221,14 @@ public sealed class RoundTripTests : IDisposable
.Include(t => t.Compositions)
.SingleAsync(t => t.Name == "Pump");
Assert.Equal("composes BaseDevice", pump.Description);
// Composition edges intentionally NOT restored by the v1 import
// (see BundleImporter.BuildTemplate XML comment). Round-trip's
// field-level identity holds; rebuilding the composition graph
// belongs to a follow-up task.
// FU-B / #39 — composition graph IS restored on import. The bundle
// carried Pump composing BaseDevice via InstanceName="base"; the
// importer's second pass (ResolveCompositionEdgesAsync) re-resolved
// ComposedTemplateName to BaseDevice's new id after the template
// flush and re-added the row.
var pumpComp = Assert.Single(pump.Compositions);
Assert.Equal("base", pumpComp.InstanceName);
Assert.Equal(baseDevice.Id, pumpComp.ComposedTemplateId);
var standalone = await ctx.Templates.SingleAsync(t => t.Name == "Standalone");
Assert.Equal("no deps", standalone.Description);