Skip to content

Conversation

@jamesarich
Copy link
Collaborator

@jamesarich jamesarich commented Jan 5, 2026

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:

  • Bumping the database version to 28 and adding a new sfpp_hash column to the packet table to store the SFPP message hash.
  • Introducing a new message status, SFPP_CONFIRMED, and a corresponding link icon in the UI to indicate when a message has been confirmed on the SFPP chain.
  • Added hash calculation and packet lookup by hash
  • Implementing the logic to update a packet's status to SFPP_CONFIRMED upon receiving a CANON_ANNOUNCE and matching the hash of the SFPP message.

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>
@github-actions github-actions bot added the enhancement New feature or request label Jan 5, 2026
@jamesarich jamesarich requested a review from jp-bennett January 5, 2026 18:15
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (d4816a9) to head (07af955).
⚠️ Report is 6 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

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>
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich jamesarich marked this pull request as draft January 6, 2026 15:14
@jamesarich
Copy link
Collaborator Author

Passing this off to @mdecourcy since they can actually test against SFPP infrastructure

@jamesarich jamesarich marked this pull request as ready for review January 6, 2026 18:52
# 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>
@jamesarich jamesarich changed the title feat: Add SFPP confirmed status to Messages feat: Add SFPP confirmed status to Messages and Reactions Jan 8, 2026
@jamesarich jamesarich added this pull request to the merge queue Jan 8, 2026
Merged via the queue into main with commit 782c068 Jan 8, 2026
7 checks passed
@jamesarich jamesarich deleted the feat/sfpp2 branch January 8, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants