Skip to content

Commit

Permalink
Fix indfinite Document Verification Processing (#352)
Browse files Browse the repository at this point in the history
* Fix Document Verification Processing

* Update visibility
  • Loading branch information
vanshg authored Apr 29, 2024
1 parent 6c91907 commit 08263f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Release Notes

## Unreleased
## Unreleased

* Fixed a bug where Document Capture would occasionally fail
* Fixed a bug where Document Verification would get stuck on the processing screen

## 10.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ internal abstract class OrchestratedDocumentViewModel<T : Parcelable>(
var result: SmileIDResult<T> = SmileIDResult.Error(
IllegalStateException("Document Capture incomplete"),
)
protected var documentFrontFile: File? = null
protected var documentBackFile: File? = null
protected var livenessFiles: List<File>? = null
private var documentFrontFile: File? = null
private var documentBackFile: File? = null
private var livenessFiles: List<File>? = null
private var stepToRetry: DocumentCaptureFlow? = null

fun onDocumentFrontCaptureSuccess(documentImageFile: File) {
Expand Down Expand Up @@ -145,7 +145,7 @@ internal abstract class OrchestratedDocumentViewModel<T : Parcelable>(
"Selfie file is null",
)
// Liveness files will be null when the partner bypasses our Selfie capture with a file
val livenessImageInfo = livenessFiles?.map { it.asLivenessImage() } ?: emptyList()
val livenessImageInfo = livenessFiles.orEmpty().map { it.asLivenessImage() }
val uploadRequest = UploadRequest(
images = listOfNotNull(
frontImageInfo,
Expand Down Expand Up @@ -190,10 +190,11 @@ internal abstract class OrchestratedDocumentViewModel<T : Parcelable>(
val prepUploadResponse = SmileID.api.prepUpload(prepUploadRequest)
SmileID.api.upload(prepUploadResponse.uploadUrl, uploadRequest)
Timber.d("Upload finished")
sendResult(documentFrontFile, documentBackFile, livenessFiles)
}
}

fun sendResult(
private fun sendResult(
documentFrontFile: File,
documentBackFile: File? = null,
livenessFiles: List<File>? = null,
Expand Down Expand Up @@ -281,7 +282,7 @@ internal abstract class OrchestratedDocumentViewModel<T : Parcelable>(
}

/**
* If stepToRetry is ProcessingScreen, we're retrying a network issue, so we need to kick off
* If [stepToRetry] is ProcessingScreen, we're retrying a network issue, so we need to kick off
* the resubmission manually. Otherwise, we're retrying a capture error, so we just need to
* reset the UI state
*/
Expand Down

0 comments on commit 08263f4

Please sign in to comment.