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 commutative squashing failing when lowest layer resolved earlier than others #587

Merged
merged 6 commits into from Mar 8, 2020

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 8, 2020

The commutative squashing would previously only start when
the lowest commutative layer (the first one) was written.
This ignored the case however of when this layer has already
been written. When this was the case the stopping condition
was unreachable and commutative layers were never squashed.

The change is to continuously squash the commutative layers
with the least priorities as they're written.

This change also gets rid of the temporary squash queue,
which ends up making it a rather nice implementation.

Resolve #574

The commutative squashing would previously only start when
the lowest commutative layer (the first one) was written.
This ignored the case however of when this layer has already
been written. When this was the case the stopping condition
was unreachable and commutative layers were never squashed.

The change is to continuously squash the commutative layers
with the least priorities as they're written.

This change also gets rid of the temporary `squash` queue,
which ends up making it a rather nice implementation.
@changeset-bot
Copy link

changeset-bot bot commented Mar 8, 2020

🦋 Changeset is good to go

Latest commit: db3dbca

We got this.

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

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.

Losing the temp queue is pretty good (a fix that reduces complexity 🎉 )

exchanges/graphcache/src/store/data.ts Outdated Show resolved Hide resolved
@kitten kitten merged commit 687e375 into master Mar 8, 2020
@kitten kitten deleted the fix/commutative-squashing branch March 8, 2020 22:57
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.

cache.writeFragment does not rerender component
2 participants