Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph Infrastructure Overhaul #434

Closed
wants to merge 19 commits into from
Closed

Conversation

ajmcquilkin
Copy link
Member

@ajmcquilkin ajmcquilkin commented Aug 13, 2023

This PR overhauls the graph management infrastructure of the client. Generally these changes are intended to support the new neighbor information infrastructure being developed into the firmware, but this PR is also intended to generally clean up the legacy graph code.

This PR does the following:

  • Updates the protos tag to v2.2.0
  • Implements a MeshGraph struct that wraps the Graph struct
  • Includes an edge and node timeout priority queue (inverted, low number -> high priority)
  • Adds a handling flow for the new NeighborInfo packet, which adds nodes and edges to the graph and queues them to time out based on the received node.node_broadcast_interval_secs field
  • Updates the timeout time of nodes and edges when new NeighborInfo packets are received, and due to the firmware waiting 2 * node.node_broadcast_interval_secs to time out nodes, nodes and edges will only time out when they haven't been heard from by the device in a significant amount of time
  • Adds a polling graph worker thread to purge timed out nodes and edges every 60s
  • Removes unused or legacy code (.unwrap -> Result specifically)
  • Added a new "Debug" tab group in the application sidebar
  • Add new "Application Graph" debug tab visualizing the current neighbor information held by the client
  • Added a "Neighbor Info" module configuration page
  • Fixed a bug where a position would be considered invalid if either (not both) the lat or long coordinate was 0.0
  • Listed neighbors for map active node pane

Closes #287

@ajmcquilkin ajmcquilkin added feature request Requesting functionality be added high priority This issue needs to be addressed quickly labels Aug 13, 2023
@ajmcquilkin ajmcquilkin self-assigned this Aug 13, 2023
@ajmcquilkin ajmcquilkin marked this pull request as ready for review August 14, 2023 03:27
// let neighbor_index = self.add_node(neighbor.into());
let neighbor_index = self.add_node(GraphNode::new(
neighbor.node_id,
// TODO this should be used once the firmware doesn't zero the internal value
Copy link
Member

Choose a reason for hiding this comment

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

I think the way to go is to loop through all neighbors that this node currently has, and remove those that are not in the newly incoming NeighborInfoPacket. That means they timed out in the firmware.

@jp-bennett
Copy link
Contributor

So far it looks like nodes only show up on the map when a Neighbors packet is received from that node. Simple location updates should be enough to put a node on the map.

@ajmcquilkin ajmcquilkin removed the high priority This issue needs to be addressed quickly label Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requesting functionality be added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to configure frequency of NeighborInfo packet
3 participants