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 events to the list of uncommitted in Aggregate only if they are successfully applied to the entity #1313

Open
dmitrykuzmin opened this issue Oct 21, 2020 · 0 comments · May be fixed by #1439
Assignees
Labels
Milestone

Comments

@dmitrykuzmin
Copy link
Contributor

dmitrykuzmin commented Oct 21, 2020

Currently, the method Aggregate.apply(List<Event> events) always adds all events to the in-memory list of aggregate's uncommittedEvents, ignoring the actual result of applying them to the entity.

When multiple messages are dispatched in a batch, the entities may be cached. In this situation, if the earlier dispatch produces events which render aggregate state invalid, but the following one is successful, all of the events will be actually saved to the storage, forever corrupting the aggregate history.

@dmitrykuzmin dmitrykuzmin changed the title Add events to the list of uncommitted in Aggregate only if they are successfully applied to entity Add events to the list of uncommitted in Aggregate only if they are successfully applied to the entity Oct 21, 2020
@alexander-yevsyukov alexander-yevsyukov added this to the M1 milestone Oct 30, 2022
@armiol armiol assigned armiol and unassigned yevhenii-nadtochii Jul 18, 2023
@armiol armiol moved this to 🏗 In progress in v2.0 Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

4 participants