fix(meshcore): buffer GRP_TXT path so {ROUTE}/{SNR} resolve on routed channel messages (#3710)#3737
Conversation
… channel messages (#3710) The #3710 fix (correlating the LogRxData path by hop count) made {ROUTE}/{SNR} work on routed DMs, but users still saw "—" on hashtag/private channel messages — DMs consistent, channels "hit or miss". Root cause: the LogRxData handler buffers the relay-hash chain + SNR only for TXT_MSG (0x02) packets. DMs are TXT_MSG, but channel/group messages ride GRP_TXT (0x05) and surface as ChannelMsgRecv. Their path was therefore never buffered, so consumePendingPath() found nothing and {ROUTE}/{SNR} fell through. The intermittent "hit" was a coincidental stale TXT_MSG buffer (from a recent DM) whose hop count happened to match the channel message's. Fix: buffer the path for GRP_TXT as well as TXT_MSG. ChannelMsgRecv carries a plain hop count (pathLen), so the existing freshness + hop-count correlation guards (issue #3589/#3710) apply unchanged. GRP_DATA (0x06) is deliberately excluded — it isn't a text message and emits no ChannelMsgRecv. Tests: the two existing channel_message tests built a TXT_MSG (0x02) packet then fired ChannelMsgRecv, so a stale-buffer match masked the bug — corrected to GRP_TXT (0x05) so they are real regression guards. Added a dedicated #3710 test asserting a routed GRP_TXT channel message attaches its path + SNR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011JEaCGwY9Wz8jeV4e22GW4
|
Claude finished @Yeraze's task —— View job PR Review
SummaryThis is a clean, well-scoped bugfix. The root cause diagnosis is correct and the fix is minimal. Code Review:
|
…eader comment Addresses the two non-blocking notes from the Claude review of #3737: - Add the missing matrix case: a direct (pathLen 0xff) GRP_TXT channel message buffers an empty hop list and still carries SNR. - Refresh the file header comment to mention GRP_TXT/ChannelMsgRecv alongside TXT_MSG/ContactMsgRecv (was stale after the buffering change). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011JEaCGwY9Wz8jeV4e22GW4
|
Thanks — addressed both non-blocking notes in 0bfe7fe:
The core implementation points you raised needed no change (correct, GRP_DATA rightly excluded, guards preserved). |
|
Claude finished @Yeraze's task —— View job PR Review
SummaryThe previous feedback has been fully addressed. This PR is ready to merge. New commit (0bfe7fe) reviewDirect-path test ( Updated file header comment (
Accurate and complete. Test coverage matrix is now complete:
No issues. The implementation is correct, the tests are comprehensive, and the documentation is accurate. |
Reopens/continues #3710 — the prior fix (#3715) did not fully resolve it.
Why #3715 wasn't enough
#3715 fixed the hop-count correlation so
{ROUTE}/{SNR}resolved on routed DMs. But users kept reporting—on hashtag/private channel messages — and the tell was "DMs consistent, channels hit or miss" (issue comments, still reproducing on v4.11.6).Root cause
The
LogRxDatahandler buffers the relay-hash chain + SNR only forTXT_MSG(0x02) packets:DMs are
TXT_MSG, but channel/group messages rideGRP_TXT(0x05) and surface asChannelMsgRecv. Their path was never buffered, soconsumePendingPath()returned nothing and{ROUTE}/{SNR}fell through to—. The intermittent "hit" was a coincidental staleTXT_MSGbuffer (from a recent DM) whose hop count happened to match — hence "hit or miss" on busy channels, consistent on DMs.This also explains why both hashtag and private channels failed identically: both are group messages on the wire.
Fix
Buffer the path for
GRP_TXTas well asTXT_MSG.ChannelMsgRecvcarries a plain hop count (pathLen), so the existing freshness + hop-count correlation guards (#3589 / #3710) apply unchanged.GRP_DATA(0x06) is deliberately excluded — it isn't a text message and emits noChannelMsgRecv.Tests
channel_messagetests were masking the bug — they built aTXT_MSG(0x02) packet then firedChannelMsgRecv, so the TXT_MSG buffer fed them and they passed. Corrected toGRP_TXT(0x05) so they're real regression guards (they fail without this fix).GRP_TXTchannel message attaches its path + SNR.491 MeshCore backend/manager tests pass (
success=true);tscclean for the changed file.🤖 Generated with Claude Code