mirror of https://github.com/sveltejs/svelte
fix: prevent untracked derived reads from retaining dependencies (#18829)
Fixes https://github.com/sveltejs/svelte/issues/18827. A disconnected derived re-evaluated through `untrack` inside an effect could connect descendant deriveds because `is_updating_effect` was true, even though the active derived reader was not connected. Those descendants registered on long-lived dependencies without gaining a reaction that could later trigger their disconnect cascade. This changes `get()` to connect a derived only when its active reader is itself `CONNECTED`. Effects already carry that flag, and deriveds reached through connected readers receive it before evaluation, so tracked behavior remains intact. The now-unused `is_updating_effect` state is removed.pull/18871/merge
parent
a956c2bd1f
commit
f908535659
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: prevent untracked derived reads from retaining disconnected dependencies
|
||||
Loading…
Reference in new issue