Skip to content

Commit 5910b3b

Browse files
logaretmclaude
andcommitted
fix(browser-utils): Add fallback for browserPerformanceTimeOrigin in _sendInpSpan
Use `|| 0` fallback instead of `as number` cast, consistent with the LCP and CLS span handlers that already guard against undefined. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d0914a3 commit 5910b3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/browser-utils/src/metrics/webVitalSpans.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export function _sendInpSpan(
244244
): void {
245245
DEBUG_BUILD && debug.log(`Sending INP span (${inpValue})`);
246246

247-
const startTime = msToSec((browserPerformanceTimeOrigin() as number) + entry.startTime);
247+
const startTime = msToSec((browserPerformanceTimeOrigin() || 0) + entry.startTime);
248248
const interactionType = INP_ENTRY_MAP[entry.name];
249249
const activeSpan = getActiveSpan();
250250
const rootSpan = activeSpan ? getRootSpan(activeSpan) : undefined;

0 commit comments

Comments
 (0)