Skip to content
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

Internals: Scheduler: Fix infinite loop in flush #4316

Merged
merged 4 commits into from Jan 25, 2020
Merged

Internals: Scheduler: Fix infinite loop in flush #4316

merged 4 commits into from Jan 25, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jan 24, 2020

Fixes #3218

Turns out the set added to prevent infinite loops wasn't performing as planned since it was being reset with every call to flush().

This PR moves the set outside of the function, rearranges the insertion order so that we actually catch recursion, and clears it at the end of the function.

Also added a failing test to make sure it stays fixed.

David A Kondrad and others added 4 commits January 24, 2020 17:20
This test shows how onMount is called repeatedly when creating a component dynamically.
The loop counter is totally arbitrary and is there to prevent a hard-crash in the CI.
The set that was added to block infinite loops wasn't actually doing anything.
Lift the declaration outside of the function and clear it at the end.
@Conduitry Conduitry merged commit 8e245dc into sveltejs:master Jan 25, 2020
@ghost ghost deleted the issue/gh-4315 branch January 29, 2020 21:03
jesseskinner pushed a commit to jesseskinner/svelte that referenced this pull request Feb 27, 2020
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Maximum call stack size exceeded"
1 participant