fix: recover fixture activation raised during document open

This commit is contained in:
codex
2026-08-04 07:25:53 +03:00
parent 523d063ceb
commit 13578b7c9b
2 changed files with 19 additions and 0 deletions
@@ -195,6 +195,16 @@ internal sealed class FirstLimitedApplyAutomationCoordinator
document.CommandCancelled += OnCommandCancelled;
documentHandlersSubscribed = true;
Transition(CoordinatorState.Running, "AutomationRunning");
// DocumentActivated can be raised synchronously by Open before the
// coordinator receives the returned Document. Confirm the current
// active document after assignment so that one missed event cannot
// strand the workflow waiting for another startup Idle.
if (ReferenceEquals(AcadApplication.DocumentManager.MdiActiveDocument, document))
{
fixtureDocumentActivated = true;
transitions.Add("FixtureDocumentActiveAfterOpen");
TryActivateProjectAndVerifyContext();
}
}
catch (System.Exception ex) { FailFromCallback("Start", ex, "AUTOMATION_START_FAILED"); }
}