Skip to content

fix: accept PLANNOTATOR_PORT=0 without spurious warning#716

Merged
backnotprop merged 1 commit into
mainfrom
fix/port-zero-warning
May 13, 2026
Merged

fix: accept PLANNOTATOR_PORT=0 without spurious warning#716
backnotprop merged 1 commit into
mainfrom
fix/port-zero-warning

Conversation

@backnotprop
Copy link
Copy Markdown
Owner

Summary

  • PLANNOTATOR_PORT=0 printed [Plannotator] Warning: Invalid PLANNOTATOR_PORT "0", using default even though port 0 is the conventional "OS picks a random port" value — and already the local-mode fallback.
  • Relax the validator in getServerPort() from parsed > 0 to parsed >= 0 so 0 passes through silently.

Fixes #715

Test plan

  • PLANNOTATOR_PORT=0 plannotator annotate README.md — no warning printed
  • PLANNOTATOR_PORT=-1 plannotator annotate README.md — warning still printed (negative still invalid)
  • PLANNOTATOR_PORT=8080 plannotator annotate README.md — still binds to 8080

Port 0 is the conventional "let OS pick a random port" value and is
already the local-mode default. Validation rejected it as invalid and
printed a warning, even though the fallback returned 0 anyway.

Fixes #715
@backnotprop backnotprop merged commit d21d0de into main May 13, 2026
10 checks passed
@backnotprop backnotprop deleted the fix/port-zero-warning branch May 13, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PLANNOTATOR_PORT=0 spurious "Invalid" warning in local mode

1 participant