[GODRIVER-1797] Undefined attribute that is an array fails completing unmarshal Created: 17/Nov/20 Updated: 09/Dec/20 Resolved: 09/Dec/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 1.4.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tyson Henry | Assignee: | Benji Rewis (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
similar to issue https://jira.mongodb.org/browse/GODRIVER-1235 However, if the json document contains a field that is not defined in the struct and that field happens to be an array, the Skip() call on line 284 os struct_codec.go reads all the way to the end of document (EOD) and the DecodeValue() returns, it doesn't continue parsing the other fields in the document. Attached is a series of tests that show the behavior. I don't see any struct flags and or other flags to change this behavior. If an undefined field is a primitive (string, int, etc), the parser works fine. If the undefined field is another struct/map the parser works fine. |
| Comments |
| Comment by Benji Rewis (Inactive) [ 09/Dec/20 ] |
|
This bug has been fixed in doing GODRIVER-1235. Embedded arrays and objects in undefined fields were not being skipped correctly during extended JSON unmarshalling. |
| Comment by Divjot Arora (Inactive) [ 02/Dec/20 ] |
|
Moving back to Scheduled as we've increased the scope of |
| Comment by Benji Rewis (Inactive) [ 02/Dec/20 ] |
| Comment by Kevin Albertson [ 19/Nov/20 ] |
|
Hi tyson.henry@burstiq.com, thank you for the bug report (and the helpful test). I was able to reproduce this with the test you provided. The team will decide when to schedule this soon. |