-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor readMetadataForMessageLinking so it doesn't return itself #1043
Conversation
…elf in the results
Quality Gate passedIssues Measures |
if (messageIdsToLink == null || messageIdsToLink.isEmpty()) { | ||
return; | ||
} | ||
|
||
// Add receivedSubmissionId to complete the list of messageIds to link | ||
messageIdsToLink.add(receivedSubmissionId); | ||
|
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.
Does this work correctly now?
Did partnerMetadataOrchestrator.findMessagesIdsToLink(receivedSubmissionId)
return receivedSubmissionId
in the returned set, but now it doesn't? Is it possible that the if
statement now always returns an empty set if this is the first one?
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.
Correct, findMessagesIdsToLink was returning receivedSubmissionId in the set. The problem with the previous logic and query is that it will return a record even if there's no pair to match, as it will always return itself. In this case, if there's a pair to match, it will return that so if won't be empty. If there's no pair to match, we want to return an empty set
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.
The changes are exactly what the PR says they should do, and even full coverage!
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.
Thanks for explaining it to me!
Refactor readMetadataForMessageLinking so it doesn't return itself
This is a fix in the linking logic so it only matches when there's at least one pair
Issue
#621
Checklist