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:
@@ -246,6 +246,28 @@ public sealed class DeployCompileValidator
|
||||
foreach (var source in config.NativeAlarmSources)
|
||||
AddActorNameError(errors, "Native alarm source", source.CanonicalName,
|
||||
$"native-alarm-{source.CanonicalName}");
|
||||
|
||||
// Data connection names become DataConnectionActor names through the DCL's sanitiser,
|
||||
// which is not injective: "PLC A" and "PLC-A" both map to "PLC-A", and the second
|
||||
// connection could never be created (lane A M2). Reject such a pair here, by name.
|
||||
if (config.Connections is { Count: > 0 } connections)
|
||||
{
|
||||
var byActorName = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
foreach (var name in connections.Keys.Order(StringComparer.Ordinal))
|
||||
{
|
||||
var actorName = DataConnectionLayer.Actors.ConnectionActorNames.Sanitize(name);
|
||||
if (byActorName.TryGetValue(actorName, out var other))
|
||||
{
|
||||
errors.Add($"{ActorNameErrorPrefix}Data connection names '{other}' and '{name}' " +
|
||||
$"both map to the runtime actor name '{actorName}' — rename one so they " +
|
||||
"differ in more than spaces or symbols.");
|
||||
continue;
|
||||
}
|
||||
|
||||
byActorName[actorName] = name;
|
||||
AddActorNameError(errors, "Data connection", name, actorName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddActorNameError(
|
||||
|
||||
Reference in New Issue
Block a user