From d54b4fab62304551cbd423f4754ae55cbd40ff7f Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 17 Aug 2026 06:09:13 -0400 Subject: [PATCH] =?UTF-8?q?docs(acl):=20fix=20the=20two=20comment=20nits?= =?UTF-8?q?=20from=20the=20T1=20re-review=20=E2=80=94=20displacement=20pre?= =?UTF-8?q?cision,=20straggler-test=20claim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Security/SessionAclDecisionCache.cs | 6 +++--- .../SessionAclDecisionCacheTests.cs | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Security/SessionAclDecisionCache.cs b/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Security/SessionAclDecisionCache.cs index ea44d403..21b40271 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Security/SessionAclDecisionCache.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Security/SessionAclDecisionCache.cs @@ -254,9 +254,9 @@ public sealed class SessionAclDecisionCache // paid by every eviction. // // A shard from a PREVIOUS generation contributes no hint: the fill level it reached belongs to a - // set of grants that no longer exists, and it is about to be displaced by the generation check - // below in any case. Sizing this generation's storage from the last one's crawl would be a guess - // dressed as evidence. + // set of grants that no longer exists, and this very Displace replaces it with a fresh shard + // stamped to the current generation regardless. Sizing this generation's storage from the last + // one's crawl would be a guess dressed as evidence. shard = Displace( sessionKey, shard, generation, capacityHint: shard.Generation == generation diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests/SessionAclDecisionCacheTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests/SessionAclDecisionCacheTests.cs index 5bf36a05..4d75d858 100644 --- a/tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests/SessionAclDecisionCacheTests.cs +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests/SessionAclDecisionCacheTests.cs @@ -295,8 +295,9 @@ public sealed class SessionAclDecisionCacheTests cache.TryGet(generation: 1, Session, OpcUaOperation.Read, AddressSpaceRealm.Raw, Node, out _) .ShouldBeFalse("a superseded snapshot must recompute rather than read the newer generation"); - // Asserted BEFORE the generation-2 lookup below, which would itself restore a rolled-back stamp and - // hide the defect. + // Asserted BEFORE the generation-2 lookup below, which would itself restore a rolled-back stamp — + // so a stamp assertion made after it could never fail. (The purge half would still surface, as the + // last lookup would miss; it is the stamp half that needs its assertion here.) cache.Generation.ShouldBe(2, "the straggler must not have rolled the stamp backward"); cache.Count.ShouldBe(1, "and must not have purged the current generation's entries");