You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: TSQL numeric duration formatting drops the sign for negative values #5169
macOS arm64, Node 22, Trigger.dev source 33b83c6, Vitest 4.1.12, humanize-duration 3.27.3 from the repo lockfile.
Describe the bug
The dashboard uses formatDurationMilliseconds for numeric duration cells returned by TSQL. A duration delta can be negative. The helper removes the sign and picks millisecond units even when the absolute duration exceeds a second, so a negative delta can be displayed as a positive value.
On current main at 33b83c6, call formatDurationMilliseconds(-1500, { style: "short" }) from the core duration module. The result is 1500ms; the same positive input gives 1.5s. formatDurationMilliseconds(-500, { style: "short" }) similarly returns 500ms. The nanosecond wrapper inherits the behavior.
Suggested fix
Use magnitude to choose units, then prepend the original sign. Preserve positive and zero formatting and the existing absolute-distance behavior of the date-to-date helper.
Additional information
Reproduced using the source helper and the locked formatter dependency. Three negative cases failed on main. Six cases, including positive and zero controls, passed after the proposed change. Codex assisted with investigation and local testing.
Activity
CycloSolutions commentedon Dec 1, 2026
Cyclo is working on this issue. We will submit the implementation with verification evidence.