Follow the work.
Fix the uptime formatter in formatters.ts.
It currently displays NaNs for NaN and Infinityd NaNh for positive Infinity.
I'll start by locating the files.
/home/agent/formatters.ts
/home/agent/formatters.test.mjs22 export function formatUptime(valueMs: number) {
23 const totalSeconds = Math.max(0, Math.floor(valueMs / 1000));
24 const days = Math.floor(totalSeconds / 86400);5 for (const [label, value] of [
6 ['NaN', Number.NaN],
7 ['positive infinity', Number.POSITIVE_INFINITY],
8 ['negative infinity', Number.NEGATIVE_INFINITY],
9 ]) {# tests 18
# pass 16
# fail 2Before: 16 pass, 2 fail (NaN and positive infinity). Applying the fix:
export function formatUptime(valueMs: number) {
// NaN/±Infinity mean "unavailable" here, same as in formatBytes above: NaN
// fell through to "NaNs" and +Infinity to "Infinityd NaNh".
if (!Number.isFinite(valueMs)) return "0s";
const totalSeconds = Math.max(0, Math.floor(valueMs / 1000));# tests 18
# pass 18
# fail 0