Bug
When adding a hashtag channel via the + Add Channel button, the app writes
a row to the channels table but does not insert a corresponding row into
channel_secrets. This causes any send attempt on the new channel to fail
with:
Send failed: Channel 'bot' not in provided channels_config
Steps to reproduce
- Launch the app and connect to the radio.
- Click
+ Add Channel and add a hashtag channel (e.g. #bot).
- Type a message and click Send.
- Observe the error above.
Root cause
Hashtag channel secrets are deterministically derived as:
sha256('#' + channel_name)[:32] (first 32 hex chars of SHA-256).
The + Add Channel handler writes to channels but skips channel_secrets,
so pyMC_core cannot find the encryption key at send time.
The #Public channel works because it has a hardcoded secret already present
in the DB from initial setup.
Workaround
Manually insert the derived secret:
import hashlib
name = "bot"
secret = hashlib.sha256(f"#{name}".encode()).hexdigest()[:32]
# INSERT INTO channel_secrets VALUES('bot', secret)
Fix
In the + Add Channel handler, after writing to channels, also insert into
channel_secrets:
secret = hashlib.sha256(f"#{channel_name}".encode()).hexdigest()[:32]
# INSERT OR IGNORE INTO channel_secrets (name, secret) VALUES (?, ?)
Environment
- meshcore-uconsole on ClockworkPi uConsole CM5 (HackerGadgets AIO v2)
- Verified algorithm against known value: sha256("#chicago")[:32] ==
c1c289b131e5222370cbc2048445844b ✓
Bug
When adding a hashtag channel via the
+ Add Channelbutton, the app writesa row to the
channelstable but does not insert a corresponding row intochannel_secrets. This causes any send attempt on the new channel to failwith:
Steps to reproduce
+ Add Channeland add a hashtag channel (e.g.#bot).Root cause
Hashtag channel secrets are deterministically derived as:
sha256('#' + channel_name)[:32](first 32 hex chars of SHA-256).The
+ Add Channelhandler writes tochannelsbut skipschannel_secrets,so pyMC_core cannot find the encryption key at send time.
The
#Publicchannel works because it has a hardcoded secret already presentin the DB from initial setup.
Workaround
Manually insert the derived secret:
Fix
In the
+ Add Channelhandler, after writing tochannels, also insert intochannel_secrets:Environment
c1c289b131e5222370cbc2048445844b ✓