<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:35:39 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>[CSHARP-48] TimeSpan serialization not working</title>
                <link>https://jira.mongodb.org/browse/CSHARP-48</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;in BsonWriter the if statement is missing an else and thus always falls through to the last else which tries to cast the timespan into a long&lt;/p&gt;


&lt;p&gt; case BsonType.Long:&lt;br/&gt;
                        if(obj is TimeSpan)&lt;br/&gt;
                            _writer.Write(((TimeSpan)obj).Ticks);&lt;br/&gt;
                         if (obj is DateTime)&lt;br/&gt;
                            Write((DateTime)obj);&lt;br/&gt;
                        else&lt;br/&gt;
                            _writer.Write((long)obj);&lt;br/&gt;
                        return;&lt;/p&gt;

&lt;p&gt;should be&lt;/p&gt;


&lt;p&gt; case BsonType.Long:&lt;br/&gt;
                        if(obj is TimeSpan)&lt;br/&gt;
                            _writer.Write(((TimeSpan)obj).Ticks);&lt;br/&gt;
                         else if (obj is DateTime)&lt;br/&gt;
                            Write((DateTime)obj);&lt;br/&gt;
                        else&lt;br/&gt;
                            _writer.Write((long)obj);&lt;br/&gt;
                        return;&lt;/p&gt;</description>
                <environment></environment>
        <key id="12322">CSHARP-48</key>
            <summary>TimeSpan serialization not working</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="lanwin">Steve Wagner</assignee>
                                    <reporter username="matthiasg">Matthias Goetzke</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Jul 2010 08:26:56 +0000</created>
                <updated>Wed, 19 Oct 2016 14:16:05 +0000</updated>
                            <resolved>Sun, 4 Jul 2010 04:21:44 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="15380" author="mgoetzke" created="Sun, 4 Jul 2010 02:18:12 +0000"  >&lt;p&gt;The code was a LOCAL change in our repository and i realized this too late. The change was made since we changed the codebase to store DateTime as long in order to avoid the error with mongo to store datetimes before 1970 correctly.&lt;br/&gt;
(see &lt;a href=&quot;http://jira.mongodb.org/browse/SERVER-405&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;http://jira.mongodb.org/browse/SERVER-405&lt;/a&gt;) &lt;/p&gt;

&lt;p&gt;Sadly we wrote a test for the changed behavior of DateTime but not Timespan.&lt;/p&gt;

&lt;p&gt;We consider the this ticket as closed. It might be interesting though to think about changing the driver to store dates as longs until the mongo issue is fixed.&lt;/p&gt;


&lt;p&gt;I am extremely sorry for the mixup.&lt;/p&gt;</comment>
                            <comment id="15361" author="lanwin" created="Sat, 3 Jul 2010 11:13:31 +0000"  >&lt;p&gt;Can you tell me where dose you have that code from? In the current code base that looks like:&lt;/p&gt;

&lt;p&gt;                case BsonType.Long:&lt;br/&gt;
                    if(obj is TimeSpan)&lt;br/&gt;
                        _writer.Write(((TimeSpan)obj).Ticks);&lt;br/&gt;
                    else&lt;br/&gt;
                        _writer.Write((long)obj);&lt;br/&gt;
                    return;&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|hrha07:</customfieldvalue>

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