Skip to content

Commit 5eeb55d

Browse files
fix(webapp): remove root span assumption and fix duplication in RunPresenter
1 parent c78797c commit 5eeb55d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apps/webapp/app/presenters/v3/RunPresenter.server.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,11 @@ export function reconcileTraceWithRunLifecycle(
296296
totalDuration: number;
297297
rootSpanStatus: "executing" | "completed" | "failed";
298298
} {
299-
const currentStatus: "executing" | "completed" | "failed" = events[0]
300-
? events[0].data.isError
299+
const rootEvent = events.find((e) => e.id === rootSpanId);
300+
const currentStatus: "executing" | "completed" | "failed" = rootEvent
301+
? rootEvent.data.isError
301302
? "failed"
302-
: !events[0].data.isPartial
303+
: !rootEvent.data.isPartial
303304
? "completed"
304305
: "executing"
305306
: "executing";

0 commit comments

Comments
 (0)