fix: open source database for Ortho placement

This commit is contained in:
codex
2026-08-04 14:43:59 +03:00
parent c97f02c550
commit 07ab3c436f
2 changed files with 4 additions and 1 deletions
@@ -483,7 +483,9 @@ internal sealed class PlantViewportMembershipReader
try
{
var openedByQuery = false;
var sourceDatabase = sourceId.GetDatabase(false, ref openedByQuery);
// The source model is normally not an active document in an Ortho /b session.
// Ask MdObjectId to open its source database read-only and dispose it below when it did.
var sourceDatabase = sourceId.GetDatabase(true, ref openedByQuery);
try
{
stage = "StartTransaction";
@@ -37,4 +37,5 @@ public sealed class PxpOaRegistrationTests
[Fact] public void ScriptDrivenPxpOa_UsesPreparedFixtureContextBeforeImplicitLookup() => Assert.Contains("TryGetPreparedContext(document, out var scriptContext)", Entry);
[Fact] public void ScriptDrivenPrepare_SelectsCanonicalTargetAndRetainsReadOnlyContext() { Assert.Contains("preparedContext = context", Observer); Assert.Contains("selectedTargetSnapshotId = candidates[0]", Observer); }
[Fact] public void PlacementReadFailure_IsDiagnosedInsteadOfBeingSilentlyDiscarded() { var source = File.ReadAllText(Path.Combine(ProjectRoot, "PlantReadPath.cs")); Assert.Contains("OrthoPipePlacementReadFailed", source); Assert.Contains("ORTHO_PIPE_PLACEMENT_UNAVAILABLE", source); }
[Fact] public void PlacementReader_OpensSourceDatabaseWhenItIsNotActive() { var source = File.ReadAllText(Path.Combine(ProjectRoot, "PlantReadPath.cs")); Assert.Contains("sourceId.GetDatabase(true, ref openedByQuery)", source); }
}