Skip to content

fix(tui): use field defaults for blank numeric inputs - #383

Merged
TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
laozhej:fix/369-blank-numeric-defaults
Nov 16, 2026
Merged

TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
laozhej:fix/369-blank-numeric-defaults

Conversation

@laozhej

@laozhej laozhej commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Description

Clearing Concurrency, Timeout, Attempts, or Hit Rate now uses the field's built-in default instead of failing with “got 0.” Numeric parsing reads the defaults from formFields, keeping the scan settings and saved form consistent. Explicit zero, negative, and non-numeric values still receive their existing validation errors where those values are invalid.

The README documents blank-field behavior. Regression coverage compares empty and whitespace-only inputs with the default form across all eight integer fields and checks that invalid explicit values are still rejected.

Related Issue

Fixes #369.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvements
  • Test updates

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • I have added/updated appropriate comments to the code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)

Ethical Considerations

  • This change maintains or improves the security controls in the tool
  • This change follows the educational/legitimate security testing focus of the project
  • I have considered potential misuse cases and taken appropriate steps to prevent them

Additional Information

Validated on macOS arm64 with Go 1.26.11 and golangci-lint 2.15.0:

  • Before the fix, blank and whitespace-only Concurrency, Timeout, Attempts, and Hit Rate fail the new regression test; the updated hit-rate expectation also fails. These cases pass afterward.
  • go test -race -shuffle=on ./... passes the full suite (21 packages with tests).
  • make lint reports 0 issues; make build and git diff --check pass.

The full suite used only local DNS/HTTP fixtures and simulations. An initial restricted run could not bind loopback sockets; the complete rerun with local socket access passed. Prepared with OpenAI Codex assistance.

@TMHSDigital
TMHSDigital merged commit dca0199 into TMHSDigital:main Nov 16, 2026
17 checks passed
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.

TUI: clearing Concurrency, Timeout or Attempts errors with "got 0"

2 participants