-
Notifications
You must be signed in to change notification settings - Fork 80
Loops / infinite recursion #6
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
Comments
I am looking for a solution that will not decrease performance or increase size much, but it might take a bit to figure something out. If you have any good ideas on how to do this, feel free to submit a PR. |
Perhaps this could be of help https://javascript.plainenglish.io/cycle-detection-in-javascrip-5173792a1ded |
Thanks! However, the problem is those algorithms take up more space, and, more importantly, they would significantly decrease performance for objects. Currently, this probably will not be solved, although I might eventually make an extension to the core library for checking for circular references. |
Ha! That's a bad decision. Who cares about speed if using your library could potentially hang MY application? This will bite some people, I can guarantee it. |
Generally, you should avoid practices that could cause circular references as it is. However, if you cannot do that, you can implement circular reference checking before diffing the object. |
Ok, whatever 🤷♂️ |
@infostreams First of all, sorry for not finding a solution earlier. |
Awesome! Sorry for having been an ass about this, I could have done that better. Thanks for taking it seriously! |
It is not your fault, I was making this lower priority than it should have been, and I did not think of a solution that I should have thought of before. |
If you try to diff structures that have a loop in it, your diff algorithm will hang and enter infinite recursion and therefore exhaust system resources until the tab or the process hangs.
The text was updated successfully, but these errors were encountered: