Skip to content

fix: Emit IncomingMsgBunch on receipt of large message w/o pre-message (#8232)#8273

Draft
iequidoo wants to merge 2 commits into
mainfrom
iequidoo/always-emit-IncomingMsgBunch
Draft

fix: Emit IncomingMsgBunch on receipt of large message w/o pre-message (#8232)#8273
iequidoo wants to merge 2 commits into
mainfrom
iequidoo/always-emit-IncomingMsgBunch

Conversation

@iequidoo
Copy link
Copy Markdown
Collaborator

@iequidoo iequidoo commented May 25, 2026

If a pre-message is lost or delayed, or doesn't exist at all, download_msg() adds a new message
instead of replacing an existing one. For simplicity, move emitting IncomingMsgBunch to
Session::fetch_many_msgs() so that this event is emitted also in the mentioned case, it's not a
problem if it's emitted when a pre-message was downloaded before.

Another commit adds a missing call of chat::mark_old_messages_as_noticed() in this case.

Fix #8232
Replacement for #8259

No tests yet, going to add JSON-RPC Python tests on unencrypted messages, haven't found any such tests.

iequidoo and others added 2 commits May 25, 2026 02:24
…age w/o pre-message

If a pre-message is lost or delayed, or doesn't exist at all, download_msg() adds a new message
instead of replacing an existing one. chat::mark_old_messages_as_noticed() must be called in this
case.
#8232)

If a pre-message is lost or delayed, or doesn't exist at all, download_msg() adds a new message
instead of replacing an existing one. For simplicity, move emitting IncomingMsgBunch to
Session::fetch_many_msgs() so that this event is emitted also in the mentioned case, it's not a
problem if it's emitted when a pre-message was downloaded before.

Co-authored-by: WofWca <wofwca@protonmail.com>
@iequidoo iequidoo force-pushed the iequidoo/always-emit-IncomingMsgBunch branch from 40f5f99 to 18673f8 Compare May 25, 2026 15:11
Comment thread src/download.rs
{
let _fetch_msgs_lock_guard = context.fetch_msgs_mutex.lock().await;
self.fetch_many_msgs(context, folder, vec![uid], &uid_message_ids, sender)
Box::pin(self.fetch_many_msgs(context, folder, vec![uid], &uid_message_ids, sender))
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.

clippy complained about a large future

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.

DC_EVENT_INCOMING_MSG sometimes not followed by DC_EVENT_INCOMING_MSG_BUNCH

1 participant