Skip to content

Commit

Permalink
fix(ui): don't display "Timed Out" when executing action (#34541)
Browse files Browse the repository at this point in the history
  • Loading branch information
agg23 authored Jan 29, 2025
1 parent ba65016 commit f15171b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/trace-viewer/src/ui/callTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,12 @@ export const CallTab: React.FunctionComponent<{
const startTimeMillis = action.startTime - startTimeOffset;
const startTime = msToString(startTimeMillis);

const duration = action.endTime ? msToString(action.endTime - action.startTime) : 'Timed Out';

return (
<div className='call-tab'>
<div className='call-line'>{action.apiName}</div>
{
<>
<div className='call-section'>Time</div>
<DateTimeCallLine name='start:' value={startTime} />
<DateTimeCallLine name='duration:' value={duration} />
</>
}
<div className='call-section'>Time</div>
<DateTimeCallLine name='start:' value={startTime} />
<DateTimeCallLine name='duration:' value={renderDuration(action)} />
{
!!paramKeys.length && <>
<div className='call-section'>Parameters</div>
Expand All @@ -78,6 +72,15 @@ type Property = {
text: string;
};

function renderDuration(action: ActionTraceEventInContext): string {
if (action.endTime)
return msToString(action.endTime - action.startTime);
else if (!!action.error)
return 'Timed Out';
else
return 'Running';
}

function renderProperty(property: Property) {
let text = property.text.replace(/\n/g, '↵');
if (property.type === 'string')
Expand Down

0 comments on commit f15171b

Please sign in to comment.