Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve original body when resending #624

Merged
merged 2 commits into from
Apr 16, 2024
Merged

Conversation

mgatny
Copy link
Member

@mgatny mgatny commented Apr 15, 2024

refs #608 #568

This is a workaround for the fact that we currently rely on the generated Message types to properly serialize/deserialize RepeatingGroups.

In other words, we cannot go from bytes to a Message then back to bytes, which is exactly what we need to do in the case of a Resend.

This adds the Message.buildWithBodyBytes([]byte) func that lets us pull the Message from the Store, parse it, update the Header, and then build it back into bytes using the original Body.

Stay tuned for a more complete solution that fully solves the problem beyond just Resend.

Note: The only standard non-Body group is NoHops. If that is used in the Header, this workaround may fail.

This is a workaround for the fact that we currently rely on the
generated Message types to properly serialize/deserialize
RepeatingGroups.

In other words, we cannot go from bytes to a Message then back to bytes,
which is exactly what we need to do in the case of a Resend.

This adds the Message.buildWithBodyBytes([]byte) func that lets us pull
the Message from the Store, parse it, update the Header, and then build
it back into bytes using the original Body.

Note: The only standard non-Body group is NoHops.  If that is used in
the Header, this workaround may fail.
Previously, the bodyBytes was ending up with the trailer in it when the
body contained no fields, and trailerBytes was empty
@ackleymi ackleymi merged commit dc22c5d into quickfixgo:main Apr 16, 2024
38 of 39 checks passed
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