Skip to content

Commit 68c915a

Browse files
Abdkhan14Abdullah Khan
andauthored
fix(trace-eap-watefall): Standalone spans don't have txn event details (#97499)
Resolves: https://sentry.sentry.io/issues/6799194855/?project=11276&referrer=github-pr-bot Co-authored-by: Abdullah Khan <[email protected]>
1 parent 77f2635 commit 68c915a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

static/app/components/events/interfaces/spans/spanProfileDetails.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ export interface SpanProfileDetailsProps {
4848
export function useSpanProfileDetails(
4949
organization: Organization,
5050
project: Project | undefined,
51-
event: Readonly<EventTransaction>,
51+
event: Readonly<EventTransaction | undefined>,
5252
span: SpanProfileDetailsProps['span']
5353
) {
5454
const profileGroup = useProfileGroup();
5555

5656
const processedEvent = useMemo(() => {
57+
if (!event) {
58+
return null;
59+
}
60+
5761
const entries: EventTransaction['entries'] = [...(event.entries || [])];
5862
if (profileGroup.images) {
5963
entries.push({
@@ -78,7 +82,7 @@ export function useSpanProfileDetails(
7882
}, [profileGroup.profiles, threadId]);
7983

8084
const nodes: CallTreeNode[] = useMemo(() => {
81-
if (profile === null) {
85+
if (profile === null || !event) {
8286
return [];
8387
}
8488

@@ -133,7 +137,7 @@ export function useSpanProfileDetails(
133137
}, [nodes]);
134138

135139
const {frames, hasPrevious, hasNext} = useMemo(() => {
136-
if (index >= maxNodes) {
140+
if (index >= maxNodes || !event) {
137141
return {frames: [], hasPrevious: false, hasNext: false};
138142
}
139143

@@ -145,7 +149,7 @@ export function useSpanProfileDetails(
145149
}, [index, maxNodes, event, nodes]);
146150

147151
const profileTarget = useMemo(() => {
148-
if (defined(project)) {
152+
if (defined(project) && event) {
149153
const profileContext = event.contexts.profile ?? {};
150154

151155
if (defined(profileContext.profile_id)) {
@@ -214,7 +218,7 @@ export function SpanProfileDetails({
214218
frames,
215219
} = useSpanProfileDetails(organization, project, event, span);
216220

217-
if (!defined(profileTarget)) {
221+
if (!defined(profileTarget) || !processedEvent) {
218222
return null;
219223
}
220224

static/app/views/performance/newTraceDetails/traceDrawer/details/span/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ function EAPSpanNodeDetails(props: EAPSpanNodeDetailsProps) {
400400
<EAPSpanNodeDetailsContent
401401
{...props}
402402
traceItemData={traceItemData}
403-
eventTransaction={eventTransaction!}
403+
eventTransaction={eventTransaction}
404404
avgSpanDuration={avgSpanDuration}
405405
/>
406406
);
@@ -420,7 +420,7 @@ function EAPSpanNodeDetailsContent({
420420
avgSpanDuration,
421421
}: EAPSpanNodeDetailsProps & {
422422
avgSpanDuration: number | undefined;
423-
eventTransaction: EventTransaction;
423+
eventTransaction: EventTransaction | undefined;
424424
traceItemData: TraceItemDetailsResponse;
425425
}) {
426426
const attributes = traceItemData.attributes;

0 commit comments

Comments
 (0)