fix: MsgBunch not firing after Msg sometimes#8259
Draft
WofWca wants to merge 1 commit into
Draft
Conversation
Closes #8232. `receive_imf_inner`, and thus its only caller `fetch_many_msgs`, seems to be the main function, apart from `add_device_msg_with_importance` and `handle_call_msg`, that fires `IncomingMsg` events. However, `fetch_many_msgs` gets called in two places, only one of which fires `IncomingMsgBunch`. Let's fix that by moving `IncomingMsgBunch` to inside of `fetch_many_msgs`.
Collaborator
Author
|
Hmmm the errors seem legit though they're in a completely different place. Guess that could be caused by my closure usage? Weird. |
iequidoo
reviewed
May 23, 2026
| Ok(msg) => msg, | ||
| }; | ||
| received_msgs_channel | ||
| .send((request_uid, received_msg)) |
Collaborator
There was a problem hiding this comment.
This is the only place where Some is passed to received_msgs_channel, so there's no need in on_msg_received closure, you can just set some flag here and then emit EventType::IncomingMsgBunch right from this function if the flag is set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8232.
receive_imf_inner, and thus its only callerfetch_many_msgs,seems to be the main function,
apart from
add_device_msg_with_importanceandhandle_call_msg,that fires
IncomingMsgevents.However,
fetch_many_msgsgets called in two places,only one of which fires
IncomingMsgBunch.Let's fix that by moving
IncomingMsgBunchto inside of
fetch_many_msgs.Edit: I got some help from AI to write the
impl AsyncFnMut(u32, Option<ReceivedMsg>) -> Result<()>part, but the rest is mine.