File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/core/src/js/tracing Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ export const startIdleNavigationSpan = (
6161 const activeSpan = getActiveSpan ( ) ;
6262 const isActiveSpanInteraction = activeSpan && isRootSpan ( activeSpan ) && isSentryInteractionSpan ( activeSpan ) ;
6363
64+ clearActiveSpanFromScope ( getCurrentScope ( ) ) ;
65+
6466 // Don't cancel user interaction spans when starting from runApplication (app restart/reload).
6567 // This preserves the span context for error capture and replay recording.
6668 if ( isActiveSpanInteraction && isAppRestart ) {
@@ -69,17 +71,15 @@ export const startIdleNavigationSpan = (
6971 spanToJSON ( activeSpan ) . op
7072 } transaction because navigation is from app restart - preserving error context.`,
7173 ) ;
74+ // Don't end the span - it will timeout naturally and remains available for error/replay processing
7275 } else if ( isActiveSpanInteraction ) {
7376 debug . log (
7477 `[startIdleNavigationSpan] Canceling ${
7578 spanToJSON ( activeSpan ) . op
7679 } transaction because of a new navigation root span.`,
7780 ) ;
78- clearActiveSpanFromScope ( getCurrentScope ( ) ) ;
7981 activeSpan . setStatus ( { code : SPAN_STATUS_ERROR , message : 'cancelled' } ) ;
8082 activeSpan . end ( ) ;
81- } else {
82- clearActiveSpanFromScope ( getCurrentScope ( ) ) ;
8383 }
8484
8585 const finalStartSpanOptions = {
You can’t perform that action at this time.
0 commit comments