Only offer to verify if a cross-signed device is available and improve the UX whilst waiting. (#4710)

* Only offer to verify if a cross-signed device is available

* Wait until we know which verification options are available before showing them.

---------

Co-authored-by: Hubert Chathi <hubertc@matrix.org>
This commit is contained in:
Doug
2025-11-07 12:10:12 +00:00
committed by GitHub
parent 096e2d1713
commit 51a9d8b56b
15 changed files with 142 additions and 25 deletions
@@ -342,6 +342,16 @@ class ClientProxy: ClientProxyProtocol {
}
}
func hasDevicesToVerifyAgainst() async -> Result<Bool, ClientProxyError> {
do {
let result = try await client.encryption().hasDevicesToVerifyAgainst()
return .success(result)
} catch {
MXLog.error("Failed checking hasDevicesToVerifyAgainst with error: \(error)")
return .failure(.sdkError(error))
}
}
func startSync() {
guard !hasEncounteredAuthError else {
MXLog.warning("Ignoring request, this client has an unknown token.")
@@ -136,6 +136,8 @@ protocol ClientProxyProtocol: AnyObject {
func isOnlyDeviceLeft() async -> Result<Bool, ClientProxyError>
func hasDevicesToVerifyAgainst() async -> Result<Bool, ClientProxyError>
func startSync()
func stopSync()