Skip to content

fix(analytics): Hash Stats multi-byte adopters column sort reads the wrong column and has no state #226

Description

@dborup

Relates to #208, #214

Summary

In public/analytics.js (renderMultiByteAdopters, the [data-sort] click handler), colIdx is { name: 0, status: 1, hashSize: 2, packets: 3, lastSeen: 4 }. The table, however, has six columns: Node, Role, Status, Hash Size, Adverts and Last Seen. The Role column and this map were added together in 45623672. As a result:

  • Role does nothing.
  • Status reads the Role cell, so every row gets weight 2 and the order does not change.
  • Hash Size reads the Status text.
  • Adverts reads the Hash Size cell.
  • Last Seen reads the Adverts cell, as a string.

Even with the right index, Last Seen would compare timeAgo text ("5m ago") as strings. The sort is ascending only, keeps no state or indicator, and is discarded by the next filter click.

Evidence

From the #214 review: on the E2E fixture, clicking Adverts leaves the Adverts column as 2, 1, 1, ….

Proposed fix

Acceptance criteria

  • A unit test per column asserts the order of that column's own cells.
  • Last Seen is ordered by timestamp, not by text.
  • The filter and mbf= behaviour are unchanged.

Activity

  1. added a commit that references this issue on Oct 5, 2026
  2. dborup commented on Oct 5, 2026

    @dborup
    OwnerAuthor

    Fixed by #230 (merged as 341a1961).

    Consistency follow-ups shared with the other analytics tables are tracked separately: default direction, keyboard access, locale-aware compare and a shared helper.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions