From fc3b413a83ae01dedbd280678b4d1cf0875f266a Mon Sep 17 00:00:00 2001 From: kitos Date: Wed, 3 Jun 2026 11:15:00 +0200 Subject: [PATCH] fix(tests): use blue_started_at for Waiting column (updated_at doesn't exist) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updated_at column does not exist in the tests table — it was always undefined, so formatElapsed() always returned '—'. Replace with blue_started_at (set when Red Team submits to Blue Team), which correctly shows how long a test has been waiting for Blue Team evaluation. Also fixed the waiting_time sort to use the same field. --- frontend/src/pages/TestsPage.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/TestsPage.tsx b/frontend/src/pages/TestsPage.tsx index 805bfbd..3b6390e 100644 --- a/frontend/src/pages/TestsPage.tsx +++ b/frontend/src/pages/TestsPage.tsx @@ -231,13 +231,14 @@ export default function TestsPage() { const aIsBlue = a.state === "blue_evaluating"; const bIsBlue = b.state === "blue_evaluating"; if (aIsBlue && bIsBlue) { - av = a.updated_at || ""; - bv = b.updated_at || ""; + // Older blue_started_at = waited longer = sort first in asc + av = (a as any).blue_started_at || a.created_at || ""; + bv = (b as any).blue_started_at || b.created_at || ""; } else { if (aIsBlue && !bIsBlue) return sortDir === "asc" ? -1 : 1; if (!aIsBlue && bIsBlue) return sortDir === "asc" ? 1 : -1; - av = a.updated_at || ""; - bv = b.updated_at || ""; + av = (a as any).blue_started_at || a.created_at || ""; + bv = (b as any).blue_started_at || b.created_at || ""; } break; } @@ -579,11 +580,11 @@ export default function TestsPage() { {test.platform || "-"} - {/* Waiting time — meaningful for blue_evaluating */} + {/* Waiting time — how long since Red submitted to Blue */} {test.state === "blue_evaluating" ? ( - {formatElapsed(test.updated_at)} + {formatElapsed(test.blue_started_at)} ) : (