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

MS-438 Prevent invalid person creation event #708

Conversation

luhmirin-s
Copy link
Contributor

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.

@luhmirin-s luhmirin-s requested review from ethiery, a team, BurningAXE, alex-vt, meladRaouf, TristramN, ybourgery and alexandr-simprints and removed request for a team May 7, 2024 14:40
@cla-bot cla-bot bot added the ... label May 7, 2024
fingerprintCaptureBiometricsEvents,
faceSamples,
fingerprintSamples
)
if (personCreationEvent.hasBiometricData()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we log an error in the opposite case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need more tests to cover the case that is prevented with this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

@luhmirin-s luhmirin-s force-pushed the bugfix/MS-438-prevent-invalid-person-creation-event branch from d61e99e to a2441aa Compare May 9, 2024 07:26
@luhmirin-s luhmirin-s force-pushed the bugfix/MS-438-prevent-invalid-person-creation-event branch from a2441aa to 3ada1ef Compare May 13, 2024 12:42
@luhmirin-s luhmirin-s force-pushed the bugfix/MS-438-prevent-invalid-person-creation-event branch from 3ada1ef to 20285c3 Compare May 14, 2024 11:49
Copy link

sonarcloud bot commented May 14, 2024

@luhmirin-s luhmirin-s changed the base branch from release/2024.1.0 to release/2024.1.1 May 27, 2024 15:18
@luhmirin-s luhmirin-s merged commit 242f7f8 into release/2024.1.1 May 27, 2024
11 checks passed
@luhmirin-s luhmirin-s deleted the bugfix/MS-438-prevent-invalid-person-creation-event branch May 27, 2024 15:20
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.

None yet

4 participants