[QFJ-656] allowUnknownMsgFields has no effect if the field is not defined in the dictionary Created: 28/Nov/11 Updated: 21/Apr/16 Resolved: 08/Jan/16 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | Engine |
Affects Version/s: | 1.4.0, 1.5.0, 1.5.1 |
Fix Version/s: | 1.6.2 |
Type: | Bug | Priority: | Major |
Reporter: | test | Assignee: | Marcin L |
Resolution: | Fixed | Votes: | 2 |
Labels: | None |
Attachments: | suggested_fix.txt |
Description |
The documentation of allowUnknownMsgFields is a bit misleading, it has no effect if the field is not defined in the dictionary. allowUnknownMsgFields is not checked in void checkValidTagNumber(Field<?> field) . |
Comments |
Comment by Greg Chabala [ 25/Jun/12 ] |
This is still an issue in version 1.5.2 |
Comment by Marcin L [ 30/Dec/15 ] |
I wanted to produce a fix for this issue, but I have trouble understanding what the correct logic should be. I believe the question is if the behaviour should be respectively the same, regardless if a field exists in <fields> section or not. I did some analysis on the topic, but I need a second opinion if this is desired solution, before I submit a patch. Please see attachment. |
Comment by Christoph John [ 31/Dec/15 ] |
Hi Marcin L, you forgot to mention if the fields are required. I was wondering why test case 2 with field 6000 (AllowUnknownMessageFields=false and CheckUserDefinedFields=true) failed. But this is because the field 6000 is required I assume? Thanks, |
Comment by Marcin L [ 31/Dec/15 ] |
Hello Christoph, 1) Actually none of the fields are required, because all them are missing in the message fields section: <messages> Field 6000, test case (2, 2) fails currently, because field 6000 is not defined in message + AllowUnknownMessageFields == false: private void checkIsInMessage(Field<?> field, String msgType) { } The above check is triggered, because of CheckUserDefinedFields == true. 2) I'm not sure about test case (2,4). It would make sense to FAIL according to documentation, because
In general I think that checks dependent on flags AllowUnknownMessageFields and CheckUserDefinedFields should be executed independently, although this is not the case at the moment. From docoumentation. ValidateUserDefinedFields: If set to N, user defined fields will not be rejected if they are not defined in the data dictionary, or are present in messages they do not belong to. This basically means that if value is true, then all fields >= 5000 should fail if not in message field section or global field section, which would imply that test case (2, 4) should result in FAILURE. Additionally in my understanding of these flags: AllowUnknownMessageFields == !CheckUserDefinedFields (however the first flag applies to fields < 5000 only, second to fields >=5000 only) |
Comment by Christoph John [ 04/Jan/16 ] |
Hi Marcin L and happy new year, you are of course right about points 1) and 2). Sorry, it was late. It would be great if you could provide a patch and unit test for this. |
Comment by Marcin L [ 04/Jan/16 ] |