Skip to content

Analytics → Channels: default "Public" channel (0x11) shown as opaque "Encrypted (0x11)" despite known/configured key #1729

@syssi

Description

@syssi

Summary

On /#/analytics?tab=channels (e.g. https://corescope.meshrheinland.de/#/analytics?tab=channels) the Public channel shows up as an opaque row Encrypted (0x11) in the Encrypted section at the bottom of the list — even though it carries the most messages and senders.

Channel hash 0x11 is the firmware-default MeshCore Public channel. Its key is well-known and is in fact shipped built-in:

// cmd/ingestor/main.go:1300
func builtinChannelKeys() map[string]string {
    ...
    "Public": "8b3387e9c5cdea6ac9e5edbaa115cd72",
}

It can additionally be set explicitly in config:

"channelKeys": {
  "Public": "8b3387e9c5cdea6ac9e5edbaa115cd72"
}

…but that key is not applied on this view — the row stays opaque and sorts to the bottom.

Expected

The 0x11 Public channel should be treated as a known / decrypted channel: rendered with its real name "Public" and grouped at the top of the list (My Channels / Network), consistent with every other channel whose key is known.

Actual

Rendered as Encrypted (0x11), encrypted: true, bucketed into the Encrypted group, sorted to the bottom — despite the key being configured/built-in.

Root cause (pointers)

The encrypted-channels aggregation counts only GRP_TXT packets whose decryption status is no_key, and hard-labels them, ignoring known keys:

// cmd/server/store.go:5093  GetEncryptedChannels()
if decoded.Type != "GRP_TXT" || decoded.DecryptionStatus != "no_key" { continue }
...
"hash":      "enc_" + ch.hash,
"name":      "Encrypted (0x" + ch.hash + ")",
"encrypted": true,

Client-side de-opaquing in decorateAnalyticsChannels (public/analytics.js:976) only resolves a hash → name via browser-local keys (buildHashKeyMap()ChannelDecrypt.getStoredKeys(), public/analytics.js:1015). The server-side configured / built-in channelKeys (incl. Public) are never consulted on this view, so 0x11 never gets a name or the decrypted grouping.

Note the decoder does know how to decrypt Public (cmd/ingestor/decoder.go:544 decodeGrpTxt emits Channel: "Public", DecryptionStatus: "decrypted" when a key matches) — so the gap is specifically the analytics-channels aggregation/labeling path, not the crypto.

Suggested fix

Reconcile the encrypted-channels listing with known channel keys (server-side built-in + configured channelKeys), so a hash that maps to a known key (e.g. 0x11 → Public) is emitted with its real name and encrypted: false / a non-opaque group, instead of Encrypted (0x11). Alternatively, surface the server's configured/built-in key hashes to the client so decorateAnalyticsChannels can de-opaque them like browser-stored keys.

Environment

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