fix(dcl): ASCII-only connection actor names, guarded ActorOf, and gate rejection of colliding connection names (review 2026-10-21 lane A M2)

ConnectionActorNames.Sanitize (shared by the DCL manager and the site deploy
gate) keeps ASCII letters/digits and -_.*+:@&=,!~';() only. The manager fails a
connection whose sanitised name is invalid or already used (Error + site
event) instead of restarting; DeployCompileValidator rejects a config whose
connection names collide after sanitising.
This commit is contained in:
Joseph Doherty
2026-10-22 09:05:07 -04:00
parent 3c11510c52
commit 099b2221d6
6 changed files with 210 additions and 6 deletions
@@ -143,4 +143,25 @@ public class DeployCompileValidatorTests
Assert.Contains(nameErrors, e => e.Contains("Hi/Temp"));
Assert.Contains(nameErrors, e => e.Contains("Src#1"));
}
/// <summary>
/// Lane A M2: connection names that sanitise to the same DataConnectionActor name are
/// rejected by the gate; distinct ones (including non-ASCII) pass.
/// </summary>
[Fact]
public void ConnectionNames_CollidingAfterSanitising_AreRejected()
{
static string Cfg(params string[] names) => JsonSerializer.Serialize(new FlattenedConfiguration
{
Scripts = [], Alarms = [], NativeAlarmSources = [], Attributes = [],
Connections = names.ToDictionary(n => n, _ => new ConnectionConfig { Protocol = "OpcUa" })
});
var collide = NewValidator().Validate(Cfg("PLC A", "PLC-A")).Where(DeployCompileValidator.IsActorNameError).ToList();
Assert.Single(collide);
Assert.Contains("PLC A", collide[0]);
Assert.Contains("PLC-A", collide[0]);
Assert.Empty(NewValidator().Validate(Cfg("PLC A", "Ofen Süd")));
}
}