diff --git a/src/core/utils/formatTrace.ts b/src/core/utils/formatTrace.ts index 27d93e76..c0f3482a 100644 --- a/src/core/utils/formatTrace.ts +++ b/src/core/utils/formatTrace.ts @@ -1,4 +1,5 @@ -export function formatTraceBySites(trace: string) { +// TODO: We don't expect trace = undefined. Remove when BE TCP flowpair API is stabilized +export function formatTraceBySites(trace: string = '') { const traceSanitized = trace.replace(/\|+$/, ''); if (!traceSanitized) { diff --git a/src/pages/shared/FlowPairs/FlowPair.tsx b/src/pages/shared/FlowPairs/FlowPair.tsx index 12113810..33910f6e 100644 --- a/src/pages/shared/FlowPairs/FlowPair.tsx +++ b/src/pages/shared/FlowPairs/FlowPair.tsx @@ -44,10 +44,12 @@ const FlowPair: FC<{ flowPair: FlowPairsResponse }> = function ({ flowPair }) { const duration = formatTimeInterval(endTimeMicroSeconds || Date.now() * 1000, startTimeMicroSenconds); + const isHtpp = protocol === AvailableProtocols.Http || protocol === AvailableProtocols.Http2; + return ( - {protocol === AvailableProtocols.Tcp && ( + {!isHtpp && ( <> @@ -60,7 +62,7 @@ const FlowPair: FC<{ flowPair: FlowPairsResponse }> = function ({ flowPair }) { {FlowPairLabels.Trace} - {formatTraceBySites(flowTrace)} + {formatTraceBySites(flowTrace) || '-'} {duration && ( <> {FlowPairLabels.Duration} @@ -73,7 +75,7 @@ const FlowPair: FC<{ flowPair: FlowPairsResponse }> = function ({ flowPair }) { )} - {protocol !== AvailableProtocols.Tcp && ( + {isHtpp && ( <>