You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario: Retrieve the evenstream of an aggregate and keep a reference to it, adding new events to it and committing occassionally.
Expected Result: All events added to the stream are actually persisted
Actual Result: Some events are not persisted, because the uncommittedEvents array has been altered between the store.addEvents() call and the callback (async IO) and then gets overwritten with an empty array [].
Solution: Create a copy of the eventstream.uncommittedEvents array and reset the uncommitedEvents early before the IO call, then use the copy inside the callback only and re-append the uncommitted events on error.
The text was updated successfully, but these errors were encountered:
Scenario: Retrieve the evenstream of an aggregate and keep a reference to it, adding new events to it and committing occassionally.
Expected Result: All events added to the stream are actually persisted
Actual Result: Some events are not persisted, because the uncommittedEvents array has been altered between the
store.addEvents()
call and the callback (async IO) and then gets overwritten with an empty array[]
.Solution: Create a copy of the eventstream.uncommittedEvents array and reset the uncommitedEvents early before the IO call, then use the copy inside the callback only and re-append the uncommitted events on error.
The text was updated successfully, but these errors were encountered: