OpcUaClient: HistoryRead ignores per-node StatusCode (BadAggregateNotSupported looks like empty data) #649

Closed
opened 2026-10-08 18:51:36 -04:00 by dohertj2 · 2 comments
Owner

Found during #622. OpcUaClientDriver.ExecuteHistoryReadAsync (~lines 1982-2003) never checks r.StatusCode on the per-node HistoryReadResult, so a Processed read the upstream server rejects (e.g. BadAggregateNotSupported) is surfaced as empty data instead of the status. Test OpcUaClientDriverHistoryWireTests pins the current behaviour and must be updated with the fix.

Found during #622. OpcUaClientDriver.ExecuteHistoryReadAsync (~lines 1982-2003) never checks r.StatusCode on the per-node HistoryReadResult, so a Processed read the upstream server rejects (e.g. BadAggregateNotSupported) is surfaced as empty data instead of the status. Test OpcUaClientDriverHistoryWireTests pins the current behaviour and must be updated with the fix.
dohertj2 added the driver/opcuaclient label 2026-10-08 18:51:36 -04:00
Author
Owner

Fixed on master (22e79112 + b8c21367, merged 83ab1234). ExecuteHistoryReadAsync now checks each node's StatusCode (CodeBits): BadAggregateNotSupported → HistoryAggregateNotSupportedException; any other Bad → new HistoryReadStatusException (rejects non-Bad codes) relayed verbatim for that node only by ServeNodeAsync / ServeRawPagedAsync; node-level BadNoData stays an empty result. Wire tests cover Processed, Raw paging (resume read throws, sibling stays Good, no stray cursor) and BadNoData; each goes red when its fix is reverted.

⚠️ Latent in production: review found the server never dispatches HistoryRead to a driver's IHistoryProvider (only the server-wide historian source), so no client sees this today. Filed separately.

Fixed on master (`22e79112` + `b8c21367`, merged `83ab1234`). `ExecuteHistoryReadAsync` now checks each node's StatusCode (CodeBits): `BadAggregateNotSupported` → `HistoryAggregateNotSupportedException`; any other Bad → new `HistoryReadStatusException` (rejects non-Bad codes) relayed verbatim for that node only by `ServeNodeAsync` / `ServeRawPagedAsync`; node-level `BadNoData` stays an empty result. Wire tests cover Processed, Raw paging (resume read throws, sibling stays Good, no stray cursor) and BadNoData; each goes red when its fix is reverted. ⚠️ **Latent in production:** review found the server never dispatches HistoryRead to a driver's `IHistoryProvider` (only the server-wide historian source), so no client sees this today. Filed separately.
Author
Owner

Follow-up for the production-reachability gap: #655.

Follow-up for the production-reachability gap: #655.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#649