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

tech(store): Ignore multiple changes to same entity while storing/updating #55

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

pjechris
Copy link
Owner

@pjechris pjechris commented Aug 8, 2023

⚽️ Description

Part of #48. Now if an entity is changed multiple times while storing it will be change only once (the first time).

This can happen when inserting multiple items at the time (store(entities:)) or if, for some reason, an aggregate would reference the same object multiple times.

🔨 Implementation details

  • Remove applyChildrenChanges: it was now useless as we remove all children relations before doing any update
  • Use ObservationRegistry to check if a node was already modified during the transaction. If it's the case: ignore subsequent changes.

@pjechris pjechris added the tech label Aug 8, 2023
@pjechris pjechris merged commit 8cd62be into main Aug 8, 2023
2 checks passed
@pjechris pjechris deleted the tech/node-multipleUpdates-ignore branch August 8, 2023 18:24
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.

1 participant