ThreeDotsLabs / esja

Event Sourcing library in Go.
MIT License
20 stars 4 forks source link

Fix events stored with no stream_type #32

Closed krzysztofreczek closed 3 weeks ago

krzysztofreczek commented 1 year ago

This is a bug-fix for https://github.com/ThreeDotsLabs/esja/issues/31

The root problem was the fact that when loading events from the DB and creating a new instance of an Entity with stream injected, the stream_type property was ignored. In consequence, a new instance was created with empty stream_type and all of the subsequent events were stored without it.

I run the tests before and after the change and it proves the issue is gone now. Before image

After image

krzysztofreczek commented 1 year ago

@m110, I have fixed the issue you have found and simplified the implementation a little bit. Can you have another look, please?