Data alteration when commiting a date to EventStore #92

Closed
agueganno opened this Issue Feb 4, 2014 · 12 comments

2 participants

@agueganno

Hi everybody !

I'm currently facing an odd problem with EventStore. When commiting ISO dates with milliseconds set to .000, milliseconds are removed from the stored event. As the library I use to deserialize my dates expects milliseconds to be there, this is quite annoying :-(

Here is an example event I've used to reproduce the problem :

[
{
"eventId" : "ccf58146-f4d5-428c-bb45-ed2873316fee",
"eventType" : "BirthDateChanged",
"isJson" : true,
"data" : {
"event":{
"BirthDate":"1987-11-07T00:00:00.000+01:00",
"context":{"date":"2014-02-03T14:05:22.041+01:00"}
}
}
}
]

When querying EventStore after having commited this event, here is the data I get :

{
"title": "24@my-stream",
"id": "http://127.0.0.1:2113/streams/my-stream/24",
"updated": "2014-02-03T12:22:46.523367Z",
"author": {
"name": "EventStore"
},
"summary": "BirthDateChanged",
"content": {
"eventStreamId": "my-stream",
"eventNumber": 24,
"eventType": "BirthDateChanged",
"data": {
"event": {
"BirthDate": "1987-11-07T00:00:00+01:00",
"context": {
"date": "2014-02-03T14:05:22.041+01:00"
}
}
},
"metadata": ""
},
"links": [
{
"uri": "http://127.0.0.1:2113/streams/my-stream/24",
"relation": "edit"
},
{
"uri": "http://127.0.0.1:2113/streams/my-stream/24",
"relation": "alternate"
}
]
}

The interesting part here is the "BirthDate". field. As you can see, it's lacking its milliseconds in the EventStore answer while the "date" field still has it.

Is this behaviour known or expected ? Is there any workaround ?

That being said, I must add that we're using EventStore since some weeks now and things are going pretty well. Thanks for the good work, so !

Best wishes,

Alexis.

PS : I originally wanted to post this message on the google groups forum... but the "Publish" button never worked. As I think I'm talking about a bug, I consider it is meaningful to post it here too.

@gregoryyoung
Event Store member
@agueganno

Content as JSON :

HTTP/1.1 200 OK
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Origin: *
Cache-Control: max-age=31536000, public
Vary: Accept
Content-Type: application/json; charset: utf-8
Server: Mono-HTTPAPI/1.0
Date: Tue, 04 Feb 2014 09:54:56 GMT
Content-Length: 135
Keep-Alive: timeout=15,max=100


{
  "event": {
    "BirthDate": "1987-11-07T00:00:00+01:00",
    "context": {
      "date": "2014-02-03T14:05:22.041+01:00"
    }
  }
}

Data is altered if requested as XML too. Our application gets data from EventStore through TCP and the data does not have milliseconds either. That's how I noticed the problem.

Additional infos :

ES VERSION:               2.0.1.0 (master/549d96219418572625b2f68d46ec809d9e86f7df, Thu, 1 Aug 2013 18:26:54 +0100)
OS:                       Unknown (Unix 3.11.6.4)
RUNTIME:                  3.2.3 (tarball Thu Dec 12 23:19:16 UTC 2013) (64-bit)
GC:                       2 GENERATIONS
LOGS:                     /home/alexis/eventstore/log

I'm using openSUSE. Mono comes from openSUSE repositories.

@agueganno

Has anyone been able to reproduce the issue ?

@gregoryyoung
Event Store member
@agueganno

can you give me a hint about a method to publish an event with TCP ? we've done that with the JVM client but we faced problems reading our events thereafter...

@gregoryyoung
Event Store member
@gregoryyoung
Event Store member
@gregoryyoung
Event Store member
@gregoryyoung
Event Store member
@agueganno

I'm really confident that you'll find the problem, considering the overall quality of the software. :-)
Thanks for giving news of your work.

@gregoryyoung
Event Store member
@gregoryyoung
Event Store member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment