File tree Expand file tree Collapse file tree 1 file changed +16
-16
lines changed
packages/browser/src/tracing Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -274,24 +274,24 @@ function addHTTPTimings(span: Span, client: Client): void {
274274
275275 span . end = ( endTimestamp ?: SpanTimeInput ) => {
276276 capturedEndTimestamp = endTimestamp ;
277- } ;
278277
279- const endSpanAndCleanup = ( ) : void => {
280- if ( isEnded ) {
281- return ;
282- }
283- isEnded = true ;
284- setTimeout ( cleanup ) ;
285- originalEnd ( capturedEndTimestamp ) ;
286- clearTimeout ( fallbackTimeout ) ;
278+ const endSpanAndCleanup = ( ) : void => {
279+ if ( isEnded ) {
280+ return ;
281+ }
282+ isEnded = true ;
283+ setTimeout ( cleanup ) ;
284+ originalEnd ( capturedEndTimestamp ) ;
285+ clearTimeout ( fallbackTimeout ) ;
286+ } ;
287+
288+ onEntryFound = endSpanAndCleanup ;
289+
290+ // Fallback: always end the span after HTTP_TIMING_WAIT_MS even if no
291+ // PerformanceResourceTiming entry arrives (e.g. cross-origin without
292+ // Timing-Allow-Origin, or the browser didn't fire the observer in time).
293+ const fallbackTimeout = setTimeout ( endSpanAndCleanup , HTTP_TIMING_WAIT_MS ) ;
287294 } ;
288-
289- onEntryFound = endSpanAndCleanup ;
290-
291- // Fallback: always end the span after HTTP_TIMING_WAIT_MS even if no
292- // PerformanceResourceTiming entry arrives (e.g. cross-origin without
293- // Timing-Allow-Origin, or the browser didn't fire the observer in time).
294- const fallbackTimeout = setTimeout ( endSpanAndCleanup , HTTP_TIMING_WAIT_MS ) ;
295295 }
296296
297297 const cleanup = addPerformanceInstrumentationHandler ( 'resource' , ( { entries } ) => {
You can’t perform that action at this time.
0 commit comments