fix(tests): use blue_started_at for Waiting column (updated_at doesn't exist)
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled

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.
This commit is contained in:
kitos
2026-06-03 11:15:00 +02:00
parent 9f1c4c28c9
commit fc3b413a83

View File

@@ -231,13 +231,14 @@ export default function TestsPage() {
const aIsBlue = a.state === "blue_evaluating"; const aIsBlue = a.state === "blue_evaluating";
const bIsBlue = b.state === "blue_evaluating"; const bIsBlue = b.state === "blue_evaluating";
if (aIsBlue && bIsBlue) { if (aIsBlue && bIsBlue) {
av = a.updated_at || ""; // Older blue_started_at = waited longer = sort first in asc
bv = b.updated_at || ""; av = (a as any).blue_started_at || a.created_at || "";
bv = (b as any).blue_started_at || b.created_at || "";
} else { } else {
if (aIsBlue && !bIsBlue) return sortDir === "asc" ? -1 : 1; if (aIsBlue && !bIsBlue) return sortDir === "asc" ? -1 : 1;
if (!aIsBlue && bIsBlue) return sortDir === "asc" ? 1 : -1; if (!aIsBlue && bIsBlue) return sortDir === "asc" ? 1 : -1;
av = a.updated_at || ""; av = (a as any).blue_started_at || a.created_at || "";
bv = b.updated_at || ""; bv = (b as any).blue_started_at || b.created_at || "";
} }
break; break;
} }
@@ -579,11 +580,11 @@ export default function TestsPage() {
<td className="py-3 px-4 text-gray-400 text-xs"> <td className="py-3 px-4 text-gray-400 text-xs">
{test.platform || "-"} {test.platform || "-"}
</td> </td>
{/* Waiting time — meaningful for blue_evaluating */} {/* Waiting time — how long since Red submitted to Blue */}
<td className="py-3 px-4 text-xs whitespace-nowrap"> <td className="py-3 px-4 text-xs whitespace-nowrap">
{test.state === "blue_evaluating" ? ( {test.state === "blue_evaluating" ? (
<span className="font-mono text-indigo-400"> <span className="font-mono text-indigo-400">
{formatElapsed(test.updated_at)} {formatElapsed(test.blue_started_at)}
</span> </span>
) : ( ) : (
<span className="text-gray-700"></span> <span className="text-gray-700"></span>