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

Duplicate style node added hundreds of times #790

Closed
rcmarron opened this issue Jan 6, 2022 · 3 comments · Fixed by PostHog/posthog-js#395
Closed

Duplicate style node added hundreds of times #790

rcmarron opened this issue Jan 6, 2022 · 3 comments · Fixed by PostHog/posthog-js#395

Comments

@rcmarron
Copy link

rcmarron commented Jan 6, 2022

Hey everyone,

We've been having an issue lately where style nodes get added hundreds of times to a recording, and it causes the recording to become massive.

I haven't figured out how to reliably reproduce the issue, but it happens occasionally on our web app (app.posthog.com) and on several of our customer's web apps. I can't share the entire recording because it's massive and includes PII, but here is a gist with a subset of the snapshots: https://gist.github.com/rcmarron/d473fc0e5aeae281fffd978d6cc121a6

A couple of notes/thoughts:

  • I've only seen it happen when really large nodes are added, but that's not to say it never happens with smaller nodes.
  • I'm wondering if adding nodes to the addedSet is slow/async when the node is large, so when the MutationObserver sends duplicates, they aren't properly de-duped?

Let me know if I can share any more details

Thanks!

@Yuyz0112
Copy link
Member

Thanks, for the report, going to debug this.

@rcmarron
Copy link
Author

@Yuyz0112 I think I have a consistent repro for this issue.

If I use this Chrome Extension: https://help.getguru.com/en/articles/4680811-chrome-guru-browser-extension and open almost any website and run rr-web on it, it happens.

If you look at the full snapshots that are produced, you should see lots of duplicated large style nodes that start with the class name .SigninBlurb.

Thanks, and let me know if I can provide any more details or help at all.

@rcmarron
Copy link
Author

Looks like this commit fixed this: #866 🎉

Closing this issue

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 a pull request may close this issue.

2 participants