fix(ablegacy): coalesceReads absent means default; the form never pins it
Review r0 M9. The AdminUI form wrote coalesceReads:true on every save, pinning today's default into every edited driver. AbLegacyDriverOptions.CoalesceReads is now bool? (null = default ON, never serialised, same encoding as Transport); the form omits the key when the switch is on and writes only an explicit false. Persisted coalesceReads:true keeps loading as on. Refs #738 Claude-Session: https://claude.ai/code/session_01Ub9hGmYLQvn9XETzw7CMsT
This commit is contained in:
+6
-2
@@ -269,8 +269,12 @@ public sealed class AbLegacyDriverPageFormSerializationTests
|
||||
|
||||
var saved = AbLegacyDriverForm.Serialize(form.ToOptions(loaded.Devices), original);
|
||||
|
||||
ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.AbLegacyDriverFactoryExtensions.ParseOptions("t", saved)
|
||||
.CoalesceReads.ShouldBe(edited);
|
||||
(ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.AbLegacyDriverFactoryExtensions.ParseOptions("t", saved)
|
||||
.CoalesceReads != false).ShouldBe(edited);
|
||||
// Review 07 r0 M9: ON is the default and is OMITTED, never pinned; only an explicit off is written.
|
||||
var root = System.Text.Json.Nodes.JsonNode.Parse(saved)!.AsObject();
|
||||
if (edited) root.ContainsKey("coalesceReads").ShouldBeFalse();
|
||||
else root["coalesceReads"]!.GetValue<bool>().ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user