From cbc44d43502a9ba9d145262ab29bd79af2d70614 Mon Sep 17 00:00:00 2001 From: Niran Babalola Date: Fri, 15 May 2026 22:05:49 -0500 Subject: [PATCH] fix(report): handle empty load test block ranges Render failed load-test runs that have no confirmed blocks instead of assuming first_block and last_block are present in the API response. Co-authored-by: Codex --- report/src/pages/LoadTestDetail.tsx | 14 +++++++++++--- report/src/types.ts | 5 +++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/report/src/pages/LoadTestDetail.tsx b/report/src/pages/LoadTestDetail.tsx index d6e0853..808ab81 100644 --- a/report/src/pages/LoadTestDetail.tsx +++ b/report/src/pages/LoadTestDetail.tsx @@ -91,6 +91,10 @@ const SummarySection = ({ result }: { result: LoadTestResult }) => { const submitted = result.throughput.total_submitted; const confirmed = result.throughput.total_confirmed; const failed = result.throughput.total_failed; + const blockRange = result.block_range; + const hasConfirmedBlockRange = + typeof blockRange?.first_block === "number" && + typeof blockRange.last_block === "number"; return ( @@ -121,11 +125,15 @@ const SummarySection = ({ result }: { result: LoadTestResult }) => { value={formatEthFromWei(result.gas.total_cost_wei)} hint={`${result.gas.avg_gas_price.toLocaleString()} wei avg gas price`} /> - {result.block_range && ( + {blockRange && ( )} diff --git a/report/src/types.ts b/report/src/types.ts index d0d59f5..321ad63 100644 --- a/report/src/types.ts +++ b/report/src/types.ts @@ -168,8 +168,9 @@ export interface ThroughputPercentiles { } export interface BlockRange { - first_block: number; - last_block: number; + // Omitted when no test transactions were confirmed. + first_block?: number; + last_block?: number; block_count: number; }