Skip to content

Commit e60978f

Browse files
committed
fix another bug with missing timestamp
1 parent 7d0fe48 commit e60978f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/browser/src/tracing/request.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
stringMatchesSomePattern,
2929
stripDataUrlContent,
3030
stripUrlQueryAndFragment,
31+
timestampInSeconds,
3132
} from '@sentry/core';
3233
import type { XhrHint } from '@sentry-internal/browser-utils';
3334
import {
@@ -269,11 +270,10 @@ function addHTTPTimings(span: Span, client: Client): void {
269270
// either receive the timing data, or HTTP_TIMING_WAIT_MS elapses.
270271
if (hasSpanStreamingEnabled(client)) {
271272
const originalEnd = span.end.bind(span);
272-
let capturedEndTimestamp: SpanTimeInput | undefined;
273-
let isEnded = false;
274273

275274
span.end = (endTimestamp?: SpanTimeInput) => {
276-
capturedEndTimestamp = endTimestamp;
275+
const capturedEndTimestamp = endTimestamp || timestampInSeconds();
276+
let isEnded = false;
277277

278278
const endSpanAndCleanup = (): void => {
279279
if (isEnded) {

0 commit comments

Comments
 (0)