Use Hops away value for DM's#1409
Conversation
… away value for the node you are sending to.
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the hop limit behavior for direct messages (DMs) and position exchange messages by setting the hopLimit to the hopsAway value of the destination node, which should improve message routing efficiency by limiting unnecessary packet propagation.
- Updated
sendPositionfunction to accept an optionalhopsAwayparameter with default value of 0 - Modified message creation logic to set
hopLimitwhenhopsAway> 0 for both position messages and general DMs - Updated
ExchangePositionsButtonto pass the node'shopsAwayvalue when requesting position exchange
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ExchangePositionsButton.swift | Pass hopsAway parameter when calling sendPosition for position exchange requests |
| AccessoryManager+ToRadio.swift | Set hopLimit for DM messages based on destination node's hopsAway value |
| AccessoryManager+Position.swift | Add hopsAway parameter to sendPosition function and set hopLimit accordingly |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…o.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Path lengths are highly variable in our mesh …. and this change would introduce a problem. For example, you learn a Node info packet at 2 hops, but then it takes 6 to get there the next time…. this is an extremely common occurrence. I can do traceroute to the same destination 10 times in a row and get different hop counts ranging from 2-6 (and values in between) regularly. |
|
So, no moving around I take it? As far as unilateral poor decisions go, this is one of them |
|
I see this PR as a problem for the reasons cited above. I think a better approach is to only happen when hopsAway is greater than the configured hop limit. Sometimes I want to DM a node that has a hopsAway of 6, but my node has a configured hopLimit of 3. In this case I would like to have the hopLimit of the message I send be 6. So, change the hopLimit to the hopsAway value of the destination node when the hopsAway value is greater than the hopLimit; otherwise use the hopLimit. Stated another way: Use the configured hopLimit unless the hopsAway for the destination node is greater than hopLimit; in that case use hopsAway for the message. |
|
Right, something analogous to Math.max(lora.hop_limit, node.hops_away) is what would work best |
* Remove non functional module override button * Remove stale keys * Onboarding and lora config bug fixes * Add Annotations view and try and simplify online annimations to improve performance. * Bump version * Fix proto bug * Don't show ignored nodes on the mesh map * More node annotation animation improvements * Ham * Remove liquid glass form icon * Update MQTT config logic * Liquid glass chirpy and ham on the watch * Use Hops away value for DM's (#1409) * Set hopLimit for DM messages (DM's and Exchange position) to the hops away value for the node you are sending to. * Update Meshtastic/Accessory/Accessory Manager/AccessoryManager+ToRadio.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Icons * 🐰 * DataDog action logging (#1411) Co-authored-by: Jake-B <jake-b@users.noreply.github.com> * Update location usage details * Good doggo (#1414) * DataDog action logging * Filter version hash --------- Co-authored-by: Jake-B <jake-b@users.noreply.github.com> * Update Meshtastic/Views/Nodes/Helpers/Map/MapContent/MeshMapContent.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Helpers/LocationsHandler.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Views/Settings/Config/Module/MQTTConfig.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Meshtastic/Views/Nodes/Helpers/Map/MapContent/AnimatedNodePin.swift Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: jake-b <1012393+jake-b@users.noreply.github.com> Co-authored-by: Jake-B <jake-b@users.noreply.github.com>
Set hopLimit for DM messages (DM's and Exchange position) to the hopsAway value for the node you are sending to.