Skip to content

Add RequiresOrigSendingTime and honor ValidateFieldsHaveValues=N, as QuickFIX/n does - #801

Open
blairham wants to merge 2 commits into
quickfixgo:mainfrom
pinpredict:requires-orig-sending-time
Open

blairham wants to merge 2 commits into
quickfixgo:mainfrom
pinpredict:requires-orig-sending-time

Conversation

@blairham

@blairham blairham commented Nov 19, 2026 •

Copy link
Copy Markdown

Two session-validation settings brought in line with QuickFIX/n. Defaults are unchanged for both.

1. Add RequiresOrigSendingTime

Why

The FIX spec requires OrigSendingTime(122) whenever PossDupFlag(43)=Y. Some counterparties omit it on the SequenceReset (35=4) messages they replay during resync, where the field means little. QuickFIX/Go rejects every such message whose MsgSeqNum is lower than expected with 35=3 SessionRejectReason=1 RefTagID=122 (doTargetTooLow in in_session.go), and there is no setting to turn that off.

We hit this connecting to CDNA (Crypto.com | Derivatives North America, formerly Nadex) over FIXT.1.1. CDNA replays 35=4 with 43=Y and no 122 when it resyncs, and it tears the socket down 2 to 3 seconds after it receives our Reject. Our existing C# gateway avoids this with QuickFIX/n's RequiresOrigSendingTime=N.

What it does

Mirrors QuickFIX/n exactly (Session.DoPossDup, setting name RequiresOrigSendingTime, introduced for quickfixn issue 102):

  • Default Y: no behavior change.
  • With N, a SequenceReset that reaches the target-too-low path with PossDupFlag=Y is ignored without examining OrigSendingTime: no Reject when 122 is missing, and (as in QuickFIX/n, which returns before the comparison) no SendingTime accuracy check when it is present.
  • Every other message type keeps the current check: a PossDupFlag=Y message missing 122 is still rejected, and one whose OrigSendingTime is after its SendingTime is still rejected and logged out.

The flag is held internally as SkipOrigSendingTimeOnSequenceReset so the zero value keeps the current default, following the CheckLatency / SkipCheckLatency precedent.

2. Honor ValidateFieldsHaveValues=N when RejectInvalidMessage=Y

Why

ValidateFieldsHaveValues (added in #734) only reached the content pre-pass (validateFieldContent). With RejectInvalidMessage=Y, the per-field dictionary check (validateField) still rejected every empty value as Tag specified without a value, so ValidateFieldsHaveValues=N had no effect for a session that validates against a data dictionary. Our C# gateway to CDNA runs QuickFIX/n with ValidateFieldsHaveValues=N and full validation.

What it does

Mirrors QuickFIX/n (DataDictionary.CheckHasValue and CheckValidFormat):

  • Default Y: no behavior change.
  • With N, an empty value is not rejected for being empty, and is not checked against the field's type (an empty FLOAT or UTCTIMESTAMP is the application's to interpret).
  • An empty value for a tag that is not defined is still rejected as before, and an empty value for a field with enumerated values is still rejected as Value is incorrect, as QuickFIX/n's CheckValue does.

The ValidateFieldsHaveValues doc in config/configuration.go now says this.

Tests

  • session_factory_test.go: the RequiresOrigSendingTime default, and Y / N parsing.
  • in_session_test.go:
    • default: a too-low PossDup gap fill without 122 is still rejected with RefTagID=122;
    • N: the same message is ignored, no message sent, target seqnum unchanged;
    • N: a too-low PossDup gap fill whose OrigSendingTime is after SendingTime is ignored (QuickFIX/n parity);
    • N: a too-low PossDup NewOrderSingle without 122 is still rejected.
  • validation_test.go, with ValidateFieldsHaveValues=N and RejectInvalidMessage=Y, FIX.4.0 and FIXT.1.1/FIX50SP2:
    • an empty string field is accepted;
    • an empty Price is accepted (no type check);
    • an empty TimeInForce is rejected as Value is incorrect;
    • an empty undefined tag is still rejected as an invalid tag.

All seven validation cases fail against v0.9.12. The two Price cases also fail when only the type-check skip is removed. Each new session test fails when the guard in in_session.go is removed. The last one also fails when the guard drops its SequenceReset condition.

Adds the QuickFIX/n RequiresOrigSendingTime setting (default Y). When set
to N, a SequenceReset received with PossDupFlag=Y and a MsgSeqNum lower
than expected is ignored without validating OrigSendingTime(122), so a
counterparty that omits the field on its replayed SequenceResets is not
sent a Reject. Every other message type still requires OrigSendingTime
when PossDupFlag=Y, and the default behavior is unchanged.
With RejectInvalidMessage=Y, validateField rejected every empty value as
"Tag specified without a value" whatever ValidateFieldsHaveValues said, so
the setting only relaxed the content pre-pass. It now matches QuickFIX/n
(DataDictionary.CheckHasValue and CheckValidFormat): with N an empty value
is not rejected for being empty and is not checked against the field's
type, while an undefined tag and an empty value for an enumerated field
are still rejected. The default (Y) is unchanged.
@blairham blairham changed the title Add RequiresOrigSendingTime session setting Add RequiresOrigSendingTime and honor ValidateFieldsHaveValues=N, as QuickFIX/n does Nov 19, 2026
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.

1 participant