Skip to content

Conversation

@hallgren
Copy link
Contributor

I'm not sure that I should return nil if eventType is not present. Please correct me if this is incorrect.

@mpraglowski
Copy link
Member

I belive we should not allow creation of Event without type & event_id (because of https://github.com/arkency/http_event_store/blob/master/lib/http_event_store/event.rb#L10)
That return nil seems to be a mistake for me - if we read something from store we should return it or raise an error if for some reason we are unable to parse the entry.

@hallgren
Copy link
Contributor Author

hallgren commented Apr 12, 2017

This spec depends on the return nil. I have never deleted an event from the event store so I'm not sure how this works and how to handle it.

For example what happens to a stream when a linked event´s original stream is deleted. Is the event ordering re-arranged?

@mpraglowski mpraglowski mentioned this pull request May 5, 2017
@mpraglowski
Copy link
Member

I'm not sure that I should return nil if eventType is not present. Please correct me if this is incorrect.

Hmm maybe this does not make any sense - I would just raise an error - because what else we could do ?

type = entry['eventType']
source_event_uri = entry['id']
data = JSON.parse(entry['data'])
data = entry['data'] ? JSON.parse(entry['data']) : nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if nil is good choice here - why not empty hash {} ?

hallgren pushed a commit to hallgren/http_event_store that referenced this pull request May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants