Open JavaNoviceForChina opened 3 years ago
Thanks for the report. Are you by any chance able to provide a unit test for this problem?
I'm very sorry, this bug requires the client and server to conduct joint debugging test, so we can't write unit test
------------------ 原始邮件 ------------------ 发件人: "Christoph John"<notifications@github.com>; 发送时间: 2020年12月17日(星期四) 晚上6:26 收件人: "quickfix-j/quickfixj"<quickfixj@noreply.github.com>; 抄送: "淡忘"<614226243@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [quickfix-j/quickfixj] The bug of generateSequenceResetIfNeeded in resendMessages method (#344)
Thanks for the report. Are you by any chance able to provide a unit test for this problem?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Could you please take a look at the tests in SessionTest
and create a test based on that? It should be possible to reconstruct the problem with that.
E.g. here is a test that also deals with resend request processing. You could use it as a template:
”generateSequenceResetIfNeeded“method:What I understand is that when the retrieved messages to be processed are less than the endseqno, for example, messages from 2 to 10 are expected to be sent, but only 2 to 6 are retrieved in persistence, and the sequence number needs to be reset to 11;However, there is a bug in the current code logic. When message 5 in 2 to 6 is an app message and 6 is an admin message, a reset message with sequence number 2 will be sent. However, the seqno expected by the other party has been reset to 6 when sending the app message with sequence number 5, which will cause the sequence number to be too low. I think the newbegin variable should be the sequence number expected by the current party, so it should be changed to Newbegin is defined above the for loop and is assigned the current sent message sequence number + 1 at appmessage justsent = true