[JAVA-5203] Record with nullable type throw BsonInvalidOperationException when value is explicitly null in the DB Created: 16/Oct/23 Updated: 04/Nov/23 Resolved: 23/Oct/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Codecs |
| Affects Version/s: | None |
| Fix Version/s: | 4.11.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gordon Wang | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Minor Change |
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
SummaryThis is the exact same issue that has been raised in Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).Affected versions of Java driver: 4.11 How to ReproduceBelow test case reproduces the issue, included in https://github.com/mongodb/mongo-java-driver/pull/1223:
Additional BackgroundI have already made a patch to fix this at https://github.com/mongodb/mongo-java-driver/pull/1223, which contains a fix in Java record codec and also a test verifying the patch is working. |
| Comments |
| Comment by Jeffrey Yemin [ 26/Oct/23 ] |
|
commit 81ad6a1c247bac3298ad4de60c564435db01ef06 (HEAD -> 4.11.x, upstream/4.11.x) Support decoding nulls for non-primitive fields in Java records (#1223) |
| Comment by Jeffrey Yemin [ 23/Oct/23 ] |
|
Thanks gordonw@duck.com. This will be included in the 4.11.1 patch release. |
| Comment by Githook User [ 23/Oct/23 ] |
|
Author: {'name': 'Gordon Wang', 'email': 'gordonw@canva.com', 'username': 'bulbfreeman'}Message: Support decoding nulls for non-primitive fields in Java records (#1223)
|
| Comment by PM Bot [ 16/Oct/23 ] |
|
Hi gordonw@duck.com, thank you for reporting this issue! The team will look into it and get back to you soon. |