From d611bad03b37f1e55de68c5d2ac897e96716bdf6 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 25 Aug 2026 13:32:42 +0200 Subject: [PATCH] update sdk to 26.08.25 --- .../Sources/Generated/SDKGeneratedMocks.swift | 193 ++++++++---------- ElementX.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 6 +- .../UserSession/UserSessionStore.swift | 2 +- NSE/Sources/NSEUserSession.swift | 2 +- project.yml | 2 +- 6 files changed, 97 insertions(+), 110 deletions(-) diff --git a/Components/SDKMocks/Sources/Generated/SDKGeneratedMocks.swift b/Components/SDKMocks/Sources/Generated/SDKGeneratedMocks.swift index 090885559..f01fdd0a2 100644 --- a/Components/SDKMocks/Sources/Generated/SDKGeneratedMocks.swift +++ b/Components/SDKMocks/Sources/Generated/SDKGeneratedMocks.swift @@ -6,21 +6,6 @@ import Foundation -open class BackupSecretsSDKMock: MatrixRustSDK.BackupSecrets, @unchecked Sendable { - public init() { - super.init(noHandle: .init()) - } - - public required init(unsafeFromHandle handle: UInt64) { - fatalError("init(unsafeFromHandle:) has not been implemented") - } - - fileprivate var handle: UInt64 { - get { return underlyingHandle } - set(value) { underlyingHandle = value } - } - fileprivate var underlyingHandle: UInt64! -} open class CheckCodeSenderSDKMock: MatrixRustSDK.CheckCodeSender, @unchecked Sendable { public init() { super.init(noHandle: .init()) @@ -5218,6 +5203,49 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl } } + //MARK: - serverNameFromUserId + + private let serverNameFromUserIdUserIdCallsCountLock = NSLock() + private var serverNameFromUserIdUserIdUnderlyingCallsCount = 0 + open var serverNameFromUserIdUserIdCallsCount: Int { + get { serverNameFromUserIdUserIdCallsCountLock.withLock { serverNameFromUserIdUserIdUnderlyingCallsCount } } + set { serverNameFromUserIdUserIdCallsCountLock.withLock { serverNameFromUserIdUserIdUnderlyingCallsCount = newValue } } + } + open var serverNameFromUserIdUserIdCalled: Bool { + return serverNameFromUserIdUserIdCallsCount > 0 + } + private let serverNameFromUserIdUserIdReceivedUserIdLock = NSLock() + private var serverNameFromUserIdUserIdUnderlyingReceivedUserId: String? + open var serverNameFromUserIdUserIdReceivedUserId: String? { + get { serverNameFromUserIdUserIdReceivedUserIdLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedUserId } } + set { serverNameFromUserIdUserIdReceivedUserIdLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedUserId = newValue } } + } + private let serverNameFromUserIdUserIdReceivedInvocationsLock = NSLock() + private var serverNameFromUserIdUserIdUnderlyingReceivedInvocations: [String] = [] + open var serverNameFromUserIdUserIdReceivedInvocations: [String] { + get { serverNameFromUserIdUserIdReceivedInvocationsLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedInvocations } } + set { serverNameFromUserIdUserIdReceivedInvocationsLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedInvocations = newValue } } + } + + private let serverNameFromUserIdUserIdReturnValueLock = NSLock() + open var serverNameFromUserIdUserIdUnderlyingReturnValue: ClientBuilder! + open var serverNameFromUserIdUserIdReturnValue: ClientBuilder! { + get { serverNameFromUserIdUserIdReturnValueLock.withLock { serverNameFromUserIdUserIdUnderlyingReturnValue } } + set { serverNameFromUserIdUserIdReturnValueLock.withLock { serverNameFromUserIdUserIdUnderlyingReturnValue = newValue } } + } + open var serverNameFromUserIdUserIdClosure: ((String) -> ClientBuilder)? + + open override func serverNameFromUserId(userId: String) -> ClientBuilder { + serverNameFromUserIdUserIdCallsCountLock.withLock { serverNameFromUserIdUserIdUnderlyingCallsCount += 1 } + serverNameFromUserIdUserIdReceivedUserId = userId + serverNameFromUserIdUserIdReceivedInvocationsLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedInvocations.append(userId) } + if let serverNameFromUserIdUserIdClosure = serverNameFromUserIdUserIdClosure { + return serverNameFromUserIdUserIdClosure(userId) + } else { + return serverNameFromUserIdUserIdReturnValue + } + } + //MARK: - serverNameOrHomeserverUrl private let serverNameOrHomeserverUrlServerNameOrUrlCallsCountLock = NSLock() @@ -5548,49 +5576,6 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl } } - //MARK: - username - - private let usernameUsernameCallsCountLock = NSLock() - private var usernameUsernameUnderlyingCallsCount = 0 - open var usernameUsernameCallsCount: Int { - get { usernameUsernameCallsCountLock.withLock { usernameUsernameUnderlyingCallsCount } } - set { usernameUsernameCallsCountLock.withLock { usernameUsernameUnderlyingCallsCount = newValue } } - } - open var usernameUsernameCalled: Bool { - return usernameUsernameCallsCount > 0 - } - private let usernameUsernameReceivedUsernameLock = NSLock() - private var usernameUsernameUnderlyingReceivedUsername: String? - open var usernameUsernameReceivedUsername: String? { - get { usernameUsernameReceivedUsernameLock.withLock { usernameUsernameUnderlyingReceivedUsername } } - set { usernameUsernameReceivedUsernameLock.withLock { usernameUsernameUnderlyingReceivedUsername = newValue } } - } - private let usernameUsernameReceivedInvocationsLock = NSLock() - private var usernameUsernameUnderlyingReceivedInvocations: [String] = [] - open var usernameUsernameReceivedInvocations: [String] { - get { usernameUsernameReceivedInvocationsLock.withLock { usernameUsernameUnderlyingReceivedInvocations } } - set { usernameUsernameReceivedInvocationsLock.withLock { usernameUsernameUnderlyingReceivedInvocations = newValue } } - } - - private let usernameUsernameReturnValueLock = NSLock() - open var usernameUsernameUnderlyingReturnValue: ClientBuilder! - open var usernameUsernameReturnValue: ClientBuilder! { - get { usernameUsernameReturnValueLock.withLock { usernameUsernameUnderlyingReturnValue } } - set { usernameUsernameReturnValueLock.withLock { usernameUsernameUnderlyingReturnValue = newValue } } - } - open var usernameUsernameClosure: ((String) -> ClientBuilder)? - - open override func username(username: String) -> ClientBuilder { - usernameUsernameCallsCountLock.withLock { usernameUsernameUnderlyingCallsCount += 1 } - usernameUsernameReceivedUsername = username - usernameUsernameReceivedInvocationsLock.withLock { usernameUsernameUnderlyingReceivedInvocations.append(username) } - if let usernameUsernameClosure = usernameUsernameClosure { - return usernameUsernameClosure(username) - } else { - return usernameUsernameReturnValue - } - } - //MARK: - withSearchIndexStore private let withSearchIndexStorePathPasswordCallsCountLock = NSLock() @@ -5755,21 +5740,6 @@ open class ContinuationMessageSenderSDKMock: MatrixRustSDK.ContinuationMessageSe try await confirmClosure?() } } -open class CrossSigningSecretsSDKMock: MatrixRustSDK.CrossSigningSecrets, @unchecked Sendable { - public init() { - super.init(noHandle: .init()) - } - - public required init(unsafeFromHandle handle: UInt64) { - fatalError("init(unsafeFromHandle:) has not been implemented") - } - - fileprivate var handle: UInt64 { - get { return underlyingHandle } - set(value) { underlyingHandle = value } - } - fileprivate var underlyingHandle: UInt64! -} open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable { public init() { super.init(noHandle: .init()) @@ -9326,21 +9296,6 @@ open class PasswordStrengthEstimatorSDKMock: MatrixRustSDK.PasswordStrengthEstim } } } -open class PrivateStringSDKMock: MatrixRustSDK.PrivateString, @unchecked Sendable { - public init() { - super.init(noHandle: .init()) - } - - public required init(unsafeFromHandle handle: UInt64) { - fatalError("init(unsafeFromHandle:) has not been implemented") - } - - fileprivate var handle: UInt64 { - get { return underlyingHandle } - set(value) { underlyingHandle = value } - } - fileprivate var underlyingHandle: UInt64! -} open class QrCodeDataSDKMock: MatrixRustSDK.QrCodeData, @unchecked Sendable { public init() { super.init(noHandle: .init()) @@ -10780,6 +10735,53 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable { } } + //MARK: - loadOrFetchEventWithRelations + + open var loadOrFetchEventWithRelationsEventIdRelationFilterThrowableError: Error? + private let loadOrFetchEventWithRelationsEventIdRelationFilterCallsCountLock = NSLock() + private var loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingCallsCount = 0 + open var loadOrFetchEventWithRelationsEventIdRelationFilterCallsCount: Int { + get { loadOrFetchEventWithRelationsEventIdRelationFilterCallsCountLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingCallsCount } } + set { loadOrFetchEventWithRelationsEventIdRelationFilterCallsCountLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingCallsCount = newValue } } + } + open var loadOrFetchEventWithRelationsEventIdRelationFilterCalled: Bool { + return loadOrFetchEventWithRelationsEventIdRelationFilterCallsCount > 0 + } + private let loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArgumentsLock = NSLock() + private var loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedArguments: (eventId: String, relationFilter: [RelationType]?)? + open var loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArguments: (eventId: String, relationFilter: [RelationType]?)? { + get { loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArgumentsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedArguments } } + set { loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArgumentsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedArguments = newValue } } + } + private let loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocationsLock = NSLock() + private var loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedInvocations: [(eventId: String, relationFilter: [RelationType]?)] = [] + open var loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocations: [(eventId: String, relationFilter: [RelationType]?)] { + get { loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocationsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedInvocations } } + set { loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocationsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedInvocations = newValue } } + } + + private let loadOrFetchEventWithRelationsEventIdRelationFilterReturnValueLock = NSLock() + open var loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReturnValue: EventWithRelations! + open var loadOrFetchEventWithRelationsEventIdRelationFilterReturnValue: EventWithRelations! { + get { loadOrFetchEventWithRelationsEventIdRelationFilterReturnValueLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReturnValue } } + set { loadOrFetchEventWithRelationsEventIdRelationFilterReturnValueLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReturnValue = newValue } } + } + open var loadOrFetchEventWithRelationsEventIdRelationFilterClosure: ((String, [RelationType]?) async throws -> EventWithRelations)? + + open override func loadOrFetchEventWithRelations(eventId: String, relationFilter: [RelationType]?) async throws -> EventWithRelations { + if let error = loadOrFetchEventWithRelationsEventIdRelationFilterThrowableError { + throw error + } + loadOrFetchEventWithRelationsEventIdRelationFilterCallsCountLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingCallsCount += 1 } + loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArguments = (eventId: eventId, relationFilter: relationFilter) + loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocationsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedInvocations.append((eventId: eventId, relationFilter: relationFilter)) } + if let loadOrFetchEventWithRelationsEventIdRelationFilterClosure = loadOrFetchEventWithRelationsEventIdRelationFilterClosure { + return try await loadOrFetchEventWithRelationsEventIdRelationFilterClosure(eventId, relationFilter) + } else { + return loadOrFetchEventWithRelationsEventIdRelationFilterReturnValue + } + } + //MARK: - loadUserReceipt open var loadUserReceiptReceiptTypeThreadUserIdThrowableError: Error? @@ -15054,21 +15056,6 @@ open class SearchServiceSDKMock: MatrixRustSDK.SearchService, @unchecked Sendabl } } } -open class SecretsBundleSDKMock: MatrixRustSDK.SecretsBundle, @unchecked Sendable { - public init() { - super.init(noHandle: .init()) - } - - public required init(unsafeFromHandle handle: UInt64) { - fatalError("init(unsafeFromHandle:) has not been implemented") - } - - fileprivate var handle: UInt64 { - get { return underlyingHandle } - set(value) { underlyingHandle = value } - } - fileprivate var underlyingHandle: UInt64! -} open class SecretsBundleWithUserIdSDKMock: MatrixRustSDK.SecretsBundleWithUserId, @unchecked Sendable { public init() { super.init(noHandle: .init()) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 4a575152d..84c532446 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -10759,7 +10759,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 26.08.17; + version = 26.08.25; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 415a048e1..51f12b32d 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "fbe2663429af94e60cfa70345bffe72998cbc19f6f659bd6f3c1a0ddc50b941d", + "originHash" : "20b091ffed1191ab205d228b4682ceec9698235e1d8eb82e9aba1703fc8e9f05", "pins" : [ { "identity" : "compound-design-tokens", @@ -167,8 +167,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/element-hq/matrix-rust-components-swift", "state" : { - "revision" : "f3c898f9673df5405f4e65e35920f10bab32b847", - "version" : "26.8.17" + "revision" : "decad9ee1e9a10a341cc61e40dc8a7f7028b7437", + "version" : "26.8.25" } }, { diff --git a/ElementX/Sources/Services/UserSession/UserSessionStore.swift b/ElementX/Sources/Services/UserSession/UserSessionStore.swift index c6f36745e..39fcfa54d 100644 --- a/ElementX/Sources/Services/UserSession/UserSessionStore.swift +++ b/ElementX/Sources/Services/UserSession/UserSessionStore.swift @@ -142,7 +142,7 @@ class UserSessionStore: UserSessionStoreProtocol { .passphrase(passphrase: credentials.restorationToken.passphrase)) .withSearchIndexStore(path: credentials.restorationToken.sessionDirectories.dataPath, password: credentials.restorationToken.passphrase) - .username(username: credentials.userID) + .serverNameFromUserId(userId: credentials.userID) .homeserverUrl(url: homeserverURL) do { diff --git a/NSE/Sources/NSEUserSession.swift b/NSE/Sources/NSEUserSession.swift index dc5e74255..489eacb19 100644 --- a/NSE/Sources/NSEUserSession.swift +++ b/NSE/Sources/NSEUserSession.swift @@ -75,7 +75,7 @@ final nonisolated class NSEUserSession: NSEUserSessionProtocol { .sqliteStore(config: .init(dataPath: credentials.restorationToken.sessionDirectories.dataPath, cachePath: credentials.restorationToken.sessionDirectories.cachePath) .passphrase(passphrase: credentials.restorationToken.passphrase)) - .username(username: credentials.userID) + .serverNameFromUserId(userId: credentials.userID) .homeserverUrl(url: homeserverURL) baseClient = try await clientBuilder.build() diff --git a/project.yml b/project.yml index 3f5ae5476..c0ec79587 100644 --- a/project.yml +++ b/project.yml @@ -74,7 +74,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/element-hq/matrix-rust-components-swift - exactVersion: 26.08.17 + exactVersion: 26.08.25 # path: ../matrix-rust-sdk Compound: path: compound-ios