forked from rrweb-io/rrweb
-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Detect huge MutationObserver triggers #55
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: 500 is completely arbitrary here as of now. We've seen issues with this being > 2000, but hard to say what makes most sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we could add this as a config option to
recordI guess 🤔 It's really hard to test this though, I tried with a custom app that adds 2k items at once and it seemed to handle it fine, so you really need something where a lot is going on, apparently, or goes on in a specific way.What about: We start creating a breadcrumb (type other) for this when we discover "a lot" of records, e.g.:
Something along these lines...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about: We set it to 1000 for the time being and add an
_experimentsoption in theReplayoptions to configure the value. Then we go back to getsentry/sentry-javascript#6946 and asks folks to play around with the number if the default doesn't work for them. If we get to a number that works for most people, we can still remove the experiments option or promote it to an actual option if otherwise necessary.I like the emit-breadcrumb approach as it would at least let us know in the SDK that this happened and we could still decide on how we handle it. Client reports would be great ... if we could actually use them for something else than dropped events, which right now we can't 😅.
The other option would be
event.contexts.replaybut we still don't have a way to query that data properly other than looking at individual events. This might be fine though if there's a way to look at replay events from a customer's replay.Regardless, a console logger output would definitely be the first step so that we could ask users to set
debug: trueand report if they see this message (including the actual number of mutations).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, a variation of this:
On the other hand, the downside is that users probably don't really know what to set this to, and may just set it to something small to get it work 🤔
Or, we allow to pass an optional function in that returns true/false, then we can write the logging code in replay (which is probably better suited for this than rrweb). I'll give it a try!