Skip to content

ref: Rework DOM Breadcrumbs integration #3208

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

Merged
merged 5 commits into from
Jan 29, 2021
Merged

Conversation

kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Jan 27, 2021

Added appropriate tests and verified them on BrowserStack.

Fixes #2197
Fixes #2125
Possibly Fixes #2074

==============================

The previous implementation was faulty, as it instantly triggered a handler during listener registration, not when it was actually called in the future. This caused some breadcrumbs to be captured despite no user action having been performed.

Instead of wrapping the listener provided by the user, we register our own listener on a given element for the same event type and use it as the mechanism for triggering the instrumentation handler.

We always register only one instrumentation listener and keep track of how many listeners are attached overall with refCount. When removing custom listeners, we only detach instrumentation once all references are gone. This way we don't store unnecessary data in the memory once it's not necessary.

@kamilogorek kamilogorek requested a review from a team January 27, 2021 15:02
@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 20.36 KB (0%)
@sentry/browser - Webpack 21.21 KB (0%)
@sentry/react - Webpack 21.24 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 27.72 KB (0%)

@lobsterkatie
Copy link
Member

This looks great! (Sorry, I should have added all of my suggestions as comments under a single review, so you'd see this first.)

Other than the stuff above (which is mostly only word-smithing and clarification of comments), my only feedback is that, like we talked about in our retro, it'd be great to have a few sentences in the PR description summarizing the overall problem this fixes and how the changes here solve it.

Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants