fix: make effectScope participate in propagation#111
Merged
Conversation
Signals and computeds could link to different nodes when called in the same effectScope. Signals walked up the sub chain to find a Mutable node (the parent effect), while computeds linked directly to the inert scope (flags=None). This meant the parent effect could not respond to computed changes through the scope. Fix by giving effectScope the Mutable flag so it participates in dirty propagation, removing the signal walk-up (both signal and computed now link to activeSub directly), and handling scope nodes in the update callback.
littensy
added a commit
to littensy/reactivity
that referenced
this pull request
May 12, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #105 — signals and computeds linked to different nodes when called in the same effectScope.
Root cause: Signals walked up the
sub.subs?.subchain to find a node withMutable|Watchingflags (the parent effect), bypassing inert scope nodes (flags=None). Computeds linked directly toactiveSub(the scope). This inconsistency meant the parent effect could respond to signal changes but not computed changes through the scope.Fix (3 changes):
effectScopetheMutableflag so it participates in dirty propagationactiveSubdirectlyupdatecallback (clear flags, returntrue)Test plan
tests/issue_105.spec.tscovering: