-
Notifications
You must be signed in to change notification settings - Fork 359
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
fix: Use correct get single TE for deduplication feature [DHIS2-18541] #20124
Conversation
9be412d
to
2eb8818
Compare
...e/src/test/java/org/hisp/dhis/tracker/deduplication/merge/PotentialDuplicatesMergeTests.java
Outdated
Show resolved
Hide resolved
...test/java/org/hisp/dhis/tracker/deduplication/PotentialDuplicateRemoveTrackedEntityTest.java
Show resolved
Hide resolved
|
DeduplicationMergeParams params = | ||
DeduplicationMergeParams.builder() | ||
.potentialDuplicate(potentialDuplicate) | ||
.mergeObject(mergeObject) | ||
.original(original) | ||
.duplicate(duplicate) | ||
.original(hibernateOriginal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a temporary fix only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in this case we should completely refactor deduplication service and use the importer instead of custom stores. And then, we wouldn't need to get the tracked entities using the manager.
Moving
getTrackedEntity()
to use the same code as multiple entities has a big impact in a lot of places in the system and it is going to be done in small steps, changing it feature by feature.Changes in this PR
getNewTrackedEntity
method inDeduplicationController
. We are using theTrackedEntityService
only to validate the tracked entity, then we use the manager to get a managed object that is needed for the deduplication operations.getTrackedEntity(UID)
method.Challenges in tests
TrackedEntityAggregate
is loading data in new threads so they have their own transaction and not committed data are not visible in those threads, that is why we cannot use@Transactional
annotation when we are importing data and reading in one one transaction.Common misconfigurations in tests
Next Steps
getTrackedEntity()
methods and rename new onesOptional<T> find(UID)
to our services