Skip to content

fix(web): open the browser only once serve is listening; close remaining coverage gaps - #144

Merged
JustMaris merged 2 commits into
mainfrom
test/close-gaps
Oct 4, 2026
Merged

JustMaris merged 2 commits into
mainfrom
test/close-gaps

Conversation

@JustMaris

Copy link
Copy Markdown
Member
  • Fix: serve opened the browser after a blind 500ms, even when the port was taken. It now listens first and opens the browser only on success. An early Ctrl+C could also call Shutdown on a nil server and panic. Both are now guarded.
  • Tests: fill runs against a stub browser (formBrowser seam) and the auto loop's wait is a var. serve and monitor --watch are stopped with a real SIGINT (--watch is !race because of the go-imap race). update-brokers --check returns an error instead of calling os.Exit(1), and the exit code is unchanged.
  • cmd/eraser goes from 89% to 95.5%, internal/web from 91% to 94.5%.

BEGIN_COMMIT_OVERRIDE
fix(web): open the browser only once serve is listening; no panic on an early Ctrl+C
test(cli): close the remaining coverage gaps in serve, fill, monitor, auto, export and send
END_COMMIT_OVERRIDE

…an early Ctrl+C

Start opened the browser after a blind 500ms, even when the port was taken
and the server never came up. It now listens first and opens the browser
only on success. serve's Ctrl+C handler could call Shutdown before Start
had built the http.Server (nil dereference) and read it unsynchronised;
both are now guarded, and an early Shutdown makes Start return.
… auto, export and send

fill runs against a stub browser (formBrowser seam) so its CAPTCHA/submit/
fill handling is tested without Chrome; auto's wait between cycles is a
var so the loop can be ended; serve and monitor --watch are stopped with a
real SIGINT. update-brokers --check returns an error instead of calling
os.Exit(1) mid-command - the exit code is still 1. cmd/eraser 89% -> 95.5%,
internal/web 91% -> 94.5%.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 70.00000% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/eraser/cmd_auto.go 11.11% 8 Missing ⚠️
internal/web/server.go 85.18% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@JustMaris
JustMaris merged commit a47f0e4 into main Oct 4, 2026
6 checks passed
@JustMaris
JustMaris deleted the test/close-gaps branch October 4, 2026 04:51
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.

2 participants