From c51ca2276b6093efca0281303aa5c2b614d974de Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 26 Jun 2026 16:35:08 -0400 Subject: [PATCH] fix(historian-gateway): seam maxEvents XML doc + driver Platforms + ValueTask in fake Addresses Task 1 code-review: document that ReadEventsAsync.maxEvents is enforced client-side (no server cap in the wire contract); add Platforms=AnyCPU;x64 to match sibling drivers; use ValueTask.CompletedTask in FakeHistorianGatewayClient. Claude-Session: https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii --- .../IHistorianGatewayClient.cs | 10 ++++++++++ .../ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.csproj | 1 + .../FakeHistorianGatewayClient.cs | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway/IHistorianGatewayClient.cs b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway/IHistorianGatewayClient.cs index efb969a4..e11bad58 100644 --- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway/IHistorianGatewayClient.cs +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway/IHistorianGatewayClient.cs @@ -35,6 +35,16 @@ public interface IHistorianGatewayClient : IAsyncDisposable CancellationToken ct); /// Streams historian events over a window, optionally filtered to a single source name. + /// Optional source-name filter; null returns events from all sources. + /// Inclusive start of the time window (UTC). + /// Exclusive end of the time window (UTC). + /// + /// Caps the number of events returned. The gateway wire contract (ReadEventsRequest) has + /// no per-call server cap, so this limit is enforced client-side by early stream termination: + /// 0 or negative means no client-side limit (the gateway may still apply its configured + /// RuntimeDb:EventReadMaxRows); a positive value stops draining after that many events. + /// + /// Cancellation token. IAsyncEnumerable ReadEventsAsync( string? sourceName, DateTime startUtc, diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.csproj index aad1040c..1f2994d9 100644 --- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.csproj +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.csproj @@ -4,6 +4,7 @@ true true $(NoWarn);CS1591 + AnyCPU;x64 ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway diff --git a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.Tests/FakeHistorianGatewayClient.cs b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.Tests/FakeHistorianGatewayClient.cs index 1eda81d0..38f78ae4 100644 --- a/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.Tests/FakeHistorianGatewayClient.cs +++ b/tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.Tests/FakeHistorianGatewayClient.cs @@ -209,6 +209,6 @@ public sealed class FakeHistorianGatewayClient : IHistorianGatewayClient yield return item; } - await Task.CompletedTask.ConfigureAwait(false); + await ValueTask.CompletedTask.ConfigureAwait(false); } }