openclaw-windows-node/src
github-actions[bot] c076085eee
fix: use integer truncation in FormatAge to prevent rounding past display boundaries
Math.Round with C# default banker's rounding (MidpointRounding.ToEven) can
produce counterintuitive results at display-threshold boundaries:

- 59.5 minutes -> Math.Round(59.5) = 60 -> displayed as '60m ago'
  instead of '59m ago' (or the correct transition to '1h ago')
- 47.5 hours -> Math.Round(47.5) = 48 -> displayed as '48h ago'
  instead of '47h ago' (near the 48h/days boundary)

Using integer truncation ((int)delta.TotalX) matches the idiomatic
convention for age display: show the floor of the elapsed time, which
is consistent, predictable, and never exceeds the guard condition.

Adds three regression tests covering:
- 59.5-minute boundary (was '60m ago', now '59m ago')
- 47.5-hour boundary (was '48h ago', now '47h ago')
- Exactly 60 seconds (correctly '1m ago')

Test status: Shared.Tests 589 passed, 20 skipped; Tray.Tests 122 passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-19 12:40:31 +00:00
..
OpenClaw.Cli feat: SSH tunnel gateway, device identity, reconnect hardening 2026-04-01 00:03:43 -07:00
OpenClaw.CommandPalette Improve web chat security UX and bump to 0.4.2 2026-02-16 21:49:13 -08:00
OpenClaw.Shared fix: use integer truncation in FormatAge to prevent rounding past display boundaries 2026-04-19 12:40:31 +00:00
OpenClaw.Tray.WinUI fix: handle node pairing approval events safely 2026-04-09 14:45:04 -07:00