From 881017f97a4185a8809dfb127a9b52445064f97d Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 3 Apr 2025 15:08:15 +0300 Subject: [PATCH] Bump the RustSDK to v25.04.02 --- ElementX.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../Mocks/Generated/SDKGeneratedMocks.swift | 401 ++++++++++++++---- .../AuthenticationClientBuilder.swift | 2 +- .../Services/Timeline/TimelineProxy.swift | 5 + .../UserSession/UserSessionStore.swift | 2 +- NSE/Sources/Other/NSEUserSession.swift | 2 +- project.yml | 2 +- 8 files changed, 342 insertions(+), 78 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index deea16608..4b328c388 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -8549,7 +8549,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 25.03.31; + version = 25.04.02; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 203a5bfad..c1cfff644 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -158,8 +158,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/element-hq/matrix-rust-components-swift", "state" : { - "revision" : "271f8e34dd754ff6873350576d601442fe18b1d8", - "version" : "25.3.31" + "revision" : "1bc2c0b021107332e0691e288780e8a3adb87905", + "version" : "25.4.2" } }, { diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index 7804f8f32..64da7f949 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -2927,6 +2927,52 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable { try await restoreSessionSessionClosure?(session) } + //MARK: - restoreSessionWith + + open var restoreSessionWithSessionRoomLoadSettingsThrowableError: Error? + var restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount = 0 + open var restoreSessionWithSessionRoomLoadSettingsCallsCount: Int { + get { + if Thread.isMainThread { + return restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount = newValue + } + } + } + } + open var restoreSessionWithSessionRoomLoadSettingsCalled: Bool { + return restoreSessionWithSessionRoomLoadSettingsCallsCount > 0 + } + open var restoreSessionWithSessionRoomLoadSettingsReceivedArguments: (session: Session, roomLoadSettings: RoomLoadSettings)? + open var restoreSessionWithSessionRoomLoadSettingsReceivedInvocations: [(session: Session, roomLoadSettings: RoomLoadSettings)] = [] + open var restoreSessionWithSessionRoomLoadSettingsClosure: ((Session, RoomLoadSettings) async throws -> Void)? + + open override func restoreSessionWith(session: Session, roomLoadSettings: RoomLoadSettings) async throws { + if let error = restoreSessionWithSessionRoomLoadSettingsThrowableError { + throw error + } + restoreSessionWithSessionRoomLoadSettingsCallsCount += 1 + restoreSessionWithSessionRoomLoadSettingsReceivedArguments = (session: session, roomLoadSettings: roomLoadSettings) + DispatchQueue.main.async { + self.restoreSessionWithSessionRoomLoadSettingsReceivedInvocations.append((session: session, roomLoadSettings: roomLoadSettings)) + } + try await restoreSessionWithSessionRoomLoadSettingsClosure?(session, roomLoadSettings) + } + //MARK: - roomAliasExists open var roomAliasExistsRoomAliasThrowableError: Error? @@ -5210,77 +5256,6 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl } } - //MARK: - passphrase - - var passphrasePassphraseUnderlyingCallsCount = 0 - open var passphrasePassphraseCallsCount: Int { - get { - if Thread.isMainThread { - return passphrasePassphraseUnderlyingCallsCount - } else { - var returnValue: Int? = nil - DispatchQueue.main.sync { - returnValue = passphrasePassphraseUnderlyingCallsCount - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - passphrasePassphraseUnderlyingCallsCount = newValue - } else { - DispatchQueue.main.sync { - passphrasePassphraseUnderlyingCallsCount = newValue - } - } - } - } - open var passphrasePassphraseCalled: Bool { - return passphrasePassphraseCallsCount > 0 - } - open var passphrasePassphraseReceivedPassphrase: String? - open var passphrasePassphraseReceivedInvocations: [String?] = [] - - var passphrasePassphraseUnderlyingReturnValue: ClientBuilder! - open var passphrasePassphraseReturnValue: ClientBuilder! { - get { - if Thread.isMainThread { - return passphrasePassphraseUnderlyingReturnValue - } else { - var returnValue: ClientBuilder? = nil - DispatchQueue.main.sync { - returnValue = passphrasePassphraseUnderlyingReturnValue - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - passphrasePassphraseUnderlyingReturnValue = newValue - } else { - DispatchQueue.main.sync { - passphrasePassphraseUnderlyingReturnValue = newValue - } - } - } - } - open var passphrasePassphraseClosure: ((String?) -> ClientBuilder)? - - open override func passphrase(passphrase: String?) -> ClientBuilder { - passphrasePassphraseCallsCount += 1 - passphrasePassphraseReceivedPassphrase = passphrase - DispatchQueue.main.async { - self.passphrasePassphraseReceivedInvocations.append(passphrase) - } - if let passphrasePassphraseClosure = passphrasePassphraseClosure { - return passphrasePassphraseClosure(passphrase) - } else { - return passphrasePassphraseReturnValue - } - } - //MARK: - proxy var proxyUrlUnderlyingCallsCount = 0 @@ -5707,6 +5682,219 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl } } + //MARK: - sessionCacheSize + + var sessionCacheSizeCacheSizeUnderlyingCallsCount = 0 + open var sessionCacheSizeCacheSizeCallsCount: Int { + get { + if Thread.isMainThread { + return sessionCacheSizeCacheSizeUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = sessionCacheSizeCacheSizeUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + sessionCacheSizeCacheSizeUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + sessionCacheSizeCacheSizeUnderlyingCallsCount = newValue + } + } + } + } + open var sessionCacheSizeCacheSizeCalled: Bool { + return sessionCacheSizeCacheSizeCallsCount > 0 + } + open var sessionCacheSizeCacheSizeReceivedCacheSize: UInt32? + open var sessionCacheSizeCacheSizeReceivedInvocations: [UInt32?] = [] + + var sessionCacheSizeCacheSizeUnderlyingReturnValue: ClientBuilder! + open var sessionCacheSizeCacheSizeReturnValue: ClientBuilder! { + get { + if Thread.isMainThread { + return sessionCacheSizeCacheSizeUnderlyingReturnValue + } else { + var returnValue: ClientBuilder? = nil + DispatchQueue.main.sync { + returnValue = sessionCacheSizeCacheSizeUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + sessionCacheSizeCacheSizeUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + sessionCacheSizeCacheSizeUnderlyingReturnValue = newValue + } + } + } + } + open var sessionCacheSizeCacheSizeClosure: ((UInt32?) -> ClientBuilder)? + + open override func sessionCacheSize(cacheSize: UInt32?) -> ClientBuilder { + sessionCacheSizeCacheSizeCallsCount += 1 + sessionCacheSizeCacheSizeReceivedCacheSize = cacheSize + DispatchQueue.main.async { + self.sessionCacheSizeCacheSizeReceivedInvocations.append(cacheSize) + } + if let sessionCacheSizeCacheSizeClosure = sessionCacheSizeCacheSizeClosure { + return sessionCacheSizeCacheSizeClosure(cacheSize) + } else { + return sessionCacheSizeCacheSizeReturnValue + } + } + + //MARK: - sessionJournalSizeLimit + + var sessionJournalSizeLimitLimitUnderlyingCallsCount = 0 + open var sessionJournalSizeLimitLimitCallsCount: Int { + get { + if Thread.isMainThread { + return sessionJournalSizeLimitLimitUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = sessionJournalSizeLimitLimitUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + sessionJournalSizeLimitLimitUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + sessionJournalSizeLimitLimitUnderlyingCallsCount = newValue + } + } + } + } + open var sessionJournalSizeLimitLimitCalled: Bool { + return sessionJournalSizeLimitLimitCallsCount > 0 + } + open var sessionJournalSizeLimitLimitReceivedLimit: UInt32? + open var sessionJournalSizeLimitLimitReceivedInvocations: [UInt32?] = [] + + var sessionJournalSizeLimitLimitUnderlyingReturnValue: ClientBuilder! + open var sessionJournalSizeLimitLimitReturnValue: ClientBuilder! { + get { + if Thread.isMainThread { + return sessionJournalSizeLimitLimitUnderlyingReturnValue + } else { + var returnValue: ClientBuilder? = nil + DispatchQueue.main.sync { + returnValue = sessionJournalSizeLimitLimitUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + sessionJournalSizeLimitLimitUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + sessionJournalSizeLimitLimitUnderlyingReturnValue = newValue + } + } + } + } + open var sessionJournalSizeLimitLimitClosure: ((UInt32?) -> ClientBuilder)? + + open override func sessionJournalSizeLimit(limit: UInt32?) -> ClientBuilder { + sessionJournalSizeLimitLimitCallsCount += 1 + sessionJournalSizeLimitLimitReceivedLimit = limit + DispatchQueue.main.async { + self.sessionJournalSizeLimitLimitReceivedInvocations.append(limit) + } + if let sessionJournalSizeLimitLimitClosure = sessionJournalSizeLimitLimitClosure { + return sessionJournalSizeLimitLimitClosure(limit) + } else { + return sessionJournalSizeLimitLimitReturnValue + } + } + + //MARK: - sessionPassphrase + + var sessionPassphrasePassphraseUnderlyingCallsCount = 0 + open var sessionPassphrasePassphraseCallsCount: Int { + get { + if Thread.isMainThread { + return sessionPassphrasePassphraseUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = sessionPassphrasePassphraseUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + sessionPassphrasePassphraseUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + sessionPassphrasePassphraseUnderlyingCallsCount = newValue + } + } + } + } + open var sessionPassphrasePassphraseCalled: Bool { + return sessionPassphrasePassphraseCallsCount > 0 + } + open var sessionPassphrasePassphraseReceivedPassphrase: String? + open var sessionPassphrasePassphraseReceivedInvocations: [String?] = [] + + var sessionPassphrasePassphraseUnderlyingReturnValue: ClientBuilder! + open var sessionPassphrasePassphraseReturnValue: ClientBuilder! { + get { + if Thread.isMainThread { + return sessionPassphrasePassphraseUnderlyingReturnValue + } else { + var returnValue: ClientBuilder? = nil + DispatchQueue.main.sync { + returnValue = sessionPassphrasePassphraseUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + sessionPassphrasePassphraseUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + sessionPassphrasePassphraseUnderlyingReturnValue = newValue + } + } + } + } + open var sessionPassphrasePassphraseClosure: ((String?) -> ClientBuilder)? + + open override func sessionPassphrase(passphrase: String?) -> ClientBuilder { + sessionPassphrasePassphraseCallsCount += 1 + sessionPassphrasePassphraseReceivedPassphrase = passphrase + DispatchQueue.main.async { + self.sessionPassphrasePassphraseReceivedInvocations.append(passphrase) + } + if let sessionPassphrasePassphraseClosure = sessionPassphrasePassphraseClosure { + return sessionPassphrasePassphraseClosure(passphrase) + } else { + return sessionPassphrasePassphraseReturnValue + } + } + //MARK: - sessionPaths var sessionPathsDataPathCachePathUnderlyingCallsCount = 0 @@ -5778,6 +5966,77 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl } } + //MARK: - sessionPoolMaxSize + + var sessionPoolMaxSizePoolMaxSizeUnderlyingCallsCount = 0 + open var sessionPoolMaxSizePoolMaxSizeCallsCount: Int { + get { + if Thread.isMainThread { + return sessionPoolMaxSizePoolMaxSizeUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = sessionPoolMaxSizePoolMaxSizeUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + sessionPoolMaxSizePoolMaxSizeUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + sessionPoolMaxSizePoolMaxSizeUnderlyingCallsCount = newValue + } + } + } + } + open var sessionPoolMaxSizePoolMaxSizeCalled: Bool { + return sessionPoolMaxSizePoolMaxSizeCallsCount > 0 + } + open var sessionPoolMaxSizePoolMaxSizeReceivedPoolMaxSize: UInt32? + open var sessionPoolMaxSizePoolMaxSizeReceivedInvocations: [UInt32?] = [] + + var sessionPoolMaxSizePoolMaxSizeUnderlyingReturnValue: ClientBuilder! + open var sessionPoolMaxSizePoolMaxSizeReturnValue: ClientBuilder! { + get { + if Thread.isMainThread { + return sessionPoolMaxSizePoolMaxSizeUnderlyingReturnValue + } else { + var returnValue: ClientBuilder? = nil + DispatchQueue.main.sync { + returnValue = sessionPoolMaxSizePoolMaxSizeUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + sessionPoolMaxSizePoolMaxSizeUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + sessionPoolMaxSizePoolMaxSizeUnderlyingReturnValue = newValue + } + } + } + } + open var sessionPoolMaxSizePoolMaxSizeClosure: ((UInt32?) -> ClientBuilder)? + + open override func sessionPoolMaxSize(poolMaxSize: UInt32?) -> ClientBuilder { + sessionPoolMaxSizePoolMaxSizeCallsCount += 1 + sessionPoolMaxSizePoolMaxSizeReceivedPoolMaxSize = poolMaxSize + DispatchQueue.main.async { + self.sessionPoolMaxSizePoolMaxSizeReceivedInvocations.append(poolMaxSize) + } + if let sessionPoolMaxSizePoolMaxSizeClosure = sessionPoolMaxSizePoolMaxSizeClosure { + return sessionPoolMaxSizePoolMaxSizeClosure(poolMaxSize) + } else { + return sessionPoolMaxSizePoolMaxSizeReturnValue + } + } + //MARK: - setSessionDelegate var setSessionDelegateSessionDelegateUnderlyingCallsCount = 0 diff --git a/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift b/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift index 233ac9387..017c838df 100644 --- a/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift +++ b/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift @@ -52,6 +52,6 @@ struct AuthenticationClientBuilder: AuthenticationClientBuilderProtocol { eventCacheEnabled: appSettings.eventCacheEnabled) .sessionPaths(dataPath: sessionDirectories.dataPath, cachePath: sessionDirectories.cachePath) - .passphrase(passphrase: passphrase) + .sessionPassphrase(passphrase: passphrase) } } diff --git a/ElementX/Sources/Services/Timeline/TimelineProxy.swift b/ElementX/Sources/Services/Timeline/TimelineProxy.swift index bd821baf2..9f4a5003e 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxy.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxy.swift @@ -236,6 +236,7 @@ final class TimelineProxy: TimelineProxyProtocol { caption: caption, formattedCaption: nil, // Rust will build this from the caption's markdown. mentions: nil, + replyParams: nil, useSendQueue: true), audioInfo: audioInfo, progressWatcher: nil) @@ -263,6 +264,7 @@ final class TimelineProxy: TimelineProxyProtocol { caption: caption, formattedCaption: nil, // Rust will build this from the caption's markdown. mentions: nil, + replyParams: nil, useSendQueue: true), fileInfo: fileInfo, progressWatcher: nil) @@ -291,6 +293,7 @@ final class TimelineProxy: TimelineProxyProtocol { caption: caption, formattedCaption: nil, // Rust will build this from the caption's markdown. mentions: nil, + replyParams: nil, useSendQueue: true), thumbnailPath: thumbnailURL.path(percentEncoded: false), imageInfo: imageInfo, @@ -338,6 +341,7 @@ final class TimelineProxy: TimelineProxyProtocol { caption: caption, formattedCaption: nil, mentions: nil, + replyParams: nil, useSendQueue: true), thumbnailPath: thumbnailURL.path(percentEncoded: false), videoInfo: videoInfo, @@ -366,6 +370,7 @@ final class TimelineProxy: TimelineProxyProtocol { caption: nil, formattedCaption: nil, mentions: nil, + replyParams: nil, useSendQueue: true), audioInfo: audioInfo, waveform: waveform, diff --git a/ElementX/Sources/Services/UserSession/UserSessionStore.swift b/ElementX/Sources/Services/UserSession/UserSessionStore.swift index 2e39c7da7..883a4ae49 100644 --- a/ElementX/Sources/Services/UserSession/UserSessionStore.swift +++ b/ElementX/Sources/Services/UserSession/UserSessionStore.swift @@ -129,7 +129,7 @@ class UserSessionStore: UserSessionStoreProtocol { cachePath: credentials.restorationToken.sessionDirectories.cachePath) .username(username: credentials.userID) .homeserverUrl(url: homeserverURL) - .passphrase(passphrase: credentials.restorationToken.passphrase) + .sessionPassphrase(passphrase: credentials.restorationToken.passphrase) do { let client = try await builder.build() diff --git a/NSE/Sources/Other/NSEUserSession.swift b/NSE/Sources/Other/NSEUserSession.swift index 7fddb8fe3..80a42815d 100644 --- a/NSE/Sources/Other/NSEUserSession.swift +++ b/NSE/Sources/Other/NSEUserSession.swift @@ -40,7 +40,7 @@ final class NSEUserSession { cachePath: credentials.restorationToken.sessionDirectories.cachePath) .username(username: credentials.userID) .homeserverUrl(url: homeserverURL) - .passphrase(passphrase: credentials.restorationToken.passphrase) + .sessionPassphrase(passphrase: credentials.restorationToken.passphrase) baseClient = try await clientBuilder.build() delegateHandle = baseClient.setDelegate(delegate: ClientDelegateWrapper()) diff --git a/project.yml b/project.yml index 1ee858105..5510c7ba7 100644 --- a/project.yml +++ b/project.yml @@ -59,7 +59,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/element-hq/matrix-rust-components-swift - exactVersion: 25.03.31 + exactVersion: 25.04.02 # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios