Skip to content

Private channel inbound messages route to LongFast after dashboard channel save #89

Description

@KMX415

Summary

After adding a private Meshtastic channel via Configuration → Channels, inbound messages on that channel appear in the LongFast conversation in the Messages tab, even though decryption works. Outbound to the same channel works on peer devices (e.g. L1 tracker).

Reported on v0.7.6 by Gus (Discord).

Steps to reproduce

  1. Fresh start with only default LongFast, or remove meshtastic.channel_keys from local.yaml and restart.
  2. Add a private channel (name + 256-bit PSK) via Configuration → Channels and Save (no service restart).
  3. From another node on the same private channel (second Meshpoint or L1), send a broadcast message.
  4. On the receiving Meshpoint, open Messages: message lands under LongFast instead of the private channel row.

Contrast: Restart after step 2, or configure the channel only in local.yaml before first boot: routing works.

Expected

Inbound private-channel broadcasts route to broadcast:meshtastic:1 (or the correct channel index) matching /api/messages/channels.

Actual

Inbound packets decrypt but node_id is stored as broadcast:meshtastic:0 (LongFast).

Root cause

channel_hash_map in _setup_message_interception (src/api/server.py) is built once at startup. PUT /api/config/channels updates live crypto keys but does not rebuild the map. Lookup falls back to index 0:

ch_idx = channel_hash_map.get(packet.channel_hash, 0)

TX uses TxService._resolve_channel, which reads current _crypto state, so outbound hashing is correct.

Workaround

Restart the service after saving channels on the dashboard:

sudo systemctl restart meshpoint

Proposed fix

  • Small ChannelHashResolver class with rebuild(config, crypto) and lookup(hash).
  • Wire rebuild into update_channels after add_channel_key loop.
  • Unit tests for rebuild + routing.

Environment

  • v0.7.6
  • Meshtastic private channel (custom PSK)
  • Dashboard channel editor (not yaml-only setup)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions