Self verification : makes sure cancellation works properly

This commit is contained in:
ganfra 2024-09-09 10:30:35 +02:00
parent fbce600f2b
commit a7ab8ee843
2 changed files with 25 additions and 21 deletions

View file

@ -97,7 +97,7 @@ class RustSessionVerificationService(
updateVerificationStatus()
}
}
.launchIn(sessionCoroutineScope)
.launchIn(sessionCoroutineScope)
}
override suspend fun requestVerification() = tryOrFail {
@ -105,7 +105,11 @@ class RustSessionVerificationService(
verificationController.requestVerification()
}
override suspend fun cancelVerification() = tryOrFail { verificationController.cancelVerification() }
override suspend fun cancelVerification() = tryOrFail {
verificationController.cancelVerification()
// We need to manually set the state to canceled, as the Rust SDK doesn't always call `didCancel` when it should
didCancel()
}
override suspend fun approveVerification() = tryOrFail { verificationController.approveVerification() }