Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.simprints.feature.orchestrator.usecases.response

import com.simprints.core.domain.response.AppErrorReason
import com.simprints.infra.config.store.models.ProjectConfiguration
import com.simprints.infra.logging.LoggingConstants.CrashReportTag
import com.simprints.infra.logging.Simber
import com.simprints.infra.orchestration.data.responses.AppErrorResponse
import com.simprints.infra.orchestration.data.responses.AppMatchResult
import com.simprints.infra.orchestration.data.responses.AppResponse
Expand All @@ -21,7 +23,10 @@ internal class CreateVerifyResponseUseCase @Inject constructor() {
getFaceMatchResults(projectConfiguration, results),
).maxByOrNull { it.confidenceScore }
?.let { AppVerifyResponse(it) }
?: AppErrorResponse(AppErrorReason.UNEXPECTED_ERROR)
?: AppErrorResponse(AppErrorReason.UNEXPECTED_ERROR).also {
//if subject enrolled with an SDK and the user tries to verify with another SDK
Simber.tag(CrashReportTag.MATCHING.name).e("No match results found")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The message feels a bit too generic, maybe something like "No match results due to SDK mismatch"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@luhmirin-s There are other scenarios where the matching result can be empty, such as a crash in one of the SDKs. This is why I chose a generic log message.

}

private fun getFingerprintMatchResults(
projectConfiguration: ProjectConfiguration,
Expand Down