MS-438 Prevent invalid person creation event#708
Merged
luhmirin-s merged 2 commits intoMay 27, 2024
Merged
Conversation
BurningAXE
approved these changes
May 8, 2024
| faceSamples, | ||
| fingerprintSamples | ||
| ) | ||
| if (personCreationEvent.hasBiometricData()) { |
Contributor
There was a problem hiding this comment.
Should we log an error in the opposite case?
Contributor
Author
There was a problem hiding this comment.
We could, but I am pretty sceptical that anyone will ever look into it.
| @@ -70,10 +60,7 @@ internal class CreatePersonEventUseCaseTest { | |||
|
|
|||
| @Test | |||
| fun `Does not create event if no biometric data`() = runTest { | |||
Contributor
There was a problem hiding this comment.
Do we need more tests to cover the case that is prevented with this PR?
Contributor
Author
There was a problem hiding this comment.
The issue is prevented by removing the repo and only using the step result data. I think the current tests cover that; IIRC, there are some extra checks in places where the data is added to step results.
d61e99e to
a2441aa
Compare
meladRaouf
approved these changes
May 13, 2024
a2441aa to
3ada1ef
Compare
alexandr-simprints
approved these changes
May 13, 2024
3ada1ef to
20285c3
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



For historical reasons, the "PersonCreated" event data was collected as a combination of capture event IDs from the events in the database and captured templates in orchestrator step results.
In some erroneous edge cases, the capture data in step results and the database events might not match. Most likely, it was when one session was abruptly stopped, and another took its place (but that has to be proven). In any case, such mismatch causes invalid "PersonCreation" - one or more modalities do not have matching sets of capture reference IDs and event IDs.
This change ensures that the "CreatePerson" event has the correct sets of IDs since all the info comes only from step results. This does not address the edge case itself, but it at least makes it easier to recover the data.
Note: IMO, the change, while relatively small, can have some unintended effects. Therefore, depending on the urgency, it should be considered only as part of the next hotfix or major release cycle.