Hitting eventsourcing.exceptions.EventHashError
See original GitHub issueHi there, I’m currently playing around with the library and I’m hitting the following run time error when running two commands in a row and then attempting to look up the aggregate root id within app.repository
:
python3.7/site-packages/eventsourcing/domain/model/events.py", line 139, in check_hash raise EventHashError() eventsourcing.exceptions.EventHashError
The code is available here https://github.com/AlanFoster/eventsourcing and the error is reproducible with:
pipenv shell
pipenv install
pipenv run python main.py
From what I can tell this might be a bug within the library, but I’m not sure just yet! I’d be keen to know your thoughts 👍
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
eventsourcing Documentation
This is a library for event sourcing in Python. At its core, this library supports storing and retrieving sequences of.
Read more >Handling exceptions | laravel-event-sourcing - Spatie
The event-sourcing config file has a key, catch_exceptions , that determines what will happen should a projector or reactor throw an exception.
Read more >laravel-event-sourcing/handling-exceptions.md at main - GitHub
The event-sourcing config file has a key, catch_exceptions , that determines what will happen should a projector or reactor throw an exception.
Read more >Event Sourcing in .NET - Dealing with projection exceptions
It is based on the idea that every event will be processed by all projectors in a synchronous manner. As we use a...
Read more >Some CQRS and Event Sourcing Pitfalls
However, in the synchronous case, if the projection of an event causes an exception (e.g., because of hitting a database unique constraint), this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for looking into this! That’s helped clear up everything for me, thanks very much 👍
One more thing to watch out for, something which I feel is slightly deficient: if you use integer values for dict keys, as you do in your program, then you should be aware that they get converted to strings by JSON (at least the JSON module used by the library at the moment, which is the core Python json implementation) so when you look at a domain event object that has been reconstructed from a serialised record, then it can have string dict keys instead of integer dict keys. Then if you use these keys in a mutator to set values on an aggregate, and later try get values with integer keys, the value will appear to be missing. If you want to avoid this, then either make sure you just don’t use integer dict keys in the domain events, or make sure than you defensively convert to integers in the mutator. I’ve got no idea why the json module works this way.