Skip to content

Commit

Permalink
fix(replay): Fix duration due to incorrect LCP endtimestamp (#44842)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
billyvg committed Feb 17, 2023
1 parent 0d240f6 commit eb3773a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions static/app/utils/replays/replayDataUtils.tsx
Expand Up @@ -163,7 +163,7 @@ export function breadcrumbFactory(
label: error['error.type'].join(''),
eventId: error.id,
groupId: error['issue.id'] || 1,
groupShortId: error.issue || 'POKEDEX-4NN',
groupShortId: error.issue,
project: error['project.name'],
},
timestamp: error.timestamp,
Expand Down Expand Up @@ -263,8 +263,11 @@ export function replayTimestamps(
)
.map(timestamp => +new Date(timestamp * 1000))
.filter(Boolean);
const spanStartTimestamps = rawSpanData.map(span => span.startTimestamp * 1000);
const spanEndTimestamps = rawSpanData.map(span => span.endTimestamp * 1000);
const rawSpanDataFiltered = rawSpanData.filter(
({op}) => op !== 'largest-contentful-paint'
);
const spanStartTimestamps = rawSpanDataFiltered.map(span => span.startTimestamp * 1000);
const spanEndTimestamps = rawSpanDataFiltered.map(span => span.endTimestamp * 1000);

return {
startTimestampMs: Math.min(
Expand Down

0 comments on commit eb3773a

Please sign in to comment.