Skip to content

Conversation

@yevhenii-nadtochii
Copy link

@yevhenii-nadtochii yevhenii-nadtochii commented Jan 4, 2022

This PR addresses #1313.

The issue appears when multiple messages are dispatched from Inbox. Under the hood, those messages are processed as a batch, which triggers Aggregate to be cached for their processing. Going this way, Aggregate puts applied events into UncommittedHistory to send them to a storage lately.

Now, events emitted by a single command are put into the history only if they all were applied successfully. This behavior matches to the one of non-cached Aggregate.

Additionally, initialization of Delivery was dropped out of ServerEnvironment.reset(). Delivery is lazily initialized the same way in its getter ServerEnvironment.delivery().

@yevhenii-nadtochii yevhenii-nadtochii self-assigned this Jan 4, 2022
@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

Merging #1439 (8461f99) into master (c6b7be4) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #1439      +/-   ##
============================================
+ Coverage     91.41%   91.45%   +0.03%     
+ Complexity     4946     4944       -2     
============================================
  Files           622      622              
  Lines         15216    15196      -20     
  Branches        891      891              
============================================
- Hits          13910    13897      -13     
+ Misses         1001      994       -7     
  Partials        305      305              

@yevhenii-nadtochii yevhenii-nadtochii changed the title Fix uncommitted list Make UncommittedHistory contain only successfully applied events Jan 11, 2022
@yevhenii-nadtochii yevhenii-nadtochii marked this pull request as ready for review January 11, 2022 16:12
@yevhenii-nadtochii yevhenii-nadtochii changed the title Make UncommittedHistory contain only successfully applied events Make Aggregate put only successfully applied events to UncommittedHistory Jan 11, 2022
@yevhenii-nadtochii yevhenii-nadtochii marked this pull request as draft January 14, 2022 15:59
@yevhenii-nadtochii yevhenii-nadtochii marked this pull request as ready for review January 18, 2022 16:57
@alexander-yevsyukov alexander-yevsyukov added this to the M1 milestone Oct 30, 2022
…ers' into fix-uncommitted-list

# Conflicts:
#	license-report.md
#	pom.xml
#	server/src/main/java/io/spine/server/BoundedContext.java
#	server/src/main/java/io/spine/server/aggregate/Aggregate.java
#	server/src/main/java/io/spine/server/aggregate/AggregateRepository.java
#	server/src/main/java/io/spine/server/aggregate/UncommittedHistory.java
#	server/src/main/java/io/spine/server/event/EventBus.java
#	server/src/testFixtures/java/io/spine/server/aggregate/given/AbstractAggregateResilienceTestEnv.java
#	server/src/testFixtures/java/io/spine/server/aggregate/given/employee/DispatchExhaust.java
#	server/src/testFixtures/java/io/spine/server/aggregate/given/employee/EmployeeAgg.java
#	server/src/testFixtures/java/io/spine/server/aggregate/given/employee/Employees.java
#	server/src/testFixtures/java/io/spine/server/aggregate/given/employee/PreparedInboxStorage.java
#	server/src/testFixtures/java/io/spine/server/aggregate/given/employee/PreparedStorageFactory.java
#	server/src/testFixtures/java/io/spine/server/aggregate/given/employee/package-info.java
#	version.gradle.kts
@alexander-yevsyukov alexander-yevsyukov self-assigned this Nov 12, 2025
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Nov 12, 2025
@alexander-yevsyukov
Copy link
Contributor

Closing as outdated. The related issue will be resolved later.

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in v2.0 Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add events to the list of uncommitted in Aggregate only if they are successfully applied to the entity

4 participants