Skip to content

Conversation

@Mukikaizoku
Copy link
Collaborator

Noticed issues with reading messages off of a DataReceivedEventArgs object. When removing a message internally, the top most reader will be able to continue reading additional "non-existent" messages off of the MessageReader

Example, assuming evt.Message only contains a top-level message:

MessageReader parentReader = evt.Message;
MessageReader firstMessage = parentReader.ReadMessage();
// Then remove message in a sub message within firstMessage
MessageReader secondMessage = parentReader.ReadMessage();
// secondMessage appears to exist, with default values (0)

During investigation, the issue was traced to the Length of the parent message not being updated during the recursive AdjustLength() calls along the RemoveMessage path

This PR fixes the issue

@Mukikaizoku Mukikaizoku merged commit f434ddb into main Apr 7, 2025
5 checks passed
@Mukikaizoku Mukikaizoku deleted the mik/fix-remove-message branch April 7, 2025 15:14
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.

3 participants