Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions ElementX/Sources/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
}
}
Expand Down
1 change: 0 additions & 1 deletion ElementX/Sources/Mocks/ClientProxyMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
35 changes: 3 additions & 32 deletions ElementX/Sources/Mocks/Generated/GeneratedMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
35 changes: 3 additions & 32 deletions ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions ElementX/Sources/Services/Client/ClientProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class TimelineProvider: TimelineProviderProtocol {
// MARK: - Private

private func updateItemsWithDiffs(_ diffs: [TimelineDiff]) {
let span = MXLog.createSpan("process_timeline_list_diffs")
let span = MXLog.createSpan("process_timeline_list_diffs:\(kind)")
span.enter()
defer {
span.exit()
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading