fix: queue readiness barrier after fixture activation
This commit is contained in:
@@ -199,14 +199,14 @@ internal sealed class FirstLimitedApplyAutomationCoordinator
|
||||
// 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.
|
||||
var activeDocument = AcadApplication.DocumentManager.MdiActiveDocument;
|
||||
if (activeDocument is not null && string.Equals(activeDocument.Name, document.Name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Open was requested for this exact local fixture and it has just
|
||||
// been made MDI-active. Queue a no-op public command regardless of
|
||||
// wrapper identity/name normalisation; CommandEnded is the actual
|
||||
// readiness proof before any Plant API is used.
|
||||
fixtureDocumentActivated = true;
|
||||
transitions.Add("FixtureDocumentActiveAfterOpen");
|
||||
QueueReadinessBarrier();
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex) { FailFromCallback("Start", ex, "AUTOMATION_START_FAILED"); }
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public sealed class FoundationTests
|
||||
var source = File.ReadAllText(Path.Combine(ProjectRoot, "src", "PRecAnnot.Plant3D2026", "FirstLimitedApplyAutomation.cs"));
|
||||
var start = source[source.IndexOf("public void Start()", StringComparison.Ordinal)..source.IndexOf("private void CompleteLifecycleProbe", StringComparison.Ordinal)];
|
||||
Assert.Contains("FixtureDocumentActiveAfterOpen", start);
|
||||
Assert.Contains("string.Equals(activeDocument.Name, document.Name", start);
|
||||
Assert.Contains("fixtureDocumentActivated = true", start);
|
||||
Assert.Contains("QueueReadinessBarrier();", start);
|
||||
Assert.Contains("ReadinessBarrierCompleted", source);
|
||||
Assert.Contains("TryActivateProjectAndVerifyContext();", source);
|
||||
|
||||
Reference in New Issue
Block a user