File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte ' : patch
3+ ---
4+
5+ fix: ensure unowned deriveds correctly get re-linked to the graph
Original file line number Diff line number Diff line change @@ -205,10 +205,12 @@ export function check_dirtiness(reaction) {
205205 reaction . f ^= DISCONNECTED ;
206206 }
207207
208+ var dirty = false ;
209+
208210 for ( i = 0 ; i < dependencies . length ; i ++ ) {
209211 var dependency = dependencies [ i ] ;
210212
211- if ( check_dirtiness ( /** @type {Derived } */ ( dependency ) ) ) {
213+ if ( ! dirty && check_dirtiness ( /** @type {Derived } */ ( dependency ) ) ) {
212214 update_derived ( /** @type {Derived } */ ( dependency ) ) ;
213215 }
214216
@@ -225,9 +227,15 @@ export function check_dirtiness(reaction) {
225227 }
226228
227229 if ( dependency . version > reaction . version ) {
228- return true ;
230+ // We can't just return here as we might have other dependencies that are unowned
231+ // ad need to be linked to the reaction again
232+ dirty = true ;
229233 }
230234 }
235+
236+ if ( dirty ) {
237+ return true ;
238+ }
231239 }
232240
233241 // Unowned signals should never be marked as clean unless they
You can’t perform that action at this time.
0 commit comments