Skip to content

Commit 4f1defc

Browse files
committed
fix: ensure signal write invalidation within effects is persistent
1 parent d7b5080 commit 4f1defc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/svelte/src/internal/client/reactivity/sources.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { DEV } from 'esm-env';
33
import {
44
component_context,
55
active_reaction,
6-
new_deps,
76
active_effect,
87
untracked_writes,
98
get,
@@ -194,7 +193,6 @@ export function internal_set(source, value) {
194193
(active_effect.f & CLEAN) !== 0 &&
195194
(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0
196195
) {
197-
198196
if (untracked_writes === null) {
199197
set_untracked_writes([source]);
200198
} else {

packages/svelte/src/internal/client/runtime.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,12 @@ export function update_reaction(reaction) {
464464

465465
// If we're inside an effect and we have untracked writes, then we need to
466466
// ensure that if any of those untracked writes result in re-invalidation
467-
// of the current effect, then we need to re-schedule the current effect
468-
if (untracked_writes !== null && (reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0) {
467+
// of the current effect, then that happens accordingly
468+
if (
469+
is_runes() &&
470+
untracked_writes !== null &&
471+
(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0
472+
) {
469473
for (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {
470474
schedule_possible_effect_self_invalidation(
471475
untracked_writes[i],

0 commit comments

Comments
 (0)