From a3702e8171cea441dfd1b2613f7aaeabc3fc2b24 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Sat, 11 May 2024 20:21:51 +0100 Subject: [PATCH] fix: adjust heuristics for effect_update_depth_exceeded (#11558) * fix: adjust heuristics for effect_update_depth_exceeded * fix: adjust heuristics for effect_update_depth_exceeded * fix: further adjust heuristics for effect_update_depth_exceeded --- .changeset/grumpy-avocados-fetch.md | 5 +++++ packages/svelte/src/internal/client/runtime.js | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/grumpy-avocados-fetch.md diff --git a/.changeset/grumpy-avocados-fetch.md b/.changeset/grumpy-avocados-fetch.md new file mode 100644 index 0000000000..8c1dcf5bed --- /dev/null +++ b/.changeset/grumpy-avocados-fetch.md @@ -0,0 +1,5 @@ +--- +"svelte": patch +--- + +fix: further adjust heuristics for effect_update_depth_exceeded diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index e29a1e3b44..9b311dccbb 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -515,6 +515,7 @@ function infinite_loop_guard() { * @returns {void} */ function flush_queued_root_effects(root_effects) { + infinite_loop_guard(); for (var i = 0; i < root_effects.length; i++) { var signal = root_effects[i]; flush_nested_effects(signal, RENDER_EFFECT | EFFECT); @@ -701,6 +702,7 @@ function flush_nested_effects(effect, filter_flags, shallow = false) { * @returns {void} */ export function flush_local_render_effects(effect) { + infinite_loop_guard(); // We are entering a new flush sequence, so ensure counter is reset. flush_count = 0; flush_nested_effects(effect, RENDER_EFFECT, true);