Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConcurrencyException reports an incorrect expected revision number. #61

Open
ElasticCoder opened this issue Aug 28, 2020 · 0 comments
Open
Labels

Comments

@ElasticCoder
Copy link

ElasticCoder commented Aug 28, 2020

The InMemoryStorageEngine reports an incorrect expected revision number. It is off by 1.

if (firstEvent.EventNumber - 1 != streams[streamId].Count)
{
    throw new ConcurrencyException($"Concurrency conflict when appending to stream {streamId}. Expected revision {firstEvent.EventNumber} : Actual revision {streams[streamId].Count}");
}

It shoud read:

if (firstEvent.EventNumber != streams[streamId].Count + 1)
{
    throw new ConcurrencyException($"Concurrency conflict when appending to stream {streamId}. Expected revision {firstEvent.EventNumber} : Actual revision {streams[streamId].Count + 1}");
}

throw new ConcurrencyException($"Concurrency conflict when appending to stream {streamId}. Expected revision {firstEvent.EventNumber} : Actual revision {streams[streamId].Count}");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants