From a88dded6e2c17c25f6a3a805ae37d9119818ede2 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 6 Jan 2026 11:42:55 +0000 Subject: [PATCH] add comment and note-to-self --- .../svelte/src/internal/client/reactivity/batch.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index 8aa6875a20..0a33a4af26 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -397,13 +397,13 @@ export class Batch { continue; } - for (const e of this.#dirty_effects) { - batch.#dirty_effects.add(e); - } - - for (const e of this.#maybe_dirty_effects) { - batch.#maybe_dirty_effects.add(e); - } + // in rare cases, effects inside a still-pending boundary might be left + // unflushed when a batch is committed. to ensure that they run, we add + // them to other batches. + // TODO it would be better if the effects were associated with the + // boundary instead, and rescheduled when the boundary resolves + for (const e of this.#dirty_effects) batch.#dirty_effects.add(e); + for (const e of this.#maybe_dirty_effects) batch.#maybe_dirty_effects.add(e); /** @type {Source[]} */ const sources = [];