Skip to content

Conversation

@tomas-zijdemans
Copy link
Contributor

@tomas-zijdemans tomas-zijdemans commented Dec 30, 2025

Switched to using delay() for timeout handling.

Input handling:

  • Uses RangeError instead of TypeError for invalid options
  • Validates maxAttempts is a positive integer
  • Validates multiplier is a finite number >= 1
  • Validates jitter is between 0 and 1 (was only checking > 1)
  • Adds NaN checks for maxTimeout, minTimeout, and jitter

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.18%. Comparing base (13e5527) to head (124f405).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6922   +/-   ##
=======================================
  Coverage   94.17%   94.18%           
=======================================
  Files         584      584           
  Lines       43087    43102   +15     
  Branches     6875     6883    +8     
=======================================
+ Hits        40578    40596   +18     
+ Misses       2457     2455    -2     
+ Partials       52       51    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kt3k
Copy link
Member

kt3k commented Jan 5, 2026

We have the policy of accepting a new feature to stable APIs as unstable feature first. See https://github.com/denoland/std/blob/main/.github/CONTRIBUTING.md#new-features-in-stable-packages-version--100

Can you move feature addition part of this change to a different PR, targeting unstable_retry.ts?

@tomas-zijdemans tomas-zijdemans changed the title feat(async): add abort signal support to retry() refactor(async): improve retry() input validation Jan 5, 2026
@tomas-zijdemans
Copy link
Contributor Author

We have the policy of accepting a new feature to stable APIs as unstable feature first. See https://github.com/denoland/std/blob/main/.github/CONTRIBUTING.md#new-features-in-stable-packages-version--100

Can you move feature addition part of this change to a different PR, targeting unstable_retry.ts?

Sorry, I should have considered that!

I've reverted the new feature, while still keeping delay() instead of setTimeout. I hope this is acceptable (it allows retry to handle very large timeouts correctly)

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kt3k kt3k merged commit 6a9fecb into denoland:main Jan 6, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants