8000 ref(core): Log `normalizeDepth` type when normalization is skipped (#… · MShineRay/sentry-javascript@0a985ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a985ce

Browse files
authored
ref(core): Log normalizeDepth type when normalization is skipped (getsentry#4870)
This is a follow up to getsentry#4425 and getsentry#4574, all in aid of debugging getsentry#2809, wherein serializing events leads to a circular reference error. One of the possible culprits is that the event is somehow skipping our usual normalization process, and one of the reasons that might happen is if `normalizeDepth` is set to something other than a number. We're already logging its value in problematic cases, and this change makes it so that we'll now log its type as well.
1 parent 57f4832 commit 0a985ce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/src/baseclient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ export abstract class BaseClient<B extends Backend, O extends Options> implement
373373
if (evt) {
374374
// TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809
375375
// it is only attached as extra data to the event if the event somehow skips being normalized
376-
evt.sdkProcessingMetadata = { ...evt.sdkProcessingMetadata, normalizeDepth: normalize(normalizeDepth) };
376+
evt.sdkProcessingMetadata = {
377+
...evt.sdkProcessingMetadata,
378+
normalizeDepth: `${normalize(normalizeDepth)} (${typeof normalizeDepth})`,
379+
};
377380
}
378381
if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
379382
return this._normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);

0 commit comments

Comments
 (0)
0