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) - invalidate null link #694

Merged
merged 5 commits into from
Apr 12, 2020
Merged

(fix) - invalidate null link #694

merged 5 commits into from
Apr 12, 2020

Conversation

JoviDeCroock
Copy link
Collaborator

@JoviDeCroock JoviDeCroock commented Apr 12, 2020

Summary

There was an issue in invalidation when a link was null, this lead to the cache invalidating a record instead of the link since we were checking for a truthy value rather than just undefined.

Fixes: #693

Set of changes

  • Change link check to !== undefined so we account for null

@JoviDeCroock JoviDeCroock requested a review from kitten April 12, 2020 19:40
@changeset-bot
Copy link

changeset-bot bot commented Apr 12, 2020

🦋 Changeset is good to go

Latest commit: c8b6a68

We got this.

This PR includes changesets to release 1 package
Name Type
@urql/exchange-graphcache 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

ole.log(entity); Outdated Show resolved Hide resolved
@@ -18,7 +18,7 @@ export const invalidateEntity = (

for (let i = 0, l = fields.length; i < l; i++) {
const { fieldKey } = fields[i];
if (InMemoryData.readLink(entityKey, fieldKey)) {
if (InMemoryData.readLink(entityKey, fieldKey) !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

Oops 😅

@kitten kitten merged commit f232ca1 into master Apr 12, 2020
@kitten kitten deleted the fix-null-invalidation branch April 12, 2020 21:40
@olistic
Copy link
Contributor

olistic commented Apr 14, 2020

Thanks for the expedition here! Is there any chance of releasing a patch with this?

@kitten
Copy link
Member

kitten commented Apr 14, 2020

@olistic I’ll get to releasing this tomorrow 👍 in the meantime you should be able to test this using CodeSandbox CI which publishes temporary packages per PR

@olistic
Copy link
Contributor

olistic commented Apr 14, 2020

Thank you @kitten, this is a great tip! 🚀

@kitten
Copy link
Member

kitten commented Apr 16, 2020

@olistic this has now been released 🌟

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.

Unable to invalidate null Connection type
3 participants