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

fix(core): Fix immediate cancellation of fetch requests #3076

Merged
merged 2 commits into from
Mar 17, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 17, 2023

Follow-up to #3043

Summary

The async generator implementation has regressed on the previous one since it doesn't include a delay that respects immediate teardown signals. This is because no yield was present after the initial microtick and before the fetch call.

I'm still trying to find a more elegant solution to this, but it doesn't seem possible to yield without emitting a value, and async generators may not abort on await statements, which seems counterintuitive.

Changeset hasn't been added since it's a follow-up fix.

Set of changes

  • Add yield after microtick delay to allow fetchOperation to abort early
  • Update tests to correctly detect missing early-terminations

@kitten kitten requested a review from JoviDeCroock March 17, 2023 16:34
@kitten kitten merged commit 8b1d164 into main Mar 17, 2023
@kitten kitten deleted the fix/core-cancellation branch March 17, 2023 17:56
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.

2 participants