Skip to content

Companion ACKs a direct message that it then drops when the offline queue is full #3518

Description

@NdyGen

When the companion's offline queue is full (OFFLINE_QUEUE_SIZE, default 16) and holds no channel messages, addToOfflineQueue() drops the incoming direct message (examples/companion_radio/MyMesh.cpp, dev, lines 224-246). BaseChatMesh::onPeerDataRecv() still sends the ACK afterwards (src/helpers/BaseChatMesh.cpp, around lines 239-254), because onMessageRecv() returns void.

Result: the sender sees the message as delivered, but it never reaches the app. This happens when the phone is disconnected for a while and more than 16 DMs arrive.

Suggested fix, in increasing scope:

  1. Let onMessageRecv() return whether the message was stored, and only ACK when it was. The sender then retries later, as it would for an unreachable node.
  2. When the queue is full of DMs, evict other non-DM frames first, and only refuse (no ACK) as a last resort.
  3. Optionally, keep the offline queue in flash so a reboot or empty battery does not lose ACKed messages.

Related: #1834 (failed delivery shown but message received) is the inverse case; this one reports success while the message is lost.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions