Refactor Reaction Grouping and Enhance Traceroute Responses#18
Open
tylerpieper wants to merge 3 commits into
Open
Refactor Reaction Grouping and Enhance Traceroute Responses#18tylerpieper wants to merge 3 commits into
tylerpieper wants to merge 3 commits into
Conversation
Contributor
Author
Additional PR Change: Increase Message History Retention for ReactionsContextSlipping in an extra bug fix for this PR before code review: someone noticed that reactions sent to messages a few hours old were not attaching to their original Discord messages. Instead, they were showing up as standalone new messages. Root CauseThe FixIncreased the
|
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.
Refactor Reaction Grouping and Enhance Traceroute Responses
This PR introduces two quality-of-life improvements to the Meshtastic Discord Bridge, aimed at reducing channel clutter and making information easier to read at a glance.
What's Changed
1. Emoji Reaction Grouping
Previously, when multiple nodes reacted with the same emoji, the bridge would append a new line for each reaction (e.g.
👍 - [abc1],👍 - [def2]).Reactions are now grouped by emoji on a single line, and the list of lines is sorted natively so numbers or identical emojis stay clustered and consistent.
2. Traceroute Reply Correlation
Previously, outbound traceroutes and their corresponding replies were handled as independent events, which could lead to multiple separate messages in the channel for a single trace.
With this update:
request_id) to the outbound request, fetches the original Discord message, and edits the embed to indicate completion.RouteDiscoverypayload on the reply and extracts the forwardroutearray. It translates node numbers to short names (if available in the DB) and adds aRoute Takenfield to the original embed (e.g.,NodeA → NodeB → NodeC).To correlate inbound traceroute replies to the original outbound Discord messages, this PR adds a
discord_message_idcolumn to thetraceroutetable inmeshtastic.db.I've included a resilient migration step in the
setup_database()method that utilizesALTER TABLEwithin atry/exceptblock to seamlessly upgrade existing databases without any manual intervention or breakage.