Skip to content

fix(replay): Ensure we normalize scope breadcrumbs to max. depth to avoid circular ref #7915

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 2 commits into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/replay/src/coreHandlers/util/addBreadcrumbEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcru
timestamp: (breadcrumb.timestamp || 0) * 1000,
data: {
tag: 'breadcrumb',
payload: normalize(breadcrumb),
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use the normalizeDepth client option and set the max breadth to smth like 1_000 - which I find a sane number that will prevent an insane amount of data from being generated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I think we may want to have a dedicated setting for the depth here eventually, as we may not need as much depth here as in other places, for example. But a good point, will think about it. Will also add 1_000 as max properties, sounds like a good additional check!

// normalize to max. 10 depth and 1_000 properties per object
payload: normalize(breadcrumb, 10, 1_000),
},
});

Expand Down