Skip to content

Commit 27666e5

Browse files
authored
fix(replay): Fix error breadcrumb not in Chapter (#97417)
It looks like we are losing millisecond precision w/ the start timestamp and/or duration if the error is the last event we receive in the replay. Take a look at [this replay](https://sentry.sentry.io/explore/replays/6037de22e46640159865493446790405/?project=11276&query=count_errors%3A%3E0&referrer=%2Fexplore%2Freplays%2F&statsPeriod=7d&t_main=ai&yAxis=count%28%29) for an example. `getChapterFrames()` trims to between start + end and error occurs 718ms later: Start TS: 1754421644000 Duration: 246000 End TS: 1754421890000 Error: 1754421890718 (+718ms) The proposed solution creates a new getter that does not trim frames since we use the chapter timestamps to trim anyway.
1 parent fcf9f37 commit 27666e5

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

static/app/utils/replays/replayReader.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,26 @@ export default class ReplayReader {
744744
)
745745
);
746746

747+
getSummaryChapterFrames = memoize(() => {
748+
return [
749+
...this.getPerfFrames(),
750+
...this.getCustomFrames(),
751+
...this._sortedBreadcrumbFrames.filter(frame =>
752+
[
753+
'replay.hydrate-error',
754+
'replay.mutations',
755+
'feedback',
756+
'device.battery',
757+
'device.connectivity',
758+
'device.orientation',
759+
'app.foreground',
760+
'app.background',
761+
].includes(frame.category)
762+
),
763+
...this._errors,
764+
].sort(sortFrames);
765+
});
766+
747767
getPerfFrames = memoize(() => {
748768
const crumbs = removeDuplicateClicks(
749769
this._sortedBreadcrumbFrames.filter(

static/app/views/replays/detail/ai/chapterList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function ChapterList({timeRanges}: Props) {
4747
feedback,
4848
breadcrumbs:
4949
replay
50-
?.getChapterFrames()
50+
?.getSummaryChapterFrames()
5151
.filter(
5252
breadcrumb =>
5353
breadcrumb.timestampMs >= period_start &&

0 commit comments

Comments
 (0)