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 cascading cancellations from components #503

Merged
merged 3 commits into from
Jan 11, 2020
Merged

Conversation

kitten
Copy link
Member

@kitten kitten commented Jan 11, 2020

Fix #501
Fix #502 (Needs to be verified)

Edit: The fix was confirmed by testing against CodeSandboxes in both of the above issues 👍

wonka@^4.0.0 has some improved behaviour that fixed
some edge cases and bugs. As it turned out urql was
relying on one of them.
The switchMap in the hooks would cancel the last
query and start the next. However, this cancellation
cascades not only up to executeQuery to end and
teardown the operation, it also flows up through the
exchange pipeline, ending the entire thing like an
electrical surge.

This can be prevented by publishing the results
chain and making sure it can never be interrupted.

wonka@^4.0.0 has some improved behaviour that fixed
some edge cases and bugs. As it turned out urql was
relying on one of them.
The switchMap in the hooks would cancel the last
query and start the next. However, this cancellation
cascades not only up to executeQuery to end and
teardown the operation, it also flows up through the
exchange pipeline, ending the entire thing like an
electrical surge.

This can be prevented by publishing the results
chain and making sure it can never be interrupted.
@kitten kitten merged commit 21ed773 into master Jan 11, 2020
@kitten kitten deleted the fix/cascading-end branch January 11, 2020 02:57
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.

SSR + ConcurrentMode issues in 1.8.0 fetching breaks when variables change
1 participant