Skip to content

Use Hops away value for DM's#1409

Merged
garthvh merged 2 commits into
2.7.3from
HopsAway_DMs
Sep 17, 2025
Merged

Use Hops away value for DM's#1409
garthvh merged 2 commits into
2.7.3from
HopsAway_DMs

Conversation

@garthvh

@garthvh garthvh commented Sep 16, 2025

Copy link
Copy Markdown
Member

Set hopLimit for DM messages (DM's and Exchange position) to the hopsAway value for the node you are sending to.

… away value for the node you are sending to.
@garthvh garthvh requested a review from Copilot September 16, 2025 23:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sendPosition function to accept an optional hopsAway parameter with default value of 0
  • Modified message creation logic to set hopLimit when hopsAway > 0 for both position messages and general DMs
  • Updated ExchangePositionsButton to pass the node's hopsAway value 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.

Comment thread Meshtastic/Accessory/Accessory Manager/AccessoryManager+ToRadio.swift Outdated
…o.swift

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@garthvh garthvh merged commit df2ed96 into 2.7.3 Sep 17, 2025
1 of 2 checks passed
@garthvh garthvh deleted the HopsAway_DMs branch September 17, 2025 00:12
@nullrouten0

Copy link
Copy Markdown

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.

@DaneEvans

Copy link
Copy Markdown

So, no moving around I take it?

As far as unilateral poor decisions go, this is one of them

@jschrempp

Copy link
Copy Markdown

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.

@thebentern

Copy link
Copy Markdown
Collaborator

Right, something analogous to Math.max(lora.hop_limit, node.hops_away) is what would work best

garthvh added a commit that referenced this pull request Sep 18, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants