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

properly handle options.signal passed in by clients #97

Open
alexkli opened this issue Apr 29, 2022 · 1 comment
Open

properly handle options.signal passed in by clients #97

alexkli opened this issue Apr 29, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@alexkli
Copy link
Contributor

alexkli commented Apr 29, 2022

If a client sets options.signal, and triggers an abort this way, we need to respect this and not continue retrying.

See these contributions from @Ravelle in his fork:

riff-tech#1
riff-tech#2

@alexkli alexkli added this to the v3 milestone Apr 29, 2022
@alexkli alexkli added the bug Something isn't working label Apr 29, 2022
@Ravelle
Copy link

Ravelle commented Apr 29, 2022

Hey, thanks for the mention! I did consider PRing this fork but I neglected an edge case and didn't have time to fix it:
https://github.com/riff-tech/node-fetch-retry/blob/b9a2e826612e880c8f619ba05bf72e347f9c35a0/index.js#L221
Basically I would prefer that instead of directly overriding the calling appication's onabort handler, we extend it, that way it further avoids colliding with the expected functionality for abort signals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants