Skip to content

Commit eb3773a

Browse files
authored
fix(replay): Fix duration due to incorrect LCP endtimestamp (#44842)
Due to 7.38.0 (getsentry/sentry-javascript#7187) LCP endtimestamp was being incorrectly recorded. The end timestamp is used in our UI to calculate duration at the moment, so LCP with high values are causing our calculated duration to be incorrect. Ignore LCP in the duration calculation as a temporary fix. Ideally we would get SDK timestamps correct so that we only have the event duration as the source of truth for duration.
1 parent 0d240f6 commit eb3773a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

static/app/utils/replays/replayDataUtils.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export function breadcrumbFactory(
163163
label: error['error.type'].join(''),
164164
eventId: error.id,
165165
groupId: error['issue.id'] || 1,
166-
groupShortId: error.issue || 'POKEDEX-4NN',
166+
groupShortId: error.issue,
167167
project: error['project.name'],
168168
},
169169
timestamp: error.timestamp,
@@ -263,8 +263,11 @@ export function replayTimestamps(
263263
)
264264
.map(timestamp => +new Date(timestamp * 1000))
265265
.filter(Boolean);
266-
const spanStartTimestamps = rawSpanData.map(span => span.startTimestamp * 1000);
267-
const spanEndTimestamps = rawSpanData.map(span => span.endTimestamp * 1000);
266+
const rawSpanDataFiltered = rawSpanData.filter(
267+
({op}) => op !== 'largest-contentful-paint'
268+
);
269+
const spanStartTimestamps = rawSpanDataFiltered.map(span => span.startTimestamp * 1000);
270+
const spanEndTimestamps = rawSpanDataFiltered.map(span => span.endTimestamp * 1000);
268271

269272
return {
270273
startTimestampMs: Math.min(

0 commit comments

Comments
 (0)