fix(grpc-data): Browse does not list unsupported value nodes (#917)
Live gate fu916-1 found that listing an alarm-bearing tag as UnsupportedVariable made the consumer's whole remote-opc folder unbrowsable (BadNoCommunication): ProjectedNamespaceApplier applies a page all-or-nothing and TryEnsureProjectedVariable rejects any kind but Folder/Variable/Tag, on every consumer build. The origin now skips unsupported value nodes in Browse; they stay addressable (Unsupported) and exportable.
This commit is contained in:
+10
-7
@@ -177,7 +177,7 @@ advertisement and a per-call request header, `x-otopcua-data-features`, whose va
|
||||
### What an origin exports (v1 corrections #916, #917)
|
||||
|
||||
v1 was merged but not deployed (#915), so two defects were fixed in v1 itself. Header-less callers get the fix too.
|
||||
Neither change alters the wire shape. Evidence: `docs/plans/evidence/grpc-data-ext/V1-916-917.md`.
|
||||
Neither change alters the wire shape: one drops an optional field, the other drops a page item. Evidence: `docs/plans/evidence/grpc-data-ext/V1-916-917.md`.
|
||||
|
||||
- **No `Metadata.stable_source_id` (#916).** The origin never sends field 10. It used to carry the internal acquisition key,
|
||||
which for a driver tag is `<len>:<driverInstanceId><RawPath>`. That disclosed driver ids and RawPaths to peers holding
|
||||
@@ -187,13 +187,16 @@ Neither change alters the wire shape. Evidence: `docs/plans/evidence/grpc-data-e
|
||||
- The field is `optional`. Old consumers decode its absence as null, so every version mix works.
|
||||
- Conditions dedupe on the keyed `condition_key` instead.
|
||||
- Internally the origin still keys acquisition on the unchanged `BackingSourceKey`.
|
||||
- **Alarm-bearing raw tags are `UnsupportedVariable` (#917).** A tag with an alarm config never gets a value: the driver
|
||||
- **Alarm-bearing raw tags are not exported as values (#917).** A tag with an alarm config never gets a value: the driver
|
||||
host keeps it out of the value fan-out, and #896 gives it no UNS variable.
|
||||
- It is still browsable, so exports rooted at it and its folder's condition placement still work.
|
||||
- Its node kind is `UnsupportedVariable` and its value kind `NULL`, with Browse as the only operation. Read, Subscribe,
|
||||
GetMetadata and HistoryRead answer `Unsupported`, and writes are refused.
|
||||
- Consumers already skip that kind, so nothing waits on a value that never comes.
|
||||
- The alarm itself is forwarded as a **condition** (A1–A4, see "Condition forwarding end to end").
|
||||
- The origin compiles it as an unsupported value node. GetMetadata, Read, Subscribe and HistoryRead on it answer
|
||||
`Unsupported`, and writes are refused.
|
||||
- **Browse does not list it**, and the same holds for any unsupported value node, such as a data type v1 cannot carry.
|
||||
Every consumer build applies a browse page all or nothing and cannot materialise an `UnsupportedVariable`. Listing one
|
||||
made the whole folder unbrowsable on the consumer (`BadNoCommunication`); the live gate found this.
|
||||
- The node stays in the catalog, so an export rooted at it still compiles.
|
||||
- The alarm itself is forwarded as a **condition** (A1–A4, see "Condition forwarding end to end"). Condition placements
|
||||
do not depend on the value node.
|
||||
|
||||
G0, the v1 deploy and soak (#915), is still open; see the plan's §1.1.
|
||||
|
||||
|
||||
@@ -615,7 +615,7 @@ per-origin-cluster `${secret:}` of at least 32 UTF-8 bytes, identical on both pa
|
||||
- If the secret is absent, the origin advertises no `conditions` capability (fail closed, with a diagnostic).
|
||||
|
||||
> **Pre-existing v1 findings (not fixed here; filed as #916 and #917).** *Update 2026-11-28: both are fixed in v1 before
|
||||
> deploy. `stable_source_id` is no longer sent, and alarm-bearing raw tags are exported as `UnsupportedVariable`. See
|
||||
> deploy. `stable_source_id` is no longer sent, and alarm-bearing raw tags are no longer value nodes (not listed by Browse, `Unsupported` on every value operation). See
|
||||
> `docs/plans/evidence/grpc-data-ext/V1-916-917.md`.*
|
||||
> 1. #916 — `type:review-finding`, security: v1 already sends `stable_source_id` = driver id + RawPath on **UNS reference variables**
|
||||
> to UNS-only principals (same code path).
|
||||
|
||||
@@ -58,19 +58,30 @@ the reserved `Area/Line/Equipment/EffectiveName` id, parented at the equipment.
|
||||
condition items and keyed by `condition_key`, and the consumer materialises them in its `mapped/conditions` namespace.
|
||||
The alarm is therefore served as a condition, never as a value.
|
||||
|
||||
**Decision: export the tag as the existing explicit `UnsupportedVariable` kind** (`supported = plan.Alarm is null && …`).
|
||||
We did not remove the node, for three reasons:
|
||||
**Decision: compile the tag as an unsupported value node, and do not list it in Browse.** The rule is
|
||||
`supported = plan.Alarm is null && …` in `Compile`. In `LocalDataServices.BrowseAsync`, a child with a `Source` and
|
||||
`!Supported` is skipped.
|
||||
|
||||
- `UnsupportedVariable` is already a v1 kind (used for unmapped data types). Old consumers already treat it as "not a
|
||||
value node" (`ProjectedCatalogCache.IsValueNode`, `OtOpcUaNodeManager.cs:4988`), so no consumer materialises or waits on
|
||||
it.
|
||||
- Every value gate already keys on `LocalDataNode.Supported`. Read, Subscribe and GetMetadata answer `Unsupported`.
|
||||
History requires `Supported`. Writes are refused by `DataWriteDispatchGate`. Browse masks the operations to Browse.
|
||||
- Removing the node would turn a deployable `DataExport` rooted at that tag (`RootKind = RawTag` is valid) into a catalog
|
||||
compile failure ("Export has no valid origin root") for the whole cluster.
|
||||
- **Value operations.** Every value gate already keys on `LocalDataNode.Supported`: GetMetadata, Read and Subscribe
|
||||
answer `Unsupported`, history requires `Supported`, and `DataWriteDispatchGate` refuses writes.
|
||||
- **The node stays in the catalog.** Removing it would turn a deployable `DataExport` rooted at that tag
|
||||
(`RootKind = RawTag` is valid) into a catalog compile failure ("Export has no valid origin root") for the whole cluster.
|
||||
- **Browse hides it. The live gate forced this.** The first attempt listed the tag as the existing v1
|
||||
`UnsupportedVariable` kind, on the assumption that consumers skip that kind. They do not. `ProjectedNamespaceApplier`
|
||||
hands a whole page to `IProjectedNamespacePageSink.TryApply`, and `OtOpcUaNodeManager.TryEnsureProjectedVariable`
|
||||
rejects anything that is not a Folder, Variable or Tag (`OtOpcUaNodeManager.cs:4988`). So **one** `UnsupportedVariable`
|
||||
child failed the whole page.
|
||||
- On run `fu916-1`, browsing the consumer's `remote-opc` branch (the A4 Raw mapping of the opc-plc device, which holds
|
||||
the alarm tag `EastTankYellow`) answered `BadNoCommunication`.
|
||||
- The rig's `resolve` walk hit the same status, and `deploy` timed out on "deployed catalog and OPC UA namespace
|
||||
identity".
|
||||
- Every consumer build behaves this way, including the merged v1 consumers. Listing the node would therefore break any
|
||||
mixed-version consumer. Not listing it works for all of them, because a page simply has one item fewer.
|
||||
- **The same holds for any unsupported value node**, for example a data type v1 cannot carry. A pre-existing v1 origin
|
||||
already broke consumer browse of a folder holding one, and the browse filter fixes that too.
|
||||
|
||||
Condition placements are independent of the value node. They need only their parent folder or equipment, so condition
|
||||
forwarding is unchanged.
|
||||
forwarding is unchanged. The live gate below re-proves it on the alarm tag itself.
|
||||
|
||||
## The v1 gate: goldens not re-recorded
|
||||
|
||||
@@ -79,8 +90,8 @@ forwarding is unchanged.
|
||||
re-serialises it:
|
||||
|
||||
- it clears `stable_source_id` on every Metadata;
|
||||
- it makes HighTemp `UnsupportedVariable` / `VALUE_KIND_NULL` / `allowed_operations = 1` in Browse pages, and
|
||||
`status = Unsupported` with no value and no lease in GetMetadata.
|
||||
- it removes HighTemp from the device Browse page, and makes its GetMetadata item `status = Unsupported` with no value
|
||||
and no lease.
|
||||
|
||||
The test then compares the real origin's header-less bytes with the result. Only Browse, Browse/uns and GetMetadata are
|
||||
corrected. GetCapabilities, Read, Write, Write/no-write-grant and Subscribe are compared with the raw goldens, unchanged.
|
||||
@@ -89,7 +100,7 @@ corrected. GetCapabilities, Read, Write, Write/no-write-grant and Subscribe are
|
||||
- an unedited golden re-serialises byte-identically, so an edit is the only possible difference;
|
||||
- the corrected scenarios really differ from the goldens, and the others really do not;
|
||||
- the recorded UNS browse really contains the leaked `driver-1Plant/Modbus/dev1/`, and no corrected scenario does;
|
||||
- HighTemp is the single Unsupported item in GetMetadata.
|
||||
- HighTemp is the single Unsupported item in GetMetadata, and the only item dropped from the recorded device page.
|
||||
|
||||
The fake-origin gate `GrpcDataV1CompatibilityTests` is untouched and green.
|
||||
|
||||
@@ -101,7 +112,7 @@ value node of Browse, Browse/uns and GetMetadata, plus the HighTemp entries.
|
||||
| Test | Before the fix (master behaviour) | After |
|
||||
|---|---|---|
|
||||
| `GrpcDataConditionPlacementTests.No_exported_metadata_carries_the_internal_source_key_916` (60 generated topologies; encoded metadata of every node; UNS bytes searched for every driver id and RawPath; positive control: the internal key still contains them) | **Failed**: `node.Metadata.StableSourceId should be null` | Pass |
|
||||
| `GrpcDataConditionPlacementTests.An_alarm_bearing_raw_tag_is_an_UnsupportedVariable_and_keeps_its_condition_placements_917` (positive controls: a plain tag and the same tag without alarm config stay `Variable`; 3 placements and the Raw listing intact; an export rooted at the alarm tag compiles) | **Failed**: alarm tag `Supported` was true | Pass |
|
||||
| `GrpcDataConditionPlacementTests.An_alarm_bearing_raw_tag_is_an_UnsupportedVariable_and_keeps_its_condition_placements_917` (positive controls: a plain tag, and the same tag without its alarm config, stay supported `Variable`s; 3 placements and the Raw listing intact; an export rooted at the alarm tag compiles) | **Failed**: alarm tag `Supported` was true | Pass |
|
||||
| `GrpcDataV1RealOriginCompatibilityTests` header-less + feature-header Browse, Browse/uns, GetMetadata vs the raw goldens | Pass on master; fail with the fix | Compared with `Expected(...)`: pass |
|
||||
|
||||
## Gate runs (Release)
|
||||
|
||||
@@ -222,8 +222,8 @@ pre-H2 master `1086593a`.
|
||||
4. Never re-record.
|
||||
- **Pre-deploy corrections (#916, #917; 2026-11-28).** Two deliberate v1 fixes change real-origin Browse, Browse/uns and
|
||||
GetMetadata. `GrpcDataV1RealOriginCorrections.Expected` applies exactly those edits to the parsed, unre-recorded golden:
|
||||
it clears `stable_source_id` and makes the alarm-bearing HighTemp `UnsupportedVariable` / `Unsupported`. A test pins that
|
||||
the edits are the only difference. See `V1-916-917.md`.
|
||||
it clears `stable_source_id`, drops the alarm-bearing HighTemp from the device Browse page, and makes its GetMetadata
|
||||
item `Unsupported`. A test pins that the edits are the only difference. See `V1-916-917.md`.
|
||||
|
||||
## 3. Gate runs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user