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

(next) - fix issue with next where staleWhileRevalidate would loop #1895

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

JoviDeCroock
Copy link
Collaborator

Summary

Relates to #1888

When next resolves getStaticProps we rely on the props.urqlState to be hydrated during the renderToString this ensures that we actually use the data from this call on the server. The issue presents itself when we are in a renderToString pass and the exchange opts to mark the result as stale and perform a reexecute.

Set of changes

  • avoid data being reexecuted due to staleWhileRevalidate on the server

@changeset-bot
Copy link

changeset-bot bot commented Aug 27, 2021

🦋 Changeset detected

Latest commit: 76dc5f0

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

This PR includes changesets to release 1 package
Name Type
next-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

@JoviDeCroock JoviDeCroock merged commit 3eaed7e into main Aug 27, 2021
@JoviDeCroock JoviDeCroock deleted the next-issue branch August 27, 2021 11:44
@urql-ci urql-ci mentioned this pull request Aug 27, 2021
@SteveMelons
Copy link

It seems like this issue was not resolved. I updated to v3.2.1. When setting staleWhileRevalidate to true, the page freezes on load and becomes unresponsive while using up 100% CPU.

@field123
Copy link

Have the same issue as @SteveMelons unresponsive page after a few seconds with staleWhileRevalidate set to true. v3.2.1

@JoviDeCroock
Copy link
Collaborator Author

@SteveMelons @field123 there was an oversight here #1944 will be fixing this, thank you for the ping 🙌

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.

4 participants