Skip to content

fix: Don't make message OutDelivered after successful resending to new broadcast member#8280

Merged
iequidoo merged 1 commit into
mainfrom
iequidoo/broadcast_resend_failed_msg_to_new_member
May 29, 2026
Merged

fix: Don't make message OutDelivered after successful resending to new broadcast member#8280
iequidoo merged 1 commit into
mainfrom
iequidoo/broadcast_resend_failed_msg_to_new_member

Conversation

@iequidoo
Copy link
Copy Markdown
Collaborator

Follow-up to 970222f. We shouldn't update the message state to OutDelivered if message sending failed before and the message was re-sent successfully only to a new broadcast member.

Replacement for #8155

@iequidoo iequidoo marked this pull request as ready for review May 27, 2026 22:40
@iequidoo iequidoo requested review from Hocuri and link2xt May 27, 2026 22:40
Comment thread src/message.rs
update_msg_state(context, self, MessageState::OutDelivered).await?;
/// Returns whether the message state is updated to `OutDelivered`.
pub(crate) async fn set_delivered(self, context: &Context) -> Result<bool> {
if context
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe add some comment that we are only updating from OutPending to avoid setting state for messages that are resent silently, which are currently broadcast messages.

For reference, corresponding broadcast logic that avoids setting OutPending (no need to reference it in the comment, it will get outdated easily, just for other reviewers):

core/src/chat.rs

Lines 4708 to 4712 in c26b6a0

// Broadcast owners shouldn't see spinners on messages being auto-re-sent to new
// subscribers (otherwise big channel owners will see spinners most of the time).
if to_fingerprint.is_none() {
message::update_msg_state(context, msg.id, MessageState::OutPending).await?;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added a comment that OutPending means that the message is (re-)sent to all chat members. Maybe there will be other cases when messages are only re-sent to a subset of chat members, so decided not to mention broadcasts.

…w broadcast member

Follow-up to 970222f. We shouldn't update the message state to `OutDelivered` if message sending
failed before and the message was re-sent successfully only to a new broadcast member.
@iequidoo iequidoo force-pushed the iequidoo/broadcast_resend_failed_msg_to_new_member branch from a4b8968 to 32c927d Compare May 29, 2026 03:32
@iequidoo iequidoo merged commit 9719aa1 into main May 29, 2026
25 checks passed
@iequidoo iequidoo deleted the iequidoo/broadcast_resend_failed_msg_to_new_member branch May 29, 2026 03:35
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.

2 participants