From d59c6fc1bed06718c49fc87bfc5bf143a10ac5ed Mon Sep 17 00:00:00 2001 From: garethgeorge Date: Sun, 15 Sep 2024 12:27:23 -0700 Subject: [PATCH] fix: stats panel can fail to load when an incomplete operation is in the log --- webui/src/components/StatsPanel.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webui/src/components/StatsPanel.tsx b/webui/src/components/StatsPanel.tsx index f2ec46fc..fe6262e0 100644 --- a/webui/src/components/StatsPanel.tsx +++ b/webui/src/components/StatsPanel.tsx @@ -50,13 +50,17 @@ const StatsPanel = ({ repoId }: { repoId: string }) => { ); } + const statsOperations = operations.filter((v) => { + return v.op.case === "operationStats" && v.op.value.stats; + }); + const dataset: { time: number; totalSizeBytes: number; compressionRatio: number; snapshotCount: number; totalBlobCount: number; - }[] = operations.map((op) => { + }[] = statsOperations.map((op) => { const stats = (op.op.value! as OperationStats).stats!; return { time: Number(op.unixTimeEndMs!),