fix: channel database no longer shadows device channels with same PSK#2415
fix: channel database no longer shadows device channels with same PSK#2415
Conversation
When a Channel Database entry had the same PSK as a device channel, server-decrypted messages were assigned to the database channel instead of the device channel, making them appear in the wrong chat window. Now when server-side decryption matches a database channel, we check if any device channel (0-7) has the same PSK. If so, the message is assigned to the device channel slot, preventing the database channel from "stealing" traffic meant for the device channel. The database channel still gets decryption credit (counter incremented) and the encrypted packet is still forwarded to the physical node. Fixes #2413, fixes #2375 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Channel Database Shadowing FixReviewing this pull request for code quality, potential bugs, performance considerations, security concerns, and test coverage. Todo List
Code Review SummaryThis PR addresses a legitimate shadowing bug where database channels with the same PSK as device channels would intercept messages. The fix is well-implemented and follows existing patterns in the codebase. ✅ Code Quality & Best Practices
✅ Bug Analysis
✅ Performance Considerations
✅ Security Assessment
|
…el views When PSK matches a device channel, primary message goes to device channel and a copy goes to the database channel. When no device channel match, primary goes to database channel with a copy to the radio channel. Both views always show the message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: Channel Database Shadowing FixReviewing this pull request for code quality, potential bugs, performance considerations, security concerns, and test coverage. Todo List
Code Review SummaryThis PR addresses a legitimate shadowing bug where database channels with the same PSK as device channels would intercept messages. The fix is well-implemented and follows existing patterns in the codebase. ✅ Code Quality & Best Practices
✅ Bug Analysis
✅ Performance Considerations
✅ Security Assessment
|
|
verified on 3.10.0 release, working perfectly |
Summary
Fixes the Channel Database "shadowing" bug where a database channel with the same PSK as a device channel would intercept all incoming messages, causing them to appear in the database channel view instead of the device channel.
Root cause: When server-side decryption matched a database channel, the message was always assigned to
CHANNEL_DB_OFFSET + dbChannelId, even when a device channel had the identical PSK. This caused MQTT-proxied messages to show in the database channel chat window instead of the device channel.Fix: After server-side decryption, check if any active device channel (0-7) has the same PSK as the matched database channel. If so, assign the message to the device channel slot instead. The database channel still gets decryption credit (counter incremented) and the encrypted packet is still forwarded to the physical node unchanged.
Fixes #2413, fixes #2375
Changes
src/server/meshtasticManager.tsTest plan
npx vitest run— 3070 tests passnpm run build— no TypeScript errors🤖 Generated with Claude Code