TimelordUK / jspurefix

native typescript FIX engine
MIT License
58 stars 27 forks source link

1.2.0 fixup 2 #21

Closed NiklasZ closed 2 years ago

NiklasZ commented 2 years ago

Hi again,

This is the 2nd batch of fixes I wanted to write. They are as follows:

Omit tags with empty string values https://github.com/TimelordUK/jspurefix/commit/752920fda2560316e90aaed3c2fda7572970608a

Effectively, this omits empty value tags like 57=|. Here an example:

// Before
8=FIX4.2|9=0000085|35=A|49=init-comp|56=accept-comp|34=1|57=|52=20210803-07:16:14.167|98=0|108=30|141=Y|10=119|
// After
8=FIX4.2|9=0000081|35=A|49=init-comp|56=accept-comp|34=1|52=20210803-08:50:55.870|98=0|108=30|141=Y|10=206|

The reason for this is, that a counterparty is rejecting fields with empty values because it considers them malformed. This is in accordance with the standard: https://www.fixtrading.org/standards/tagvalue-online/.

Duplicate header fields on resend https://github.com/TimelordUK/jspurefix/commit/fa39d3e9a05a1bf0520265c768bbfbf3560138c8

When resending an old FIX message some header fields (34 and 43) are duplicated. Example:

// Before
8=FIX4.2|9=0000160|35=D|49=init-comp|56=accept-comp|34=3|57=|43=Y|52=20210803-07:16:14.228|34=3|43=Y|11=initiator-order-id|21=2|55=dummy ticker|54=2|60=20210803-07:16:14.220|40=2|10=120|
// After
8=FIX4.2|9=0000146|35=D|49=init-comp|56=accept-comp|34=3|43=Y|52=20210803-08:50:55.933|11=initiator-order-id|21=2|55=dummy ticker|54=2|60=20210803-08:50:55.922|40=2|10=016|
TimelordUK commented 2 years ago

Great fixes thanks. I will release in next few days.