Skip to content

ConcurrencyException reports an incorrect expected revision number. #61

Description

@ElasticCoder

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}");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions