Fix bug so only relevant files are loaded from the filesystem to determine if snapshot should be loaded.
Context
While loading an aggregate with ignoreSnapshot: false in the method FindAggregateAsync(id, ignoreSnapshot, version), the TextFileSnapshotStore loads all files from the file system and checks if there is a file with a version larger than the version of the aggregate. If an other aggregate has a snapshot and the version is lower or equals the current version of the aggregate, the snapshot is considered as the snapshot for this aggregate.
The result of this faulty filtering, is that the program tries to load a non-existing file from the file system, and crashes.
This fix checks if the files in the snapshot store contains a snapshot for the correct aggregate.
Fix bug so only relevant files are loaded from the filesystem to determine if snapshot should be loaded.
Context
While loading an aggregate with
ignoreSnapshot: false
in the methodFindAggregateAsync(id, ignoreSnapshot, version)
, theTextFileSnapshotStore
loads all files from the file system and checks if there is a file with a version larger than the version of the aggregate. If an other aggregate has a snapshot and the version is lower or equals the current version of the aggregate, the snapshot is considered as the snapshot for this aggregate. The result of this faulty filtering, is that the program tries to load a non-existing file from the file system, and crashes.This fix checks if the files in the snapshot store contains a snapshot for the correct aggregate.
80