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 operation queue to only affect reexecuteOperation #662

Merged
merged 2 commits into from
Mar 24, 2020

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 24, 2020

Fix #661

Previously any call that dispatches an operation could
lead to a queued dispatch, which stops peeking from working
since the effect (exchange pipeline) isn't actually executed
on the spot. In such a case the queue is flushed later which
can lead to undefined behaviour, e.g. looping onOperationEnd,
which means that we think a query is active while it's not.

Instead we want to apply the operation queuing only to
client.reexecuteOperation, which is what's called from inside
exchanges.

The new behaviour: We now queue up operations from
reexecuteOperation when we're currently dispatching another
operation. Otherwise every operation executes immediately.

Previously any call that dispatches an operation could
lead to a queued dispatch, which stops peeking from working
since the effect (exchange pipeline) isn't actually executed
on the spot. In such a case the queue is flushed later which
can lead to undefined behaviour, e.g. looping onOperationEnd,
which means that we think a query is active while it's not.

Instead we want to apply the operation queuing only to
client.reexecuteOperation, which is what's called from inside
exchanges.

The new behaviour: We now queue up operations from
reexecuteOperation when we're currently dispatching another
operation. Otherwise every operation executes immediately.
@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2020

🦋 Changeset is good to go

Latest commit: a4ed327

We got this.

This PR includes changesets to release 1 package
Name Type
@urql/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kitten kitten merged commit 7351407 into master Mar 24, 2020
@kitten kitten deleted the fix/queuing-behaviour branch March 24, 2020 14:23
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.

Fix active teardowns stopping queries from working
2 participants