Skip to content

fix(tools): reject invalid retry attempt limits - #71

Merged
ralyodio merged 1 commit into
moshcoder:mainfrom
aiirvizionz:clientkit/retry-attempt-guard
Jul 30, 2026
Merged

fix(tools): reject invalid retry attempt limits#71
ralyodio merged 1 commit into
moshcoder:mainfrom
aiirvizionz:clientkit/retry-attempt-guard

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • Reject non-positive and non-integer retry() attempt limits
  • Prevent retry(fn, 0) from silently returning undefined without running fn
  • Add regression coverage for invalid limits and successful later retries

Why

retry() currently uses a for loop from 1 through maxAttempts. When maxAttempts is 0, negative, or fractional, the loop may not run as intended and can silently hide a misconfiguration instead of failing clearly.

Validation

  • node --test test\tools.test.mjs

@ralyodio
ralyodio merged commit 45896c9 into moshcoder:main Jul 30, 2026
3 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.

2 participants