-
-
Notifications
You must be signed in to change notification settings - Fork 364
feat: Add SFPP confirmed status to Messages and Reactions #4139
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
Merged
+2,699
−61
Conversation
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
This commit introduces support for tracking the "Store Forward Plus Plus" (SFPP) confirmed status of messages. Changes include: * Adding a new `SFPP_CONFIRMED` state to `MessageStatus`. * Including an `sfppHash` field in the `DataPacket` model and `Packet` database entity. * Bumping the database version to 28 with an auto-migration. * Implementing logic in `MeshDataHandler` to update a packet's status to `SFPP_CONFIRMED` upon receiving a corresponding link confirmation. * Adding a new `Link` icon in the messaging UI to visually represent the `SFPP_CONFIRMED` status. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit introduces persistence for the SFPP (Simple Forwarding Plugin Protocol) hash and status. - Adds an `sfpp_hash` column to the `Packet` entity to store the SFPP hash. - Implements `SFPP_CONFIRMED` in `MessageStatus` to track acknowledged packets. - Includes new database tests to verify the persistence of the `sfpp_hash`, the ability to find packets by their ID, and the logic for updating a packet's status to `SFPP_CONFIRMED`. - Adds unit tests for `DataPacket` to ensure `sfppHash` is handled correctly during serialization. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4139 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 2 2
Lines 19 19
Branches 7 7
=====================================
Misses 19 19 ☔ View full report in Codecov by Sentry. |
This commit introduces a new message status, `SFPP_ROUTING`, to indicate when a message is being routed or buffered within the Store and Forward Plus Plus (SF++) system. The changes include: - Adding the `SFPP_ROUTING` state to the `MessageStatus` enum. - Updating the `MeshDataHandler` to set the `SFPP_ROUTING` status for the first half of a link-provide message and `SFPP_CONFIRMED` for the second half. - Adding a check in `PacketRepository` to prevent downgrading a message status from `SFPP_CONFIRMED` back to `SFPP_ROUTING`. - Incorporating new UI elements, including an `AddLink` icon and corresponding string resources, to visually represent the `SFPP_ROUTING` status. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit introduces several enhancements to the Store and Forward Plus Plus (SF++) message handling: - Adds an `SfppHasher` utility to compute message hashes from the payload and packet metadata, aligning with firmware hash calculation logic. - Implements `updateSFPPStatusByHash` in `PacketRepository` to update message status using the SF++ hash, supported by a new DAO query `findPacketBySfppHash`. - Refines `MeshDataHandler` to use the new `SfppHasher` for `LINK_PROVIDE` messages and differentiate status based on whether a `commitHash` is present. - Updates the message status and receive time (`rxTime`) for `LINK_PROVIDE` and `CANON_ANNOUNCE` message types. - Updates the `updateSFPPStatus` repository method to also update the packet's receive time. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Collaborator
Author
|
Passing this off to @mdecourcy since they can actually test against SFPP infrastructure |
# Conflicts: # core/database/schemas/org.meshtastic.core.database.MeshtasticDatabase/28.json
This commit enhances the Store and Forward Plus Plus (SFPP) feature to include message reactions. Key changes: - Bumps the database version to 29 and adds a new schema. - Adds an `sfpp_hash` column to the `reactions` table to track their delivery status. - Modifies `PacketRepository` to update the status of reactions alongside their corresponding messages based on packet ID or SFPP hash. - Implements `findReactionBySfppHash` in `PacketDao` to query for reactions using their SFPP hash. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit significantly improves support for message reactions across multiple devices using the same node. It addresses inconsistencies in how reactions were stored, sent, and displayed. Key changes: - **feat**: Add `myNodeNum` to the primary key of the `reactions` table. This allows reactions from different devices for the same node to be stored distinctly. - **fix**: Refactor reaction handling logic to correctly associate sent and received reactions with the specific device (`myNodeNum`). - **fix**: Ensure sent reactions are stored with `myNodeNum` to prevent conflicts. - **fix**: Update reaction queries to filter by the current device's `myNodeNum`, preventing reactions from other devices from being displayed as local. - **refactor**: Remove the redundant `reply_id` column from the `packet` table. - **build**: Bump the database version to 30 and add the corresponding schema migration. - **test**: Add unit tests for SFPP hash generation to ensure consistency. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
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.
As mentioned in #4136 (comment) we should be able to see our Message added to the
chain.This aims to add support for tracking the confirmation status of Messages within the StoreForwardPlusPlus (SFPP) protocol.
This includes:
sfpp_hashcolumn to thepackettable to store the SFPP message hash.SFPP_CONFIRMED, and a corresponding link icon in the UI to indicate when a message has been confirmed on the SFPP chain.SFPP_CONFIRMEDupon receiving aCANON_ANNOUNCEand matching the hash of the SFPP message.