From 326f52aa7f18b169b7cad945dfac5f6c94a947e0 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 11 Apr 2024 11:24:12 +0200 Subject: [PATCH] fix(tracing): Fixes latest route name and source not updating correctly (#11533) Forward port of https://github.com/getsentry/sentry-javascript/pull/10702 --- .../src/browser/browserTracingIntegration.ts | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/browser-utils/src/browser/browserTracingIntegration.ts b/packages/browser-utils/src/browser/browserTracingIntegration.ts index 02ea72497a3d..c0a786b600f9 100644 --- a/packages/browser-utils/src/browser/browserTracingIntegration.ts +++ b/packages/browser-utils/src/browser/browserTracingIntegration.ts @@ -169,8 +169,10 @@ export const browserTracingIntegration = ((_options: Partial { @@ -429,17 +430,17 @@ function registerInteractionListener( inflightInteractionSpan = undefined; } - if (!latestRouteName) { + if (!latestRoute.name) { DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`); return undefined; } inflightInteractionSpan = startIdleSpan( { - name: latestRouteName, + name: latestRoute.name, op, attributes: { - [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRouteSource || 'url', + [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || 'url', }, }, {