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

Add expected version to EventStore interface #10 #11

Conversation

watfordsuzy
Copy link
Contributor

This PR is merely to discuss issue #10 and I don't feel confident enough in the foundational API shapes to suggest otherwise.

Trying to adapt Emmett to some problems I found myself smuggling expected versions within event metadata rather than the API itself, while also having the next expected version returned through the API.

@oskardudycz oskardudycz marked this pull request as ready for review February 14, 2024 08:06
Copy link
Collaborator

@oskardudycz oskardudycz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@watfordsuzy, thank you a lot for the PR and for the issue. Indeed, the lack of optimistic concurrency is a big thing. I didn't add that initially without the intention to hide that part or ignore it. The first release was focused on the business logic; now it's time to do the application layer correctly.

I'm planning to do it more or less like in the solution in my self-paced kit: https://github.com/oskardudycz/EventSourcing.NodeJS/blob/2d417bd2e650c16b4af68b6a752bd684ce0a8fc0/workshops/introduction_to_event_sourcing/src/solved/07_optimistic_concurrency_eventstoredb/tools/eventStore.ts#L99

I'm going to pull your changes in and restructure them a bit. Thank you a lot for the contribution and double-checking if I didn't miss it!

@oskardudycz oskardudycz linked an issue Feb 14, 2024 that may be closed by this pull request
@oskardudycz oskardudycz added enhancement New feature or request command handling labels Feb 14, 2024
@oskardudycz oskardudycz merged commit 2e5ee32 into event-driven-io:main Feb 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Append Events with an expected version
2 participants