Skip to content

Commit f15171b

Browse files
authored
fix(ui): don't display "Timed Out" when executing action (#34541)
1 parent ba65016 commit f15171b

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

packages/trace-viewer/src/ui/callTab.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,12 @@ export const CallTab: React.FunctionComponent<{
4040
const startTimeMillis = action.startTime - startTimeOffset;
4141
const startTime = msToString(startTimeMillis);
4242

43-
const duration = action.endTime ? msToString(action.endTime - action.startTime) : 'Timed Out';
44-
4543
return (
4644
<div className='call-tab'>
4745
<div className='call-line'>{action.apiName}</div>
48-
{
49-
<>
50-
<div className='call-section'>Time</div>
51-
<DateTimeCallLine name='start:' value={startTime} />
52-
<DateTimeCallLine name='duration:' value={duration} />
53-
</>
54-
}
46+
<div className='call-section'>Time</div>
47+
<DateTimeCallLine name='start:' value={startTime} />
48+
<DateTimeCallLine name='duration:' value={renderDuration(action)} />
5549
{
5650
!!paramKeys.length && <>
5751
<div className='call-section'>Parameters</div>
@@ -78,6 +72,15 @@ type Property = {
7872
text: string;
7973
};
8074

75+
function renderDuration(action: ActionTraceEventInContext): string {
76+
if (action.endTime)
77+
return msToString(action.endTime - action.startTime);
78+
else if (!!action.error)
79+
return 'Timed Out';
80+
else
81+
return 'Running';
82+
}
83+
8184
function renderProperty(property: Property) {
8285
let text = property.text.replace(/\n/g, '↵');
8386
if (property.type === 'string')

0 commit comments

Comments
 (0)