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

(react) - Fix client-side Suspense update edge-case #1157

Merged
merged 3 commits into from
Nov 16, 2020

Conversation

kitten
Copy link
Member

@kitten kitten commented Nov 16, 2020

Fix #1150

Summary

We encountered another edge-case in client-side React Suspense, which is caused by React handling suspense-on-updates differently than suspense-on-mount. We basically have to be more sensible with state on suspense-on-update because React doesn't clear any state when we suspend during an update.

This can be tested against this reproduction sandbox: https://codesandbox.io/s/ecstatic-ritchie-lzxvl (See CodeSandbox CI output)

Set of changes

  • Use the latest known input in useSource when subscribing

@changeset-bot
Copy link

changeset-bot bot commented Nov 16, 2020

🦋 Changeset detected

Latest commit: 8e93fa1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
urql 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 marked this pull request as draft November 16, 2020 12:41
@kitten kitten marked this pull request as ready for review November 16, 2020 15:02
Copy link
Collaborator

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@kitten kitten merged commit 6ccf879 into main Nov 16, 2020
@kitten kitten deleted the fix/suspense-sync-update branch November 16, 2020 15:11
@github-actions github-actions bot mentioned this pull request Nov 16, 2020
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.

useQuery not re requesting if variables changes while request is already sent
2 participants