-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ref(utils): Add logic to enable skipping of normalization #5052
Conversation
size-limit report 📦
|
packages/utils/src/normalize.ts
Outdated
// We're also done if we've reached the max depth | ||
if (depth === 0) { | ||
// At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. | ||
return stringified.replace('object ', ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we move this below the memoize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought there was a case where we need to move the memoize
call to avoid circular references with objects for which we skip normalization. Your comment made me think about it again and
a) I think there is actually no such case
b) if there were such a case, moving it is pointless because skipping normalization is already "dangerous" in that regard.
Anyways, moved it back, thanks ^^ -> 77e3096
fb17f47
to
77e3096
Compare
Implements logic that allows us to skip normalization of objects by marking them with a
__sentry_skip_normalization__
property.We will use this in an upcoming PR to fix behaviour in the
ExtraErrorData
integration: #5053Ref: https://getsentry.atlassian.net/browse/WEB-600