fix(opcuaclient): #992 name the BadTimeout constant after its OPC UA status (StatusCodeParityTests)

This commit is contained in:
Joseph Doherty
2026-12-03 11:07:59 -05:00
parent 9279078885
commit 67682af520
@@ -1626,7 +1626,7 @@ public sealed class OpcUaClientDriver : IDriver, ITagDiscovery, IReadable, IWrit
// happen"). Downstream callers that need retry semantics check for BadTimeout
// and can decide whether to re-issue.
for (var w = 0; w < indexMap.Count; w++)
results[indexMap[w]] = new WriteResult(StatusBadTimeoutCode);
results[indexMap[w]] = new WriteResult(StatusBadTimeout);
// No reply arrived. Only a timeout is a comms fault — a caller that cancelled says nothing about upstream.
if (!cancellationToken.IsCancellationRequested) RecordCommsFault(generation, $"write: {ex.Message}");
}
@@ -1636,7 +1636,7 @@ public sealed class OpcUaClientDriver : IDriver, ITagDiscovery, IReadable, IWrit
// that closed under it) leaves the outcome unknown: BadTimeout, like a cancelled wait — never the
// "definitely did not happen" BadCommunicationError, which would tell the operator a setpoint that
// may have taken effect did not. Any other failure is a pre-wire transport fault.
var code = IsPossiblyDispatchedWriteFailure(ex) ? StatusBadTimeoutCode : StatusBadCommunicationError;
var code = IsPossiblyDispatchedWriteFailure(ex) ? StatusBadTimeout : StatusBadCommunicationError;
for (var w = 0; w < indexMap.Count; w++)
results[indexMap[w]] = new WriteResult(code);
RecordCommsFault(generation, $"write: {ex.Message}");
@@ -1645,7 +1645,7 @@ public sealed class OpcUaClientDriver : IDriver, ITagDiscovery, IReadable, IWrit
}
/// <summary>OPC UA <c>BadTimeout</c> — "outcome unknown" for a write.</summary>
private const uint StatusBadTimeoutCode = 0x800A0000u;
private const uint StatusBadTimeout = 0x800A0000u;
/// <summary>
/// G-14: whether a write failure is one that can occur after the request reached the wire — a