|
@@ -5,6 +5,7 @@ import {transformCrumbs} from 'sentry/components/events/interfaces/breadcrumbs/u
|
|
|
import {t} from 'sentry/locale';
|
|
|
import type {
|
|
|
BreadcrumbTypeDefault,
|
|
|
+ BreadcrumbTypeInit,
|
|
|
BreadcrumbTypeNavigation,
|
|
|
Crumb,
|
|
|
RawCrumb,
|
|
@@ -147,7 +148,7 @@ export function breadcrumbFactory(
|
|
|
): Crumb[] {
|
|
|
const UNWANTED_CRUMB_CATEGORIES = ['ui.focus', 'ui.blur'];
|
|
|
|
|
|
- const initialUrl = replayRecord.tags.url?.join(', ');
|
|
|
+ const initialUrl = replayRecord.urls?.[0] ?? replayRecord.tags.url?.join(', ');
|
|
|
const initBreadcrumb = {
|
|
|
type: BreadcrumbType.INIT,
|
|
|
timestamp: replayRecord.started_at.toISOString(),
|
|
@@ -158,7 +159,7 @@ export function breadcrumbFactory(
|
|
|
label: t('Start recording'),
|
|
|
url: initialUrl,
|
|
|
},
|
|
|
- } as BreadcrumbTypeDefault;
|
|
|
+ } as BreadcrumbTypeInit;
|
|
|
|
|
|
const errorCrumbs: RawCrumb[] = errors.map(error => ({
|
|
|
type: BreadcrumbType.ERROR,
|
|
@@ -246,7 +247,7 @@ export function breadcrumbFactory(
|
|
|
});
|
|
|
|
|
|
const result = transformCrumbs([
|
|
|
- ...(!hasPageLoad ? [initBreadcrumb] : []),
|
|
|
+ ...(spans.length && !hasPageLoad ? [initBreadcrumb] : []),
|
|
|
...rawCrumbsWithTimestamp,
|
|
|
...errorCrumbs,
|
|
|
...spanCrumbs,
|
|
@@ -266,7 +267,7 @@ export function spansFactory(spans: ReplaySpan[]) {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Calculate min/max of an array simultaniously.
|
|
|
+ * Calculate min/max of an array simultaneously.
|
|
|
* This prevents two things:
|
|
|
* - Avoid extra allocations and iterations, just loop through once.
|
|
|
* - Avoid `Maximum call stack size exceeded` when the array is too large
|