Skip to content

Session duration reads "60 s" or "60 min" near a unit boundary #381

Closed

Description

@RaphaelFakhri

In the Traffic session panel, a session that lasts 59.6 seconds shows a duration of "60 s" (中文 "60 秒"). A session of 59.5 minutes shows "60 min".

Expected

"1 min" and "1.0 h", the way msShort() handles the same boundary.

Cause

span() in src/format.ts picks the unit from the unrounded value (n < 60_000, n < 3_600_000) and rounds afterwards, so values just under a boundary round up to 60 of the smaller unit.

Repro

span(59_600)    // "60 秒", expected "1 分"
span(3_570_000) // "60 分", expected "1.0 小时"

Activity

  1. fylorn commented on Oct 28, 2026

    @fylorn
    Contributor

    @RaphaelFakhri Thanks for the report and for the fix in #382 — the change looks right.

    One thing before we can merge it: the CLA check on #382 is still waiting for your signature. Please post a comment on #382 with exactly this line:

    I have read the CLA Document and I hereby sign the CLA
    

    The bot picks it up and the check turns green. After that we'll run CI and merge.

  2. fylorn commented on Oct 30, 2026

    @fylorn
    Contributor

    Fixed by #382, released in 2026.10.34. Thanks again for the report and the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions