Skip to content

fix(windows): drop hardcoded lsof from backend http-bind-failure text#139

Merged
iret77 merged 1 commit into
mainfrom
fix/windows-lsof-leak
Jun 5, 2026
Merged

fix(windows): drop hardcoded lsof from backend http-bind-failure text#139
iret77 merged 1 commit into
mainfrom
fix/windows-lsof-leak

Conversation

@iret77

@iret77 iret77 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

When the HTTP server fails to bind, lib.rs::spawn_http_server writes a plaintext error into status.http_error that the frontend renders verbatim — directly above the OS-specific settings.http_error.hint.{os} line. The plaintext included lsof -i :{port}. On Windows, the tester would see two contradictory suggestions stacked: Mac lsof from the backend, then the correct PowerShell Get-NetTCPConnection from the i18n hint.

Backend message is now platform-neutral; the OS-correct command stays in the frontend hint where it already lives.

Why now

Audit of the v0.4.40 → v0.4.46 delta before handing the next NSIS build to the Windows tester. This is the only Windows-affecting regression I found in that range — set_activation_policy(Accessory), RunEvent::Reopen, and the new fs4 advisory-lock crate are all platform-clean.

Test plan

  • cargo check / clippy -D warnings / test --lib (98/98) — clean on macOS arm64
  • CI green on macOS arm64 + Windows x86_64
  • Mac: no visible change in normal operation; bind-failure banner still shows port + underlying error
  • Windows tester: bind-failure banner no longer mentions lsof above the PowerShell hint

🤖 Generated with Claude Code

The HTTP-bind-failure path in `lib.rs::spawn_http_server` writes a
plaintext diagnostic into `status.http_error` that the frontend renders
verbatim above the OS-specific `settings.http_error.hint.{os}` line.
The previous text included `lsof -i :{port}` — a macOS/Linux-only
command. On Windows the user would see the Mac `lsof` suggestion
*above* the correct PowerShell suggestion (Get-NetTCPConnection /
OwningProcess), which is confusing and contradicts the platform-aware
i18n split established in PR #128.

Fix: drop the diagnostic-command sentence from the backend text. The
plaintext now just states "port is held by another process" + the
underlying error; the OS-correct command stays where it already lives,
in the frontend hint.

Caught while auditing the v0.4.40 → v0.4.46 delta for Windows-only
regressions before handing the next NSIS build to the external tester.

Verification (macOS arm64): cargo check / clippy `-D warnings` /
test --lib (98/98), all clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@iret77 iret77 merged commit 3f03a8f into main Jun 5, 2026
3 checks passed
@iret77 iret77 deleted the fix/windows-lsof-leak branch June 5, 2026 23:31
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.

1 participant