Instantiate the verification controller ASAP (#3893)

* Instantiate the verification controller when possible

This is needed to get incoming verification requests

* Workaround test failure
This commit is contained in:
Jorge Martin Espinosa 2024-11-19 13:58:13 +01:00 committed by GitHub
parent b06699e53e
commit 6bce3d513d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,6 +96,17 @@ class RustSessionVerificationService(
private var listener: SessionVerificationServiceListener? = null
init {
// Instantiate the verification controller when possible, this is needed to get incoming verification requests
sessionCoroutineScope.launch {
// Needed to avoid crashes on unit tests due to the Rust SDK not being available
tryOrNull {
encryptionService.waitForE2eeInitializationTasks()
initVerificationControllerIfNeeded()
}
}
}
override fun setListener(listener: SessionVerificationServiceListener?) {
this.listener = listener
}