@sentry-internal/tracing
Advanced tools
Comparing version 7.102.0 to 7.102.1
@@ -67,4 +67,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
let latestRouteName; | ||
let latestRouteSource; | ||
const latestRoute = { | ||
name: undefined, | ||
source: undefined, | ||
}; | ||
@@ -115,4 +117,4 @@ /** Create routing idle transaction. */ | ||
latestRouteName = finalContext.name; | ||
latestRouteSource = getSource(finalContext); | ||
latestRoute.name = finalContext.name; | ||
latestRoute.source = getSource(finalContext); | ||
@@ -138,3 +140,3 @@ if (finalContext.sampled === false) { | ||
if (isPageloadTransaction) { | ||
if (isPageloadTransaction && types.WINDOW.document) { | ||
types.WINDOW.document.addEventListener('readystatechange', () => { | ||
@@ -189,3 +191,3 @@ if (['interactive', 'complete'].includes(types.WINDOW.document.readyState)) { | ||
let activeSpan; | ||
let startingUrl = types.WINDOW.location.href; | ||
let startingUrl = types.WINDOW.location && types.WINDOW.location.href; | ||
@@ -218,3 +220,3 @@ if (client.on) { | ||
if (options.instrumentPageLoad && client.emit) { | ||
if (options.instrumentPageLoad && client.emit && types.WINDOW.location) { | ||
const context = { | ||
@@ -232,3 +234,3 @@ name: types.WINDOW.location.pathname, | ||
if (options.instrumentNavigation && client.emit) { | ||
if (options.instrumentNavigation && client.emit && types.WINDOW.location) { | ||
utils.addHistoryInstrumentationHandler(({ to, from }) => { | ||
@@ -269,3 +271,3 @@ /** | ||
if (_experiments.enableInteractions) { | ||
registerInteractionListener(options, latestRouteName, latestRouteSource); | ||
registerInteractionListener(options, latestRoute); | ||
} | ||
@@ -332,4 +334,3 @@ | ||
options, | ||
latestRouteName, | ||
latestRouteSource, | ||
latestRoute, | ||
) { | ||
@@ -357,3 +358,3 @@ let inflightInteractionTransaction; | ||
if (!latestRouteName) { | ||
if (!latestRoute.name) { | ||
debugBuild.DEBUG_BUILD && utils.logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`); | ||
@@ -366,7 +367,7 @@ return undefined; | ||
const context = { | ||
name: latestRouteName, | ||
name: latestRoute.name, | ||
op, | ||
trimEnd: true, | ||
data: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRouteSource || 'url', | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || 'url', | ||
}, | ||
@@ -373,0 +374,0 @@ }; |
@@ -65,4 +65,6 @@ import { TRACING_DEFAULTS, addTracingExtensions, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, getActiveSpan, getCurrentHub, startIdleTransaction, getActiveTransaction } from '@sentry/core'; | ||
let latestRouteName; | ||
let latestRouteSource; | ||
const latestRoute = { | ||
name: undefined, | ||
source: undefined, | ||
}; | ||
@@ -113,4 +115,4 @@ /** Create routing idle transaction. */ | ||
latestRouteName = finalContext.name; | ||
latestRouteSource = getSource(finalContext); | ||
latestRoute.name = finalContext.name; | ||
latestRoute.source = getSource(finalContext); | ||
@@ -136,3 +138,3 @@ if (finalContext.sampled === false) { | ||
if (isPageloadTransaction) { | ||
if (isPageloadTransaction && WINDOW.document) { | ||
WINDOW.document.addEventListener('readystatechange', () => { | ||
@@ -187,3 +189,3 @@ if (['interactive', 'complete'].includes(WINDOW.document.readyState)) { | ||
let activeSpan; | ||
let startingUrl = WINDOW.location.href; | ||
let startingUrl = WINDOW.location && WINDOW.location.href; | ||
@@ -216,3 +218,3 @@ if (client.on) { | ||
if (options.instrumentPageLoad && client.emit) { | ||
if (options.instrumentPageLoad && client.emit && WINDOW.location) { | ||
const context = { | ||
@@ -230,3 +232,3 @@ name: WINDOW.location.pathname, | ||
if (options.instrumentNavigation && client.emit) { | ||
if (options.instrumentNavigation && client.emit && WINDOW.location) { | ||
addHistoryInstrumentationHandler(({ to, from }) => { | ||
@@ -267,3 +269,3 @@ /** | ||
if (_experiments.enableInteractions) { | ||
registerInteractionListener(options, latestRouteName, latestRouteSource); | ||
registerInteractionListener(options, latestRoute); | ||
} | ||
@@ -330,4 +332,3 @@ | ||
options, | ||
latestRouteName, | ||
latestRouteSource, | ||
latestRoute, | ||
) { | ||
@@ -355,3 +356,3 @@ let inflightInteractionTransaction; | ||
if (!latestRouteName) { | ||
if (!latestRoute.name) { | ||
DEBUG_BUILD && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`); | ||
@@ -364,7 +365,7 @@ return undefined; | ||
const context = { | ||
name: latestRouteName, | ||
name: latestRoute.name, | ||
op, | ||
trimEnd: true, | ||
data: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRouteSource || 'url', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || 'url', | ||
}, | ||
@@ -371,0 +372,0 @@ }; |
{ | ||
"name": "@sentry-internal/tracing", | ||
"version": "7.102.0", | ||
"version": "7.102.1", | ||
"description": "Sentry Internal Tracing Package", | ||
@@ -32,5 +32,5 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/core": "7.102.0", | ||
"@sentry/types": "7.102.0", | ||
"@sentry/utils": "7.102.0" | ||
"@sentry/core": "7.102.1", | ||
"@sentry/types": "7.102.1", | ||
"@sentry/utils": "7.102.1" | ||
}, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1204516
10243
+ Added@sentry/core@7.102.1(transitive)
+ Added@sentry/types@7.102.1(transitive)
+ Added@sentry/utils@7.102.1(transitive)
- Removed@sentry/core@7.102.0(transitive)
- Removed@sentry/types@7.102.0(transitive)
- Removed@sentry/utils@7.102.0(transitive)
Updated@sentry/core@7.102.1
Updated@sentry/types@7.102.1
Updated@sentry/utils@7.102.1