Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-fans-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: ensure resuming effects works correctly with unowned dependencies
16 changes: 12 additions & 4 deletions packages/svelte/src/internal/client/reactivity/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,18 @@ function resume_children(effect, local) {
}

// If a dependency of this effect changed while it was paused,
// schedule the effect to update
if (check_dirtiness(effect)) {
set_signal_status(effect, DIRTY);
schedule_effect(effect);
// schedule the effect to update and ensure we set the effect
// to be the active reaction to ensure that unowned deriveds
// are correctly tracked because we're resuming the effect
var previous_reaction = active_reaction;
try {
set_active_reaction(effect);
if (check_dirtiness(effect)) {
set_signal_status(effect, DIRTY);
schedule_effect(effect);
}
} finally {
set_active_reaction(previous_reaction);
}

var child = effect.first;
Expand Down