Skip to content

Warn on 1-byte path hash: channel 'Sent with' badge, packet detail and node badge (recommend 2/3-byte) #353

Closed

Description

@dborup

Channel messages show a "Sent with: N-byte" badge (renderSenderPathHashBadge() in public/channels.js, added in #212). The operator wants senders to use a 2- or 3-byte path hash. A 1-byte hash collides often across nodes, so it should read as a warning.

Proposal

  • For size 1, render a warning variant of the badge. Sizes 2 and 3 stay unchanged and neutral.
    • Add a modifier class .ch-path-hash-badge--warn.
    • Colour the text with a new CSS variable --path-hash-warn, defaulting to var(--danger). That variable is already themed for light and dark. Map it in the customizer (THEME_CSS_MAP). No hardcoded colours.
    • Do not rely on colour alone. Add a small Phosphor warning icon (aria-hidden), plus text for screen readers.
    • Tooltip: explain the collision risk and recommend 2- or 3-byte. Take the name of the companion setting from the MeshCore firmware/docs (firmware/), not from guesswork.
  • Hardcode the threshold ("1 = warning") for now. A customizer option for the recommended minimum can come later (AGENTS.md rule 8).

Also in scope (operator decision 2026-10-07)

Apply the same warning, with the same variable, icon and tooltip, wherever a 1-byte path hash is shown:

  • Packet detail: the "HASH SIZE" row when it is 1 byte (public/packets.js).
  • Node detail: today the "Multibyte" badge appears only for 2- and 3-byte (renderNodeBadges, public/nodes.js ~335). Add a small warning badge when the node advertises a 1-byte hash, with the same wording.

Reuse one shared helper for "is this size a warning" and the badge markup. Do not add one copy per page (DRY).

Acceptance

  • Unit tests:
    • 1-byte gets the warn class, the icon and the tooltip;
    • 2- and 3-byte get no warn class;
    • invalid or missing sizes render no badge, as today.
    • Kill a mutant, e.g. a warn class on 2-byte.
  • The same tests for the packet detail row and the node badge.
  • Browser check of channels, packet detail and node detail in light and dark theme and on mobile. XSS gate clean.

Activity

  1. changed the title [-]Channels: show the 'Sent with: 1-byte' path-hash badge as a warning (recommend 2/3-byte)[/-] [+]Warn on 1-byte path hash: channel 'Sent with' badge, packet detail and node badge (recommend 2/3-byte)[/+] on Oct 7, 2026
  2. added a commit that references this issue on Oct 7, 2026
  3. dborup commented on Oct 7, 2026

    @dborup
    OwnerAuthor

    Operator decision (2026-10-07): show 1-byte as a recommendation, not an error. Use an amber/warning tone (--path-hash-warn defaults to the warning palette instead of --danger), with wording like "Recommended: 2- or 3-byte path hash". Apply this everywhere a 1-byte hash is flagged. Reason: 1-byte is the firmware default and the MeshCore FAQ still recommends it for companions.

  4. dborup commented on Oct 8, 2026

    @dborup
    OwnerAuthor

    Fixed by #356 (merged as 8ef59f2f91ad74e7ef9919d7cf7cac7c3d264ee6).

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