Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions packages/app/src/DOMPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -513,17 +513,18 @@ export default function DOMPlayer({
No replay available for this session, most likely due to this
session starting and ending in a background tab.
</div>
) : null}
<div
ref={wrapper}
className={cx(styles.domPlayerWrapper, 'overflow-hidden', {
'd-none': isLoading || isBuffering,
started: (replayer.current?.getCurrentTime() ?? 0) > 0,
[styles.domPlayerWrapperPaused]: playerState === 'paused',
})}
>
<div className="player rr-block" ref={playerContainer} />
</div>
) : (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ernestii what's the reason of this change? This seems to break the replayer at times since playerContainer ref will be null in the useEffect above, seems to introduce a race condition where session replays will incorrectly show up as "no replay available"

<div
ref={wrapper}
className={cx(styles.domPlayerWrapper, 'overflow-hidden', {
'd-none': isLoading || isBuffering,
started: (replayer.current?.getCurrentTime() ?? 0) > 0,
[styles.domPlayerWrapperPaused]: playerState === 'paused',
})}
>
<div className="player rr-block" ref={playerContainer} />
</div>
)}
</div>
</>
);
Expand Down
4 changes: 4 additions & 0 deletions packages/app/src/Playbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ export default function Playbar({
const isError =
event.severity_text?.toLowerCase() === 'error' ||
event.component === 'error' ||
event.component === 'console' ||
Copy link

Copilot AI Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double-check whether the comparison to 'console' should include a case normalization (similar to the toLowerCase call for severity_text) to ensure that all variations of console errors are captured.

Suggested change
event.component === 'console' ||
event.component?.toLowerCase() === 'console' ||

Copilot uses AI. Check for mistakes.
statusCode >= 399;

const isSuccess = !isError && statusCode < 400 && statusCode > 99;

return {
id: event.id,
ts: event.startOffset,
Expand All @@ -93,6 +96,7 @@ export default function Playbar({
? 'Intercom Chat Opened'
: event.body,
isError,
isSuccess,
};
}) ?? [],
'percentage',
Expand Down
10 changes: 6 additions & 4 deletions packages/app/src/PlaybarSlider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import { format } from 'date-fns';
import { Slider, Tooltip } from '@mantine/core';

import { useFormatTime } from './useFormatTime';
Expand All @@ -12,6 +11,7 @@ export type PlaybarMarker = {
ts: number;
description: string;
isError: boolean;
isSuccess: boolean;
};

type PlaybarSliderProps = {
Expand Down Expand Up @@ -60,9 +60,11 @@ export const PlaybarSlider = ({
<div
className={styles.markerDot}
style={{
backgroundColor: mark.isError
? 'var(--mantine-color-red-6)'
: 'var(--mantine-color-gray-6)',
backgroundColor: mark.isSuccess
? 'var(--mantine-color-green-6)'
: mark.isError
? 'var(--mantine-color-red-6)'
: 'var(--mantine-color-gray-6)',
left: `${((mark.ts - min) / (max - min)) * 100}%`,
}}
onClick={() => onChange(mark.ts)}
Expand Down
13 changes: 8 additions & 5 deletions packages/app/src/SessionSubpanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ export default function SessionSubpanel({
[traceSource],
);

const filteredEventsFilter = useMemo(
// Events shown in the highlighted tab
const highlightedEventsFilter = useMemo(
() => ({
type: 'lucene' as const,
condition: `${traceSource.resourceAttributesExpression}.rum.sessionId:"${rumSessionId}"
Expand Down Expand Up @@ -363,7 +364,7 @@ export default function SessionSubpanel({
offset: 0,
},
filters: [
filteredEventsFilter,
tab === 'highlighted' ? highlightedEventsFilter : allEventsFilter,
...(where ? [{ type: whereLanguage, condition: where }] : []),
],
}),
Expand All @@ -377,7 +378,9 @@ export default function SessionSubpanel({
end,
whereLanguage,
searchedQuery,
filteredEventsFilter,
tab,
highlightedEventsFilter,
allEventsFilter,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ernestii just curious here...what is filteredEventsFilter vs allEventsFilter and why does this work? Can you add a few comments for future devs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filteredEventsFilter is used in the Highlighted tab – good point, updated the var name and added comment

Screenshot 2025-04-29 at 7 47 30 PM

where,
],
);
Expand Down Expand Up @@ -410,7 +413,7 @@ export default function SessionSubpanel({
offset: 0,
},
filters: [
tab === 'highlighted' ? filteredEventsFilter : allEventsFilter,
tab === 'highlighted' ? highlightedEventsFilter : allEventsFilter,
...(where ? [{ type: whereLanguage, condition: where }] : []),
],
}),
Expand All @@ -425,7 +428,7 @@ export default function SessionSubpanel({
whereLanguage,
searchedQuery,
tab,
filteredEventsFilter,
highlightedEventsFilter,
allEventsFilter,
where,
],
Expand Down
3 changes: 2 additions & 1 deletion packages/app/styles/PlaybarSlider.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
position: absolute;
top: 0;
margin-left: -1px;
width: 3px;
width: 2px;
height: 8px;
background-color: #333;
border-radius: 1px;
opacity: 0.5;

&:hover {
opacity: 1 !important;
Expand Down