[BUG] Meshcore 4.14.0 - wrong path report in (some) Direct Messages
- please fix wrong path report in (some) Direct Messages
- fix LAST_HEARD time displayed
Thanks for the report! I checked for duplicates and didn't find an exact match — closest related issues are #4474 (path/hops disappearing on older messages) and #4517 (trace-path race condition), but neither describes this behavior, so I'm treating this as new. Classifying as a Bug Report.
I looked at the attached screenshot closely and found two separate things going on:
1. "Wrong path report" — HOPS AWAY / PATH in Contact Details vs. the message's own "direct" tag
The message from Cupid_stunt is correctly tagged direct · SNR 12.5 dB · RSSI -45 dBm (0 hops) — that comes straight from the actual radio reception of that packet. The Contact Details panel below it, however, shows HOPS AWAY: 4 hops / PATH: 3ed6,86f1,92db,d450.
These are two different, intentionally-separate things:
- The per-message "direct"/hop tag reflects how that specific packet arrived (from LogRxData).
- The Contact Details "Hops Away"/"Path" fields reflect the cached outbound route MeshMonitor would use to send to this contact — not the inbound route of any particular message. This split is deliberate (see the code comment referencing #3742) because falling back to the outbound path for a message's route would be misleading in the other direction.
So a contact can legitimately show "4 hops" in its cached routing path while a given message from it arrived direct — that's expected if the companion hasn't re-run path discovery recently, not necessarily a bug. If what you actually expected is "HOPS AWAY should drop to 0 immediately after a direct reception, since we now know a shorter route exists," that would be a feature request rather than a bug fix — let me know if that's the behavior you're after and I can scope it separately.
2. "LAST_HEARD time displayed" wrong — this one is a real bug, and I've fixed it
You're right that this is wrong: Cupid_stunt had just sent a message (and gotten a reply) at 1:04 AM, yet Last Heard and Last Advert both showed "1 day ago". Root cause: the sender contact's lastSeen (which drives "Last Heard") was only ever updated on contact_advertised push events or the next refreshContacts() poll — a plain incoming direct message never touched it. So between adverts, Last Heard could go stale even while you're actively chatting with that contact.
I've pushed a fix in src/server/meshcoreManager.ts that bumps the sender contact's lastSeen to "now" whenever a direct message (contact_message event) arrives from a known contact, using the same update/persist/emit pattern already used for adverts. It deliberately leaves the cached outPath/pathLen (item 1, above) untouched, since those represent something different. Added regression tests in src/server/meshcoreManager.dmLastHeard.test.ts.
PR: I have begun work on this issue, in branch claude/vibrant-volta-1tuloe. Opening the PR now — will keep it in draft-review status (not merging) and will address any CI feedback.
-- Authored by Roger 🤓
Generated by Claude Code
- ALL messages are coming to the Companion from/through the Repeater who is ...5m away :)
- so a hop path list " that comes straight from the actual radio reception of that packet" does not make any sense to be displayed at all in the DM chat !
How far away is the Cupid node from you? And is it a high powered or well positioned node?
What makes you think your node did not receive the message directly? If your repeater did from 5m away, it's very possible your node did as well.