quickfix icon indicating copy to clipboard operation
quickfix copied to clipboard

Fix repeating group read tags lost

Open hyde-zhang opened this issue 4 years ago • 2 comments

The RepeatingGroup tags are not created during the read process. Tag values are there but tags are not copied over / read. If CopyInto is used to copy from old FieldMap to new, existing tags from old one will be lost during the fields setting process

Can try to reproduce like this:

	symGroup := quoterequest.NewNoRelatedSymRepeatingGroup()
	sym := symGroup.Add()
	sym.SetSymbol("symbol")
	sym.SetOrderQty(decimal.NewFromFloat(1), 4)
	sym.SetQuoteRequestType(enum.QuoteRequestType_AUTOMATIC)
	
	fixmsg := quoterequest.New(field.NewQuoteReqID("testId"))
	fixmsg.SetNoRelatedSym(symGroup)

	msg := quoterequest.FromMessage(fixmsg.ToMessage())
	if syms, err := msg.GetNoRelatedSym(); err == nil {

		newSyms := quoterequest.NewNoRelatedSymRepeatingGroup()
		newSym := newSyms.Add()

		sym := syms.Get(0)
		sym.CopyInto(&newSym.FieldMap) // SUT

		newSym.SetCurrency("USD")
		msg.SetNoRelatedSym(newSyms)
		// log msg.ToMessage() will show only Currency (15) tag
		// 8=FIX.4.4 9=29 35=R 131=testId 146=1 15=USD 10=213 
		// Whereas it should be
		// 8=FIX.4.4 9=55 35=R 131=testId 146=1 55=symbol 303=2 38=1.0000 15=USD 10=224
	}

hyde-zhang avatar Sep 24 '21 15:09 hyde-zhang

@totalys we're hitting this bug in production with NSCC. What is your plan/timeline for merging this?

rtjoseph11 avatar Sep 01 '22 20:09 rtjoseph11

I'm not allowed to merge. I'would like this to me merged asap as well! Please @ackleymi , @hyde-zhang, @reedom.

totalys avatar Sep 02 '22 04:09 totalys

Related: https://github.com/quickfixgo/quickfix/pull/509

sylr avatar Sep 24 '22 09:09 sylr

@sylr do you know who can merge this?

rtjoseph11 avatar Sep 24 '22 14:09 rtjoseph11

@sylr do you know who can merge this?

@ackleymi I believe.

sylr avatar Sep 24 '22 15:09 sylr

@ackleymi anything holding up merging this?

rtjoseph11 avatar Sep 28 '22 20:09 rtjoseph11

@ackleymi can you please respond here?

rtjoseph11 avatar Jan 26 '23 21:01 rtjoseph11