PacketRepository
Repository interface for managing mesh packets and message history.
This component provides methods for persisting received packets, querying message history, tracking unread counts, and managing contact-specific settings. It supports both reactive (Flow) and one-shot (suspend) queries.
Functions
Atomically resolves and conditionally applies a queue-stage packet status, returning the pre-update row. Returns null when the row is not persisted yet or when the mesh identity matches more than one row.
Atomic reaction equivalent of applyOutgoingQueueStatus. Returns null when no non-received reaction row carries packetId or when packetId matches more than one such row.
Atomically claims a stable row for sending. A returned packet with QUEUED status is owned by this caller and has already been persisted as ENROUTE; another status means the row was already handled.
Legacy equivalent of claimQueuedPacket, available only when the mesh packet ID identifies exactly one row.
Clears the unread status for all messages across all conversations.
Clears all packet and message history from the database.
Clears the unread status for messages in a conversation up to the given timestamp.
Deletes all messages and settings for the given contacts.
Deletes messages by their database UUIDs.
Deletes a waypoint by its ID.
Finds all packets matching a specific packet ID.
Finds all reactions associated with a specific packet ID.
Reactive flow of all conversation contacts, keyed by their contact identifier.
Reactive flow of all contact settings (e.g., mute status).
Returns the settings for a specific contact.
Reactive paged flow of conversation contacts, each paired with its stored contact key.
Returns all sent packets still awaiting a routing ACK/NAK, including stable persisted-row identities.
Returns all sent reactions still awaiting a routing ACK/NAK, including stable persisted-row identities.
Returns the total count of filtered messages for a contact.
Reactive flow of the number of filtered messages for a contact.
Reactive flow of the UUID of the first unread message in a conversation.
Returns the total number of messages in a conversation.
Returns a paged flow of messages for a conversation.
Returns a paged flow of messages for a conversation, with filtering options.
Returns a packet by its internal database ID.
Returns a packet by its mesh-layer packet ID.
Returns a packet by mesh-layer ID only when exactly one row has that ID in the current node database.
Returns exactly one persisted packet row by its node-scoped database identity.
Returns all packets currently queued for transmission, including their stable persisted-row identities.
Returns a reaction associated with a specific packet ID.
Returns the count of unread messages in a conversation.
Reactive flow of the unread message count in a conversation.
Reactive flow of the total unread message count across all conversations.
Reactive flow of all persisted waypoints (GPS locations).
Reactive flow indicating whether a conversation has any unread messages.
Persists a message reaction (emoji).
Returns a conversation to unread: flips its newest message back and rewinds the read watermark past it.
Resolves the single persisted row matching an outgoing mesh packet without changing its status. Returns null when the row is not present yet or the available packet identity is ambiguous.
Restores the exact row to QUEUED only if it is still ENROUTE, without overwriting a racing ACK/NAK status.
Persists a packet in the database.
Disables or enables message filtering for a specific contact.
Persists unsent composer text for contactKey so it survives leaving the screen, and shows in the list.
Persists the on-device translation of a message and switches it to display the translation.
Mutes the given contacts until the specified timestamp.
Toggles whether a translated message displays the translation or the original text.
Atomically marks a still-MessageStatus.ENROUTE packet as failed with routingError, leaving it untouched if an ACK/NAK already resolved it.
Atomically marks a still-MessageStatus.ENROUTE reaction as failed with routingError, leaving it untouched if an ACK/NAK already resolved it.
Updates an existing packet in the database, optionally setting a routing error code.
Marks all messages from a specific sender as filtered or unfiltered.
Updates the identifier of the last read message in a conversation.
Updates the identifier of a persisted packet.
Updates the transmission status of a packet.
Updates exactly one persisted packet row without relying on its mesh packet ID.
Updates the single persisted row matching an outgoing mesh packet and returns its stable identity. Returns null when the row has not been persisted yet or when the mesh identity is ambiguous, so callers can retry without updating the wrong packet.
Updates an existing reaction.
Updates the Store-and-Forward PlusPlus (SFPP) status for packets.
Updates the SFPP status of packets matching the given commit hash.