<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:00:22 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-3759] BsonBinary subtype v4 (UUID Standard) gets converted back to Binary and not UUID</title>
                <link>https://jira.mongodb.org/browse/JAVA-3759</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;On reading UUID subtype V4 from MongoDB using mongo-java-driver 3.12.5,&#160;BsonBinary subtype v4 (STANDARD Uuid) gets converted back to Binary and not UUID.&lt;/p&gt;

&lt;p&gt;Line of code where this bug occurs:&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/master/bson/src/main/org/bson/BSONCallbackAdapter.java#L86&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/blob/master/bson/src/main/org/bson/BSONCallbackAdapter.java#L86&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Which throws mapping exception only in case of UUID v4 (and not in V3) :&#160;Causing: dev.morphia.mapping.MappingException: Could not map Entity with ID: org.bson.types.Binary@e1123829&lt;/p&gt;



&lt;p&gt;As a result, calling client is forced to add a decoding hook transformer for Binary to UUID&lt;/p&gt;</description>
                <environment></environment>
        <key id="1375894">JAVA-3759</key>
            <summary>BsonBinary subtype v4 (UUID Standard) gets converted back to Binary and not UUID</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13202">Works as Designed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="adhunna@expedia.com">Arushi Dhunna</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Jun 2020 13:31:30 +0000</created>
                <updated>Fri, 27 Oct 2023 13:20:59 +0000</updated>
                            <resolved>Mon, 15 Jun 2020 14:14:03 +0000</resolved>
                                    <version>3.12.5</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3203800" author="jlee@antwerkz.com" created="Wed, 10 Jun 2020 19:00:32 +0000"  >&lt;p&gt;2.0.0-RC1 is out.&#160; Hopefully it will be out in the next couple of weeks.&#160; It&apos;s currently waiting on the 1.6 release to go out which is currently being evaluated.&lt;/p&gt;</comment>
                            <comment id="3203781" author="JIRAUSER1253282" created="Wed, 10 Jun 2020 18:53:11 +0000"  >&lt;p&gt;Thank-you Justin&lt;br/&gt;
Has Morphia 2.0 been released?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="3203778" author="jlee@antwerkz.com" created="Wed, 10 Jun 2020 18:52:15 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/MorphiaOrg/morphia/issues/1454&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/MorphiaOrg/morphia/issues/1454&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3203777" author="jlee@antwerkz.com" created="Wed, 10 Jun 2020 18:50:56 +0000"  >&lt;p&gt;I&apos;ll try to play with it tonight and see what might be possible.&#160; It&apos;s ugly in there, though.&#160; That&apos;s why i rewrote it.&#160; &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="3203772" author="jlee@antwerkz.com" created="Wed, 10 Jun 2020 18:49:16 +0000"  >&lt;p&gt;2.0 has an option to specify the UUID representation but 1.x does not.&#160; We simply take the client we&apos;re given and use that.&#160; 2.0 will also use the client as is.&#160; I&apos;m not entirely comfortable overriding values potentially set by the user in those cases.&#160; Serialization in 1.x is ... complicated.&#160; I don&apos;t have that code in front me right now but I&apos;m reasonably sure it just passes the UUID in the DBObject and lets the driver manage writing that out.&#160; 2.x relies completely on codecs for that to happen so if the client is configured correctly it should &quot;Just Work.&quot;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="3203755" author="JIRAUSER1253282" created="Wed, 10 Jun 2020 18:43:56 +0000"  >&lt;p&gt;@Jeffrey Okay. I created PR thinking that if type 3 is getting converted into UUID, then type 4 also should.&lt;/p&gt;</comment>
                            <comment id="3203741" author="jeff.yemin" created="Wed, 10 Jun 2020 18:38:48 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=adhunna%40expedia.com&quot; class=&quot;user-hover&quot; rel=&quot;adhunna@expedia.com&quot;&gt;adhunna@expedia.com&lt;/a&gt;, thanks for the PR.&#160; The problem is that it&apos;s an application-visible behavioral change.&#160; While it&apos;s correct for your application, it may change expectations for other users who are expecting the current behavior.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jlee%40antwerkz.com&quot; class=&quot;user-hover&quot; rel=&quot;jlee@antwerkz.com&quot;&gt;jlee@antwerkz.com&lt;/a&gt;&#160;it seems like this could be fixed at the mapping layer in Morphia though without introducing a backwards breaking change.&#160; Morphia is in a position to know that a UUID is expected, and could translate a type 4 BsonBInary to a UUID when decoding into a POJO with a UUID field.&#160; What do you think?&lt;/p&gt;</comment>
                            <comment id="3203719" author="JIRAUSER1253282" created="Wed, 10 Jun 2020 18:30:25 +0000"  >&lt;p&gt;Hi Jeffrey,&lt;br/&gt;
 We are seeing this behavior with previous releases as well and currently Using Morphia&#160;1.5.8&lt;/p&gt;

&lt;p&gt;I happened to create this PR :&#160;&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/pull/552&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/pull/552&lt;/a&gt;&lt;br/&gt;
 Would it be possible to get it fixed for versions irrespective of the Morphia version in use?&lt;/p&gt;</comment>
                            <comment id="3203700" author="jlee@antwerkz.com" created="Wed, 10 Jun 2020 18:19:22 +0000"  >&lt;p&gt;Correct.&#160; As of 2.0, we&apos;re completely on &lt;tt&gt;MongoCollection&lt;/tt&gt;.&#160; If a user only passes the host and database name for Morphia to automatically create the &lt;tt&gt;com.mongodb.client.MongoClient&lt;/tt&gt; and configure the UUID representation using the &lt;tt&gt;STANDARD&lt;/tt&gt; value.&#160; 1.x users are responsible for creating their own clients and so will need to set it correctly.&lt;/p&gt;</comment>
                            <comment id="3203675" author="jeff.yemin" created="Wed, 10 Jun 2020 18:03:59 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=adhunna%40expedia.com&quot; class=&quot;user-hover&quot; rel=&quot;adhunna@expedia.com&quot;&gt;adhunna@expedia.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Is this a regression, or are you seeing this with previous releases as well?&#160; From initial investigation it appears that the behavior hasn&apos;t changed.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=justin.lee&quot; class=&quot;user-hover&quot; rel=&quot;justin.lee&quot;&gt;justin.lee&lt;/a&gt;, do you think this will continue to be a problem in later versions of Morphia?&#160; The class in question is only used by the DB/DBCollection legacy API, and my understanding is that later versions of Morphia no longer rely on that API.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxc87z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>