-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: increment derived versions when updating #12047
Conversation
🦋 Changeset detectedLatest commit: 2a9da58 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@@ -257,9 +264,10 @@ export function check_dirtiness(reaction) { | |||
// In thise case, we need to re-attach it to the graph and mark it dirty if any of its dependencies have | |||
// changed since. | |||
if (version > /** @type {import('#client').Derived} */ (reaction).version) { | |||
/** @type {import('#client').Derived} */ (reaction).version = version; | |||
/** @type {import('#client').Derived} */ (reaction).version = increment_version(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you incrementing here? You should be matching the value otherwise you might cause additional invalidations that aren’t necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think it would cause unnecessary invalidations. but yeah, we actually only need to increment in two places — in set
and update_derived
This is an alternative to #12016 that I think is slightly simpler. AFAICT all we need to do is ensure that if a derived
a
depends on another derivedb
, anda
is reconnecting to the dependency graph, that ifb
was updated more recently thana
,a
also updates.Fixes #11988
Fixes #12044
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint