<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:36:30 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>[SERVER-55450] JSON.stringify in Realm function does not encode correctly</title>
                <link>https://jira.mongodb.org/browse/SERVER-55450</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When I use JSON.stringify on an object containing the curly quote character, e.g. `&#8217;`, in a triggered function, it is encoded to `&#226;`.&lt;/p&gt;

&lt;p&gt;This is affecting our very high visibility clients in the sport industry, e.g. the NCAA and others.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1656524">SERVER-55450</key>
            <summary>JSON.stringify in Realm function does not encode correctly</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</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="9">Done</resolution>
                                        <assignee username="eric.sedor@mongodb.com">Eric Sedor</assignee>
                                    <reporter username="developers@panda.industries">Timmy Pandahouse</reporter>
                        <labels>
                    </labels>
                <created>Tue, 23 Mar 2021 16:57:49 +0000</created>
                <updated>Wed, 24 Mar 2021 22:43:00 +0000</updated>
                            <resolved>Wed, 24 Mar 2021 22:42:59 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3682801" author="eric.sedor" created="Wed, 24 Mar 2021 22:42:50 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=developers%40panda.industries&quot; class=&quot;user-hover&quot; rel=&quot;developers@panda.industries&quot;&gt;developers@panda.industries&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Unfortunately, because the SERVER project is for the core MongoDB server, we aren&apos;t able to investigate Realm/Atlas issues directly. With apology for the redirect, can you please reach out via Intercom (the round green button at the bottom right of the cluster view page in Atlas) if you need any follow-up to your prior communication there?&lt;/p&gt;

&lt;p&gt;Gratefully,&lt;br/&gt;
Eric&lt;/p&gt;</comment>
                            <comment id="3680063" author="developers@panda.industries" created="Tue, 23 Mar 2021 19:12:47 +0000"  >&lt;p&gt;As of now, this behavior has been corrected, e.g. curly quotes now are left as curly quotes and so on.&lt;/p&gt;

&lt;p&gt;I cross posted to the community forum: &lt;a href=&quot;https://developer.mongodb.com/community/forums/t/strings-are-encoded-incorrectly-in-atlas-triggered-function/100189&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://developer.mongodb.com/community/forums/t/strings-are-encoded-incorrectly-in-atlas-triggered-function/100189&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since I was able to isolate this behavior to the MongoDB Atlas triggered function, I would still like follow-up on what occurred on your side, e.g. an incident report.&lt;/p&gt;</comment>
                            <comment id="3679777" author="developers@panda.industries" created="Tue, 23 Mar 2021 17:19:57 +0000"  >&lt;p&gt;Actually this might be a bigger issue, not a JSON.stringify issue: if I simply `.toString()` it outputs the incorrect encoding.&lt;/p&gt;

&lt;p&gt;E.g. instead of this:&lt;/p&gt;

&lt;p&gt;exports = async (changeEvent) =&amp;gt; &lt;/p&gt;
{
&#160; console.log(JSON.stringify(changeEvent &amp;amp;&amp;amp; changeEvent.fullDocument &amp;amp;&amp;amp; changeEvent.fullDocument.name))
}

&lt;p&gt;I simply do this:&lt;/p&gt;

&lt;p&gt;exports = async (changeEvent) =&amp;gt; &lt;/p&gt;
{
&#160; console.log(changeEvent &amp;amp;&amp;amp; changeEvent.fullDocument &amp;amp;&amp;amp; changeEvent.fullDocument.name)
}

&lt;p&gt;the output is the same incorrect `Test&#226;s` value.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 23 Mar 2021 18:46:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 46 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>eric.sedor@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 46 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eric.sedor@mongodb.com</customfieldvalue>
            <customfieldvalue>developers@panda.industries</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hz0rtr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hylyzb:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;&lt;b&gt;What I did:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Configure a Trigger function on a collection and log a property from a document:&lt;/p&gt;

&lt;p&gt;{{exports = async (changeEvent) =&amp;gt; { }}{{console.log(JSON.stringify(changeEvent &amp;amp;&amp;amp; changeEvent.fullDocument &amp;amp;&amp;amp; changeEvent.fullDocument.name)) }}}&lt;/p&gt;

&lt;p&gt;&#160;Create a document with a curly brace in the `name` property, e.g. `{ &quot;name&quot;: &quot;Test&#8217;s&quot; }`&lt;/p&gt;

&lt;p&gt;View the log entry for the create.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What I expected:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The log entry would show `Test&#8217;s`&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What actually happened:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;The log entry shows `Test&#226;s`&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Additional notes:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;An example log entry is from our trigger named `fanx_data_legacy_dev` with the id `605a194e3684e76b32b532dd`.&lt;/p&gt;

&lt;p&gt;This is not limited to the `console.log` output: our trigger function pushes the JSON.stringify&apos;d document to SQS, and the encoding shows the incorrect `Test&#226;s` as well.&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[eric.sedor@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hz0e2v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>