@@ -73,33 +73,12 @@ export function createEventEnvelope(
7373 const { transactionSampling } = event . sdkProcessingMetadata || { } ;
7474 const { method : samplingMethod , rate : sampleRate } = transactionSampling || { } ;
7575
76- // TODO: Below is a temporary hack in order to debug a serialization error - see
77- // https://github.com/getsentry/sentry-javascript/issues/2809,
78- // https://github.com/getsentry/sentry-javascript/pull/4425, and
79- // https://github.com/getsentry/sentry-javascript/pull/4574.
80- //
81- // TL; DR: even though we normalize all events (which should prevent this), something is causing `JSON.stringify` to
82- // throw a circular reference error.
83- //
84- // When it's time to remove it:
85- // 1. Delete everything between here and where the request object `req` is created, EXCEPT the line deleting
86- // `sdkProcessingMetadata`
87- // 2. Restore the original version of the request body, which is commented out
88- // 3. Search for either of the PR URLs above and pull out the companion hacks in the browser playwright tests and the
89- // baseClient tests in this package
9076 enhanceEventWithSdkInfo ( event , metadata && metadata . sdk ) ;
91- event . tags = event . tags || { } ;
92- event . extra = event . extra || { } ;
9377
94- // In theory, all events should be marked as having gone through normalization and so
95- // we should never set this tag/extra data
96- if ( ! ( event . sdkProcessingMetadata && event . sdkProcessingMetadata . baseClientNormalized ) ) {
97- event . tags . skippedNormalization = true ;
98- event . extra . normalizeDepth = event . sdkProcessingMetadata ? event . sdkProcessingMetadata . normalizeDepth : 'unset' ;
99- }
100-
101- // prevent this data from being sent to sentry
102- // TODO: This is NOT part of the hack - DO NOT DELETE
78+ // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to
79+ // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may
80+ // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid
81+ // of this `delete`, lest we miss putting it back in the next time the property is in use.)
10382 delete event . sdkProcessingMetadata ;
10483
10584 const envelopeHeaders = createEventEnvelopeHeaders ( event , sdkInfo , tunnel , dsn ) ;
0 commit comments