Skip to content

Commit 6bce3d5

Browse files
authored
Instantiate the verification controller ASAP (#3893)
* Instantiate the verification controller when possible This is needed to get incoming verification requests * Workaround test failure
1 parent b06699e commit 6bce3d5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/verification/RustSessionVerificationService.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,17 @@ class RustSessionVerificationService(
9696

9797
private var listener: SessionVerificationServiceListener? = null
9898

99+
init {
100+
// Instantiate the verification controller when possible, this is needed to get incoming verification requests
101+
sessionCoroutineScope.launch {
102+
// Needed to avoid crashes on unit tests due to the Rust SDK not being available
103+
tryOrNull {
104+
encryptionService.waitForE2eeInitializationTasks()
105+
initVerificationControllerIfNeeded()
106+
}
107+
}
108+
}
109+
99110
override fun setListener(listener: SessionVerificationServiceListener?) {
100111
this.listener = listener
101112
}

0 commit comments

Comments
 (0)