Skip to content

Preserve original body when resending - #624

Merged
ackleymi merged 2 commits into
quickfixgo:mainfrom
mgatny:main
Apr 16, 2024
Merged

ackleymi merged 2 commits into
quickfixgo:mainfrom
mgatny:main

Conversation

@mgatny

@mgatny mgatny commented Apr 15, 2024

Copy link
Copy Markdown
Member

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
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