Bump the RustSDK to v25.2.25, address breaking changes from matrix-org/matrix-rust-sdk/pull/4674

This commit is contained in:
Stefan Ceriu 2025-02-25 11:06:15 +02:00 committed by Stefan Ceriu
parent 6ded867bcc
commit 5e90f67a91
10 changed files with 17 additions and 83 deletions

View File

@ -8536,7 +8536,7 @@
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = 25.02.17;
version = 25.02.25;
};
};
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {

View File

@ -149,8 +149,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "422d7bef3ffd3edcb3e30afb410ee523f5659adc",
"version" : "25.2.17"
"revision" : "d5556ad7857c79f53804fbae17cc5232bc2ac493",
"version" : "25.2.25"
}
},
{

View File

@ -591,7 +591,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
Task {
// First log out from the server
let accountLogoutURL = await userSession.clientProxy.logout()
await userSession.clientProxy.logout()
// Regardless of the result, clear user data
userSessionStore.logout(userSession: userSession)
@ -604,13 +604,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
ServiceLocator.shared.analytics.resetConsentState()
stateMachine.processEvent(.completedSigningOut)
// Handle OIDC's RP-Initiated Logout if needed. Don't fallback to an ASWebAuthenticationSession
// as it looks weird to show an alert to the user asking them to sign in to their provider.
if let accountLogoutURL, UIApplication.shared.canOpenURL(accountLogoutURL) {
await UIApplication.shared.open(accountLogoutURL)
}
hideLoadingIndicator()
}
}

View File

@ -63,7 +63,6 @@ extension ClientProxyMock {
setUserAvatarMediaReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
removeUserAvatarReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
isAliasAvailableReturnValue = .success(true)
logoutReturnValue = nil
searchUsersSearchTermLimitReturnValue = .success(.init(results: [], limited: false))
profileForReturnValue = .success(.init(userID: "@a:b.com", displayName: "Some user"))
ignoreUserReturnValue = .success(())

View File

@ -3658,40 +3658,11 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
var logoutCalled: Bool {
return logoutCallsCount > 0
}
var logoutClosure: (() async -> Void)?
var logoutUnderlyingReturnValue: URL?
var logoutReturnValue: URL? {
get {
if Thread.isMainThread {
return logoutUnderlyingReturnValue
} else {
var returnValue: URL?? = nil
DispatchQueue.main.sync {
returnValue = logoutUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
logoutUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
logoutUnderlyingReturnValue = newValue
}
}
}
}
var logoutClosure: (() async -> URL?)?
func logout() async -> URL? {
func logout() async {
logoutCallsCount += 1
if let logoutClosure = logoutClosure {
return await logoutClosure()
} else {
return logoutReturnValue
}
await logoutClosure?()
}
//MARK: - setPusher

View File

@ -2526,43 +2526,14 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
open var logoutCalled: Bool {
return logoutCallsCount > 0
}
open var logoutClosure: (() async throws -> Void)?
var logoutUnderlyingReturnValue: String?
open var logoutReturnValue: String? {
get {
if Thread.isMainThread {
return logoutUnderlyingReturnValue
} else {
var returnValue: String?? = nil
DispatchQueue.main.sync {
returnValue = logoutUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
logoutUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
logoutUnderlyingReturnValue = newValue
}
}
}
}
open var logoutClosure: (() async throws -> String?)?
open override func logout() async throws -> String? {
open override func logout() async throws {
if let error = logoutThrowableError {
throw error
}
logoutCallsCount += 1
if let logoutClosure = logoutClosure {
return try await logoutClosure()
} else {
return logoutReturnValue
}
try await logoutClosure?()
}
//MARK: - notificationClient

View File

@ -584,12 +584,11 @@ class ClientProxy: ClientProxyProtocol {
}
}
func logout() async -> URL? {
func logout() async {
do {
return try await client.logout().flatMap(URL.init(string:))
try await client.logout()
} catch {
MXLog.error("Failed logging out with error: \(error)")
return nil
}
}

View File

@ -154,7 +154,7 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
func deactivateAccount(password: String?, eraseData: Bool) async -> Result<Void, ClientProxyError>
func logout() async -> URL?
func logout() async
func setPusher(with configuration: PusherConfiguration) async throws

View File

@ -22,8 +22,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams",
"state" : {
"revision" : "2688707e563b44d7d87c29ba6c5ca04ce86ae58b",
"version" : "5.3.0"
"revision" : "b4b8042411dc7bbb696300a34a4bf3ba1b7ad19b",
"version" : "5.3.1"
}
}
],

View File

@ -61,7 +61,7 @@ packages:
# Element/Matrix dependencies
MatrixRustSDK:
url: https://github.com/element-hq/matrix-rust-components-swift
exactVersion: 25.02.17
exactVersion: 25.02.25
# path: ../matrix-rust-sdk
Compound:
url: https://github.com/element-hq/compound-ios