From 38bd3f2536acccaf5af497a539d4103bee2f4bd0 Mon Sep 17 00:00:00 2001 From: Edward Gou Date: Fri, 16 Feb 2024 16:46:08 -0500 Subject: [PATCH] Fixes latest route name and source not updating correctly --- .../src/browser/browserTracingIntegration.ts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/tracing-internal/src/browser/browserTracingIntegration.ts b/packages/tracing-internal/src/browser/browserTracingIntegration.ts index b27575e147cf..787ec09af256 100644 --- a/packages/tracing-internal/src/browser/browserTracingIntegration.ts +++ b/packages/tracing-internal/src/browser/browserTracingIntegration.ts @@ -188,8 +188,10 @@ export const browserTracingIntegration = ((_options: Partial { @@ -470,7 +471,7 @@ function registerInteractionListener( inflightInteractionTransaction = undefined; } - if (!latestRouteName) { + if (!latestRoute.name) { DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`); return undefined; } @@ -478,11 +479,11 @@ function registerInteractionListener( const { location } = WINDOW; const context: TransactionContext = { - name: latestRouteName, + name: latestRoute.name, op, trimEnd: true, data: { - [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRouteSource || 'url', + [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || 'url', }, };