Skip to content

@sentry/browser - Breadcrumbs Integration click handler falsely implemented? #2125

@sod

Description

@sod

Package + Version

  • @sentry/browser

Version:

5.4.1

Description

I currently investigate why our page is slow and found a lot of clearTimeout, setTimeout calls.

There is some pretty weired behavior regarding @sentry/browser and I'm not really sure if this is supposed to be:

Reproduction, just go on any page that has @sentry/browser installed and type in the console:

debugger; document.body.addEventListener('click', () => 1)

Then watch in the debugger what sentry does. It invokes the breadcrumbEventHandler in

https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/breadcrumbs.ts#L163-L165

And then immediately invokes it with the element itself:

image

image

This doesn't seem right? Shouldn't this method be called on click and not immediately?

On a page of ours we register ~120 click handler, so this methods debounce is constantly calling setTimeout/clearTimout (that is again shimmed by sentry itself + in our case zone.js/angular) so the call stack and overhead is kinda huge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions