Skip to content

Http download retry issue 929 3 #936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

firefoxNX
Copy link

Added more retryable error codes.

@firefoxNX firefoxNX requested review from hasezoey and nodkz as code owners July 14, 2025 17:18
@firefoxNX firefoxNX changed the base branch from master to beta July 14, 2025 17:18
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.62%. Comparing base (c738253) to head (ffca9d8).
Report is 3 commits behind head on beta.

Additional details and impacted files
@@           Coverage Diff           @@
##             beta     #936   +/-   ##
=======================================
  Coverage   89.62%   89.62%           
=======================================
  Files          15       15           
  Lines        2072     2072           
  Branches      528      528           
=======================================
  Hits         1857     1857           
  Misses        204      204           
  Partials       11       11           

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

Copy link
Member

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

Looks good to me, though some documentation for at least some errors would be great.
Also did you already test it in your CI with those changes?

Comment on lines +22 to +35
const retryableStatusCodes = [429, 500, 503];

const retryableErrorCodes = [
'ECONNRESET',
'ETIMEDOUT',
'ENOTFOUND',
'ECONNREFUSED',
'EPIPE',
'EHOSTUNREACH',
'EAI_AGAIN',
'ENETUNREACH',
'ECONNABORTED',
'aborted',
];
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be a good idea to add some comments to non-self-explaining errors, for example what is EAI_AGAIN? (i did not even know about this error before looking it up)

Copy link
Author

Choose a reason for hiding this comment

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

Yes there are lots of such error codes - https://nodejs.org/api/errors.html#nodejs-error-codes

@firefoxNX
Copy link
Author

Looks good to me, though some documentation for at least some errors would be great. Also did you already test it in your CI with those changes?

No. I have not tested with these retryable codes in Jenkins CI (running inside docker)

We use artifactory which takes 1 hour to reflect the public npmjs changes. I can test with 10.2.0-beta.4 once that is available.

@hasezoey hasezoey merged commit dc82f62 into typegoose:beta Jul 15, 2025
11 checks passed
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants