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

Don't trigger timeout error when signal aborted elsewhere #61

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kainosnoema
Copy link

Currently it's not really possible to use your own signal and abort outside of the TimeoutLink, because the timeout error is still triggered even if the request was aborted outside of the TimeoutLink.

This change lets you use your own signal properly by simply ensuring that an aborted signal unsubscribes from the timeout. In addition, we only clear out any existing signal when it's one that the TimeoutLink added, so that externally provided signals aren't cleared (might use a getter for example, to continue returning a valid signal).

Also added tests for this. Confirmed working for us in our application.

If there's already an existing signal / controller in fetchOptions, we
don't want to consider the request timed out if it's aborted elsewhere.

Signed-off-by: Evan Owen <[email protected]>
@kainosnoema kainosnoema force-pushed the support-existing-signal branch from af9970f to 4bd2f9a Compare January 13, 2023 21:42
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.

1 participant