Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ export class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpIns
// eslint-disable-next-line @typescript-eslint/no-this-alias
const instrumentation = this;

// @ts-expect-error: FinalizationRegistry is not yet in the Node types
const finalizationRegistry = new FinalizationRegistry((isolationScope: Scope) => {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to tryCatch this for legacy browsers?

isolationScope.setSDKProcessingMetadata({ normalizedRequest: undefined });
});

return (
original: (event: string, ...args: unknown[]) => boolean,
): ((this: unknown, event: string, ...args: unknown[]) => boolean) => {
Expand Down Expand Up @@ -183,6 +188,9 @@ export class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpIns
});
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
finalizationRegistry.register(response, isolationScope);

return withIsolationScope(isolationScope, () => {
return withScope(scope => {
// Set a new propagationSpanId for this request
Expand Down
Loading