scan.Run should always end with exactly one EventDone
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 65/100
Research direction
Start in internal/scan/runner.go: read scan.Run, its early-exit paths, and the EventError documentation. Add coverage for each listed early exit and check that each produces exactly one EventDone; then review the CLI, TUI, and pkg/subenum consumers named in the issue. Done means all tests pass and no consumer handles a channel closing without EventDone.
Written by the indexing model from the issue text.
Description
Why it matters
scan.Run has two shapes of ending, and every consumer has to know both. Three consumers now each handle it separately: the CLI (main.go), the TUI (internal/tui/model.go, scan_view.go), and pkg/subenum, which adds an extra KindDone so its callers see one shape.
Evidence
- On five early-exit paths,
scan.RunsendsEventErrorand returns withoutEventDone: an out-of-scope domain, the recursion ceiling, a failed preflight, a failed wildcard check, and a wildcard zone without-force(internal/scan/runner.go, about lines 434–495). Only the deferredclose(events)runs. EventErroris documented as "non-fatal error message" (runner.go:345). In practice, five of its six uses stop the scan. The sixth, the reliability guard at line 877, is followed byEventDone.- The CLI comment says "Early errors such as wildcard detection close the channel without EventDone". The TUI has a
closedflag for "the scan ended without EventDone".
Suggested approach
- Have
scan.Runalways send exactly oneEventDone, withStats(all zero when nothing was scanned), even after an earlyEventError. - Fix the
EventErrordoc comment to say it usually means the scan stopped. - Then remove the special cases: the CLI drain comment, the TUI
closedpath, and the synthesized event inpkg/subenum'sRun.
Done when
scan.Run always ends with one EventDone, a test covers each early-exit path, and none of the three consumers has to handle a channel that closes without one.
- Dominant language
- Go
- Stars
- 1
- Forks
- 1
- Avg merge
- 14d 9h
- Merged PRs (30d)
- 1
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TMHSDigital/subenum
-
documentation testing
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
TMHSDigital/subenum#103 ·
Maintainers usually reply within 1 day
-
area: release bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
TMHSDigital/subenum#102 ·
Maintainers usually reply within 1 day
-
community marketing priority: low
Difficulty 5/5 Over a week Newbie friendliness 35/100
TMHSDigital/subenum#132 ·
Maintainers usually reply within 1 day
-
feature priority: low
Difficulty 5/5 Over a week Newbie friendliness 35/100
TMHSDigital/subenum#131 ·
Maintainers usually reply within 1 day
-
documentation marketing priority: medium
Difficulty 5/5 Over a week Newbie friendliness 25/100
TMHSDigital/subenum#127 ·
Maintainers usually reply within 1 day
All issues in TMHSDigital/subenum
Similar issues
-
[submenu] nil issue on ubuntu 26.04Possibly taken @egoist claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
prime-radiant-inc/evener#3873 ·
Maintainers usually reply within 1 day
-
extract_llm_sweep / cache_aware_summarizer prefix ask 400s when thinking.budget_tokens exceeds PrefixAskMaxTokensPossibly taken @amiddavid claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
rossoctl/context-guru#405 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
router-for-me/CLIProxyAPI#6423 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days