From 239796aafec994c3150ce0f183695f06a741c08b Mon Sep 17 00:00:00 2001 From: codex Date: Mon, 3 Aug 2026 16:43:32 +0300 Subject: [PATCH] fix: arm automation on post-netload command --- .../PRecAnnot.Plant3D2026/FirstLimitedApplyAutomation.cs | 8 +++++++- .../tests/PRecAnnot.Core.Tests/FoundationTests.cs | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/FirstLimitedApplyAutomation.cs b/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/FirstLimitedApplyAutomation.cs index 28b4200..4f25871 100644 --- a/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/FirstLimitedApplyAutomation.cs +++ b/Plant3D2026/P_Rec_Annot/src/PRecAnnot.Plant3D2026/FirstLimitedApplyAutomation.cs @@ -45,7 +45,13 @@ internal static class FirstLimitedApplyAutomationBootstrap // Public test command is intentionally side-effect free with respect to Plant APIs. internal static void Arm() { - if (state is BootstrapState.Prepared) state = BootstrapState.Armed; + if (state is BootstrapState.Prepared) + { + // The command itself is the post-NETLOAD barrier. The next Idle + // callback, not this command callback, is allowed to start work. + observedIdle = true; + state = BootstrapState.Armed; + } } private static void OnIdle(object? sender, EventArgs args) diff --git a/Plant3D2026/P_Rec_Annot/tests/PRecAnnot.Core.Tests/FoundationTests.cs b/Plant3D2026/P_Rec_Annot/tests/PRecAnnot.Core.Tests/FoundationTests.cs index b358f5a..333c565 100644 --- a/Plant3D2026/P_Rec_Annot/tests/PRecAnnot.Core.Tests/FoundationTests.cs +++ b/Plant3D2026/P_Rec_Annot/tests/PRecAnnot.Core.Tests/FoundationTests.cs @@ -70,6 +70,7 @@ public sealed class FoundationTests Assert.DoesNotContain("PlantProject.LoadProject", bootstrap); Assert.DoesNotContain("MdiActiveDocument", bootstrap); Assert.Contains("AcadApplication.Idle += OnIdle", bootstrap); + Assert.Contains("observedIdle = true", bootstrap); Assert.Contains("coordinatorStartCount++", bootstrap); }