fix: arm automation on post-netload command

This commit is contained in:
codex
2026-08-03 16:43:32 +03:00
parent 8a1735408a
commit 239796aafe
2 changed files with 8 additions and 1 deletions
@@ -45,7 +45,13 @@ internal static class FirstLimitedApplyAutomationBootstrap
// Public test command is intentionally side-effect free with respect to Plant APIs. // Public test command is intentionally side-effect free with respect to Plant APIs.
internal static void Arm() 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) private static void OnIdle(object? sender, EventArgs args)
@@ -70,6 +70,7 @@ public sealed class FoundationTests
Assert.DoesNotContain("PlantProject.LoadProject", bootstrap); Assert.DoesNotContain("PlantProject.LoadProject", bootstrap);
Assert.DoesNotContain("MdiActiveDocument", bootstrap); Assert.DoesNotContain("MdiActiveDocument", bootstrap);
Assert.Contains("AcadApplication.Idle += OnIdle", bootstrap); Assert.Contains("AcadApplication.Idle += OnIdle", bootstrap);
Assert.Contains("observedIdle = true", bootstrap);
Assert.Contains("coordinatorStartCount++", bootstrap); Assert.Contains("coordinatorStartCount++", bootstrap);
} }