fix(management): ParseDeploymentStatus rejects ordinals — Enum.TryParse accepts "2" as InProgress despite the row-88 names-only contract; same LooksNumeric guard as the audit strict parser (found by the Wave 6 rows-98/99 agent survey)
This commit is contained in:
@@ -2745,7 +2745,13 @@ public class ManagementActor : ReceiveActor
|
||||
private static DeploymentStatus? ParseDeploymentStatus(string? status)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(status)) return null;
|
||||
if (Enum.TryParse<DeploymentStatus>(status, ignoreCase: true, out var parsed)
|
||||
var trimmed = status.Trim();
|
||||
// Reject ordinals before TryParse — "2" parses to InProgress, which the
|
||||
// documented names-only contract does not admit. No enum member name can
|
||||
// start with a digit or a sign (same guard as AuditQueryParamParsers).
|
||||
var looksNumeric = char.IsAsciiDigit(trimmed[0]) || trimmed[0] == '+' || trimmed[0] == '-';
|
||||
if (!looksNumeric
|
||||
&& Enum.TryParse<DeploymentStatus>(trimmed, ignoreCase: true, out var parsed)
|
||||
&& Enum.IsDefined(parsed))
|
||||
{
|
||||
return parsed;
|
||||
|
||||
Reference in New Issue
Block a user