Skip to content

Conversation

ckohen
Copy link
Member

@ckohen ckohen commented Aug 28, 2025

Please describe the changes this PR makes and why it should be merged:

Adds two related utility options for managing rest requests more dynamically.
Retry Backoff is completely new, allows backing off on 5xx and aborted requests. Closes: #10571
timeout gets a callback utility, allows setting the timeout per request Closes: #10927 and supersedes #11013

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

Copy link

vercel bot commented Aug 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
discord-js Ignored Ignored Preview Sep 10, 2025 9:17am
discord-js-guide Ignored Ignored Preview Sep 10, 2025 9:17am

Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.12%. Comparing base (5d5a694) to head (3399c9d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/rest/src/lib/handlers/Shared.ts 62.50% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11067      +/-   ##
==========================================
- Coverage   44.27%   44.12%   -0.15%     
==========================================
  Files         312      310       -2     
  Lines       17851    17791      -60     
  Branches     1775     1766       -9     
==========================================
- Hits         7903     7851      -52     
+ Misses       9936     9928       -8     
  Partials       12       12              
Flag Coverage Δ
core 0.88% <ø> (ø)
proxy 65.88% <ø> (ø)
rest 87.56% <77.77%> (+0.37%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@ckohen ckohen marked this pull request as ready for review August 28, 2025 06:43
@ckohen ckohen requested a review from a team as a code owner August 28, 2025 06:43
Co-authored-by: Qjuh <[email protected]>
@Jiralite
Copy link
Member

Does this address #11000?

@Jiralite Jiralite added this to the rest 3.0.0 milestone Aug 30, 2025
@ckohen
Copy link
Member Author

ckohen commented Aug 30, 2025

No, not at all. That requires a change in discord.js not rest (which I'll get to later today)

kyranet
kyranet previously requested changes Sep 2, 2025
@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Sep 2, 2025
Copy link
Member

@didinele didinele left a comment

Choose a reason for hiding this comment

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

you mentioned changing a thing in kyra's thread, other than that, LGTM

@github-project-automation github-project-automation bot moved this from Review in Progress to Review Approved in discord.js Sep 6, 2025
@kodiakhq kodiakhq bot merged commit f1bcff4 into discordjs:main Sep 10, 2025
26 checks passed
@github-project-automation github-project-automation bot moved this from Review Approved to Done in discord.js Sep 10, 2025
@ckohen ckohen deleted the rest/retry-timeout-callbacks branch September 10, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

members prune timeout Adding back-off during retries for REST handler

6 participants