Skip to content

Commit

Permalink
fix: ensure unowned deriveds correctly get re-linked to the graph
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Dec 28, 2024
1 parent 9c5e708 commit 1e92922
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,16 @@ export function check_dirtiness(reaction) {
// If we are working with an unowned signal as part of an effect (due to !skip_reaction)
// and the version hasn't changed, we still need to check that this reaction
// is linked to the dependency source – otherwise future updates will not be caught.
if (
is_unowned &&
active_effect !== null &&
!skip_reaction &&
!dependency?.reactions?.includes(reaction)
) {
(dependency.reactions ??= []).push(reaction);
if (is_unowned && active_effect !== null && !skip_reaction) {
if (!dependency?.reactions?.includes(reaction)) {
(dependency.reactions ??= []).push(reaction);
}

if (version_mismatch) {
unowned_dirty = true;
}
} else if (version_mismatch) {
return true
return true;
}
}

Expand Down

0 comments on commit 1e92922

Please sign in to comment.