Skip to content

Commit 94bdd12

Browse files
committed
fix: correctly classify format-rejected ports as 'not-numeric' instead of 'out-of-range'
When Number() produces a finite integer that is within the valid port range (1-65535) but Schema.NumberFromString still rejected the input (e.g. '+8080', '0x50'), the reason should be 'not-numeric' (format issue) rather than 'out-of-range'.
1 parent 3f0e34d commit 94bdd12

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/build-desktop-artifact.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,9 @@ function invalidMockUpdateServerPortReason(
910910
): typeof InvalidMockUpdateServerPortReason.Type {
911911
const parsed = Number(configuredPort);
912912
if (!Number.isFinite(parsed)) return "not-numeric";
913-
return Number.isInteger(parsed) ? "out-of-range" : "not-integer";
913+
if (!Number.isInteger(parsed)) return "not-integer";
914+
if (parsed >= 1 && parsed <= 65535) return "not-numeric";
915+
return "out-of-range";
914916
}
915917

916918
const resolveBooleanFlag = (flag: Option.Option<boolean>, envValue: boolean) =>

0 commit comments

Comments
 (0)