Skip to content

addBreadcrumb needs a defined depth for serialization #2311

@codeocelot

Description

@codeocelot

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.8.0

Description

Serializing a large object with addBreadcrumb can immobilize an application very quickly. Demonstration . Here I'm just using React to create me a fairly large component tree and getting Sentry to serialize it via addBreadcrumb. The result is a quasi-infinite loop where the app becomes completely unusable for as long as I've cared to stare at a blank screen.

The fix is pretty straightforward. When addBreadcrumb calls normalize, simply pass in a reasonable depth parameter. The docs do say that the breadcrumb fields should all be strings (data being a map of strings) so I don't feel this should constrain user expectations and the benefits of avoiding locking the application are a noble reason to add this limitation.

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