fix(mesh): Set from field in locally handled packets#4543
Merged
Conversation
This commit ensures that the `from` field is correctly populated in `MeshPacket` instances that are generated and handled locally by the device. Specifically, the changes are: - In `MeshHistoryManager`, the `from` field is set to `myNodeNum` for store-and-forward requests. - In `MeshCommandSender`, the `from` field is set using `nodeManager?.myNodeNum` when creating various mesh packets. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit enhances debugging by re-enabling a log message that was previously commented out. The new log message, now at the `debug` level, records the insertion of a mesh packet into the database. To provide more context, the log message now includes the sender's node ID (`fromNum`), in addition to the message type and a one-line representation of the raw message. This helps in tracing the origin of packets during debugging. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4543 +/- ##
=======================================
Coverage ? 14.43%
=======================================
Files ? 424
Lines ? 14518
Branches ? 2411
=======================================
Hits ? 2095
Misses ? 12119
Partials ? 304 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes several improvements to how mesh packets are constructed and logged, ensuring that the sender information is correctly set and enhancing debug logging for packet handling.
Enhancements to packet construction:
MeshPacketcreation inMeshCommandSender.ktto explicitly set thefromfield using the current node number, ensuring accurate sender identification in outgoing packets.MeshPacketcreation inMeshHistoryManager.ktto include thefromfield with the current node number, improving consistency in packet metadata.Logging improvements:
PacketHandler.ktto include the sender node number (fromNum) when logging packet insertion, providing more detailed information for troubleshooting.