envato / event_sourcery

A library for building event sourced applications in Ruby
MIT License
84 stars 10 forks source link

Event persisted? method prone to bugs #180

Closed patpaev closed 10 months ago

patpaev commented 7 years ago

The EventSourcery::Event persisted? method is just a simple check of whether an ID is present.

However it's documented that you can pass an ID through as a param when initializing the class.

This means that Events could erroneously respond true to persisted? if you've passed an id parameter whether it's been written to the database or not.

andyjdavis commented 10 months ago

This issue has now been resolved by removing the potentially misleading persisted? method. This change is available in 1.0.0 of the event_sourcery gem.