jacqueskang / EventSourcing

.NET Core event sourcing framework
MIT License
179 stars 29 forks source link

TextFileSnapshotStore.FindLastSnapshotAsync crashes when unrelated snapshots are present #80

Open warrantor opened 2 years ago

warrantor commented 2 years ago

When there are aggregates with a snapshot, and you call the method FindAggregateAsync(id, ignoreSnapshots, version) with ignoreSnapshots set to false, the TextFileSnapshotStore.FindLastSnapshotAsync method fails. The logic for getting the last snapshot of an aggregate doesn't check if the snapshot is for the relevant aggregate.