Skip to content

Comments

Mark pending channel messages sent on RESP_CODE_SENT#186

Draft
Specter242 wants to merge 2 commits intozjs81:mainfrom
Specter242:feature/channel-ack-sent-status
Draft

Mark pending channel messages sent on RESP_CODE_SENT#186
Specter242 wants to merge 2 commits intozjs81:mainfrom
Specter242:feature/channel-ack-sent-status

Conversation

@Specter242
Copy link
Contributor

Problem

Outgoing channel messages can remain in a pending state even after the app receives RESP_CODE_SENT, especially in sparse/public-channel paths where echo timing is delayed.

Solution

  • On RESP_CODE_SENT, mark the most recent pending outgoing channel message as sent
  • Persist the status update in channel message storage
  • Preserve existing direct-message fallback behavior

Scope

  • lib/connector/meshcore_connector.dart only
  • No firmware protocol changes
  • No workspace/tooling/rules file changes

Validation

  • flutter analyze passes
  • flutter test passes

Closes #185

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d270683d25

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (_retryService != null) {
_retryService!.updateMessageFromSent(ackHash, timeoutMs);
}
_markMostRecentPendingChannelMessageSent();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict channel sent updates to channel ACKs

_handleMessageSent now calls _markMostRecentPendingChannelMessageSent() for every full RESP_CODE_SENT, but those responses are also used for direct messages. If a user has any pending outgoing channel message and then sends a direct message, the direct-message ACK will incorrectly flip that channel message to sent even though no channel send confirmation was received, producing false delivery state in the channel UI/storage.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Updated in 96fb9ca: channel pending→sent is now gated so it only runs when RESP_CODE_SENT was not matched to a direct message and there are no pending direct retries. This prevents direct-message ACKs from flipping channel state.

Comment on lines 2486 to 2487
if (_markMostRecentPendingChannelMessageSent()) {
return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve direct fallback handling for short sent frames

In the legacy fallback path (frame.length < 10), returning immediately after marking a pending channel message means the previous direct-message fallback loop is skipped whenever any channel message is pending. On older firmware/protocol variants that emit short RESP_CODE_SENT frames, this leaves outgoing direct messages stuck in pending as long as a channel pending message exists.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 96fb9ca. I removed the early channel return from the short-frame fallback path; frame.length < 10 now preserves the original direct-message fallback loop so direct pending messages are still advanced on legacy short sent frames.

@Specter242
Copy link
Contributor Author

  1. 2.. 3... Hey, wait....

I need to switch to in progress as this is still not properly catching all acks.

@446564 446564 marked this pull request as draft February 19, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Channel messages can remain pending after RESP_CODE_SENT

1 participant