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

(core) - Fix ssrExchange.restoreData adding invalidated results #1776

Merged
merged 3 commits into from
Jul 6, 2021

Conversation

kitten
Copy link
Member

@kitten kitten commented Jul 6, 2021

Related #1775
Resolve #1771

Summary

Prevent ssrExchange().restoreData() from adding results to the exchange that have already been invalidated. This may happen when restoreData() is called repeatedly, e.g. per page. When a prior run has already invalidated an SSR result then the result is 'migrated' to the user's cacheExchange, which means that restoreData() should never attempt to re-add it again.

Set of changes

  • Invalidate results in ssrExchange with null rather than delete
  • Use null entries to prevent overwriting invalidated results

@changeset-bot
Copy link

changeset-bot bot commented Jul 6, 2021

🦋 Changeset detected

Latest commit: 867f423

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

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 force-pushed the fix/repeated-restore-ssr branch from 88638de to 867f423 Compare July 6, 2021 14:30
@kitten kitten merged commit 3547491 into main Jul 6, 2021
@kitten kitten deleted the fix/repeated-restore-ssr branch July 6, 2021 14:33
@urql-ci urql-ci mentioned this pull request Jul 6, 2021
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