Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return events that don´t include any data #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 ?


id = entry['eventNumber']
event_id = entry['eventId']
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