fix(transport): stop scanning DataSourceReference for blocker references

DetectBlockersAsync was feeding TemplateAttribute.DataSourceReference
into the identifier scanner alongside script bodies, but that field is
an OPC UA node-address path (e.g. "ns=3;s=Tank.Level") owned by the
device, not script source. The dot delimiter inside the path tripped
the heuristic into flagging the address segment ("Tank", "Sensor",
"TestChildObject", "DevAppEngine") as a missing SharedScript or
ExternalSystem reference -- a 100% false-positive class on any
template catalog with OPC-UA-mapped attributes.

Drop the DataSourceReference scan entirely. Attribute.Value is still
scanned because it can carry a design-time default expression that
calls into runtime APIs. Add a regression test pinning the new behavior.
This commit is contained in:
Joseph Doherty
2026-05-24 07:52:31 -04:00
parent 6bdada7549
commit bae75be2d2
2 changed files with 45 additions and 1 deletions

View File

@@ -374,8 +374,13 @@ public sealed class BundleImporter : IBundleImporter
foreach (var s in t.Scripts) CollectCallIdentifiers(s.Code, referencedFromBundle);
foreach (var a in t.Attributes)
{
// Attribute.Value carries the design-time default expression, which
// can be script-callable. DataSourceReference is an OPC UA node
// address path (e.g. "ns=3;s=Tank.Level") owned by the device --
// it's never script source and must NOT be scanned, or the dot
// delimiter trips the heuristic into flagging the address segments
// as missing SharedScript/ExternalSystem references.
CollectCallIdentifiers(a.Value, referencedFromBundle);
CollectCallIdentifiers(a.DataSourceReference, referencedFromBundle);
}
}
foreach (var m in content.ApiMethods)