Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: avoid browser crashes when serializing browser logs of complex objects #2944

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devversion
Copy link
Contributor

If we are seeing too many object iterations, we know something is off. This can happen when we are seeing e.g. large linked lists where every element recursively has access to the full list again. This will not quickly yield circular early bail-outs, but instead result in the stringification to take LOTS of processing time and results in browser crashes. We should limit object iterations for this reason, and instead expect people to inspect such logs in the browser directly.

Without having looked too much into this, I believe this also is confirmed by the issue reported below; where attaching to document.body causes the crashes & CPU consumption. The DOM is basically a similarly structured object that can result in many repetitions of "linked lists" that aren't necessarily circular in the current "serialization path".

Related #2798.

…bjects

If we are seeing too many object iterations, we know something is off. This can
happen when we are seeing e.g. large linked lists where every element recursively
has access to the full list again. This will not quickly yield circular early bail-outs,
but instead result in the stringification to take LOTS of processing time and results
in browser crashes. We should limit object iterations for this reason, and instead expect
people to inspect such logs in the browser directly.

Related modernweb-dev#2798.
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.

1 participant