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

Remove unnecessary validation of aggregate identifier #2191

Merged
merged 1 commit into from Apr 14, 2022

Conversation

CodeDrivenMitch
Copy link
Member

During a pair programming session yesterday, @smcvb got into a discussion about a validation that was present in the AggregateCreateOrUpdateCommandHandler, which is triggered by an AggregateCreationPolicy annotation with value CREATE_IF_MISSING.

We found that:

  • Other command handlers do not validate this.
  • It's valid not to have an identifier set, by not applying an event at all (thus the aggregate not being created).
  • Setting the identifier explicitly to null later will throw an error in the EventStore when applying events.

Because of this, we removed the validation, also fixing the issue a customer had.

@sonarcloud
Copy link

sonarcloud bot commented Apr 14, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@gklijs gklijs left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@smcvb smcvb added Type: Bug Use to signal issues that describe a bug within the system. Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Status: In Progress Use to signal this issue is actively worked on. labels Apr 14, 2022
@smcvb smcvb added this to the Release 4.5.10 milestone Apr 14, 2022
Copy link
Member

@smcvb smcvb left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@smcvb smcvb merged commit 5e61d8c into axon-4.5.x Apr 14, 2022
@smcvb smcvb deleted the unnecessary-validation-identifier branch April 14, 2022 08:34
@smcvb smcvb added Status: Resolved Use to signal that work on this issue is done. and removed Status: In Progress Use to signal this issue is actively worked on. labels Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Status: Resolved Use to signal that work on this issue is done. Type: Bug Use to signal issues that describe a bug within the system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants