Skip to content

fix: adjust heuristics for effect_update_depth_exceeded #11558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/famous-kiwis-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"svelte": patch
---

fix: adjust heuristics for effect_update_depth_exceeded
5 changes: 5 additions & 0 deletions .changeset/grumpy-avocados-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"svelte": patch
---

fix: further adjust heuristics for effect_update_depth_exceeded
3 changes: 2 additions & 1 deletion packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -529,7 +530,6 @@ function flush_queued_effects(effects) {
var length = effects.length;
if (length === 0) return;

infinite_loop_guard();
for (var i = 0; i < length; i++) {
var effect = effects[i];

Expand Down Expand Up @@ -701,6 +701,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);
Expand Down