fix(site-runtime,dcl): low-severity cleanups — observed adapter dispose (S9), alarm-filter overwrite warning (S10), bounded-channel comment (C2), invariant-culture condition fallback (C6)
This commit is contained in:
@@ -475,7 +475,10 @@ public class ScriptActor : ReceiveActor, IWithTimers
|
||||
_scriptName, _instanceName, msg.Success);
|
||||
}
|
||||
|
||||
private static bool EvaluateCondition(ConditionalTriggerConfig config, object? value)
|
||||
// internal (not private) so the culture-invariance of the non-numeric fallback
|
||||
// can be unit-tested directly on the test thread — the live path evaluates on a
|
||||
// dispatcher thread whose CurrentCulture the test cannot deterministically set.
|
||||
internal static bool EvaluateCondition(ConditionalTriggerConfig config, object? value)
|
||||
{
|
||||
if (value == null) return false;
|
||||
|
||||
@@ -500,7 +503,10 @@ public class ScriptActor : ReceiveActor, IWithTimers
|
||||
}
|
||||
catch
|
||||
{
|
||||
return string.Equals(value.ToString(), config.Threshold.ToString(), StringComparison.Ordinal);
|
||||
// Render the threshold with InvariantCulture to match the invariant numeric
|
||||
// parse two lines up — otherwise a de-DE host renders 1.5 as "1,5" and the
|
||||
// string fallback fires spuriously on locale-formatted values (C6).
|
||||
return string.Equals(value.ToString(), config.Threshold.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user