Skip to content
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

retry on all thrown errors by default #90

Merged
merged 5 commits into from
May 5, 2022

Conversation

jdelbick
Copy link
Contributor

@jdelbick jdelbick commented Apr 26, 2022

Fixes #88

Note: this is for v3 and thus goes into the version3 branch, not master.

Description

Requires #87 as a pre-requisite

Types of changes

  • 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 change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jdelbick jdelbick changed the title retry on all error by default retry on all errors by default Apr 26, 2022
@codecov
Copy link

codecov bot commented Apr 26, 2022

Codecov Report

❗ No coverage uploaded for pull request base (version3@47ec289). Click here to learn what that means.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             version3      #90   +/-   ##
===========================================
  Coverage            ?   98.75%           
===========================================
  Files               ?        1           
  Lines               ?       80           
  Branches            ?        0           
===========================================
  Hits                ?       79           
  Misses              ?        1           
  Partials            ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47ec289...aefaa43. Read the comment docs.

assert.strictEqual(await retryOptions.retryOnHttpError(new Error('ECONNRESET', 'system')), true);
assert.strictEqual(await retryOptions.retryOnHttpError(new AbortError('error!')), true);
// will be fixed to not retry on these by https://github.com/adobe/node-fetch-retry/issues/87
assert.strictEqual(retryOptions.retryOnHttpError(new TypeError('x is not a valid JSON')), true);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: will be false once #87 is done

@jdelbick jdelbick changed the title retry on all errors by default [blocked] retry on all errors by default Apr 26, 2022
@alexkli alexkli changed the base branch from master to version3 April 28, 2022 00:29
Copy link
Contributor

@alexkli alexkli left a comment

Choose a reason for hiding this comment

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

@jdelbick I changed this PR to go into the new version3 branch.

@alexkli alexkli mentioned this pull request Apr 29, 2022
10 tasks
@jdelbick
Copy link
Contributor Author

jdelbick commented May 2, 2022

@alexkli should I wait to merge this until #87 is fixed & merged to v3?

Copy link
Contributor

@alexkli alexkli left a comment

Choose a reason for hiding this comment

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

I think this can be merged already. See my additional inline comment.

index.js Outdated Show resolved Hide resolved
@jdelbick jdelbick changed the title [blocked] retry on all errors by default retry on all thrown errors by default May 5, 2022
@adobe-bot
Copy link

adobe-bot commented May 5, 2022

🎉 Sizewatcher congratulates on the size improvement 📉:

   🎉 git -81.8% (740 kB => 134 kB)

node_modules -1.7% (74.8 MB => 73.5 MB)
Largest production node modules:
┌──────────────────┬────────────┬───────┐
│ name │ children │ size │
├──────────────────┼────────────┼───────┤
│ node-fetch │ 0 │ 0.14M │
├──────────────────┼────────────┼───────┤
│ abort-controller │ 0 │ 0.07M │
├──────────────────┼────────────┼───────┤
│ 2 modules │ 0 children │ 0.22M │
└──────────────────┴────────────┴───────┘
npm_package -0.9% (11.4 kB => 11.3 kB)
Package contents:
📦  @adobe/[email protected]
=== Tarball Contents ===
850B .releaserc.json
3.2kB CODE_OF_CONDUCT.md
171B COPYRIGHT
11.3kB LICENSE
7.2kB README.md
555B index.d.ts
11.2kB index.js
1.1kB package.json
=== Tarball Details ===
name: @adobe/node-fetch-retry
version: 2.2.0
filename: @adobe/node-fetch-retry-2.2.0.tgz
package size: 11.3 kB
unpacked size: 35.7 kB
shasum: d0067f0714a0aa2a59ac358534903f232a57d8d2
integrity: sha512-slsMHSH5tkwGB[...]oVdrOrugOhSAQ==
total files: 8
Notes
  • PR branch: retry-on-all-errors-default @ 71b90d2
  • Base branch: version3
  • Sizewatcher v1.2.1
  • Effective Configuration:
limits:
  fail: 100%
  warn: 30%
  ok: '-10%'
report:
  githubComment: true
  githubStatus: false
comparators: {}

@jdelbick jdelbick merged commit 9936914 into version3 May 5, 2022
@jdelbick jdelbick deleted the retry-on-all-errors-default branch May 5, 2022 21:29
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.

3 participants