From 2ea9302095aa714d6c7be9b49980340a0002ada5 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 15 May 2025 17:52:14 +0100 Subject: [PATCH] Update the SDK. --- ElementX.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../Sources/Mocks/BannedRoomProxyMock.swift | 2 +- .../Mocks/Generated/SDKGeneratedMocks.swift | 292 +++++++++++++----- .../Sources/Mocks/InvitedRoomProxyMock.swift | 2 +- .../Sources/Mocks/JoinedRoomProxyMock.swift | 2 +- .../Sources/Mocks/KnockedRoomProxyMock.swift | 2 +- .../Other/Extensions/ClientBuilder.swift | 1 - .../Sources/Services/Room/RoomInfoProxy.swift | 2 +- Package.resolved | 4 +- project.yml | 2 +- 11 files changed, 232 insertions(+), 83 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index fd95e1135..15a29c44c 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -8659,7 +8659,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 25.05.09; + version = 25.05.15; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index c07a97f50..739ee8c0a 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" : "cf913e1417825d08a67cd517b9272b7b808193a8", - "version" : "25.5.9" + "revision" : "e84fa0642d90ed123520fd458d920945becf6ba8", + "version" : "25.5.15" } }, { diff --git a/ElementX/Sources/Mocks/BannedRoomProxyMock.swift b/ElementX/Sources/Mocks/BannedRoomProxyMock.swift index 54be2a298..6a3ca0914 100644 --- a/ElementX/Sources/Mocks/BannedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/BannedRoomProxyMock.swift @@ -38,7 +38,7 @@ extension RoomInfo { isDirect: false, isPublic: false, isSpace: false, - isTombstoned: false, + tombstone: nil, isFavourite: false, canonicalAlias: nil, alternativeAliases: [], diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index 02b1b6db1..d5208c5cb 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -2795,6 +2795,152 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable { } } + //MARK: - observeAccountDataEvent + + var observeAccountDataEventEventTypeListenerUnderlyingCallsCount = 0 + open var observeAccountDataEventEventTypeListenerCallsCount: Int { + get { + if Thread.isMainThread { + return observeAccountDataEventEventTypeListenerUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = observeAccountDataEventEventTypeListenerUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + observeAccountDataEventEventTypeListenerUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + observeAccountDataEventEventTypeListenerUnderlyingCallsCount = newValue + } + } + } + } + open var observeAccountDataEventEventTypeListenerCalled: Bool { + return observeAccountDataEventEventTypeListenerCallsCount > 0 + } + open var observeAccountDataEventEventTypeListenerReceivedArguments: (eventType: AccountDataEventType, listener: AccountDataListener)? + open var observeAccountDataEventEventTypeListenerReceivedInvocations: [(eventType: AccountDataEventType, listener: AccountDataListener)] = [] + + var observeAccountDataEventEventTypeListenerUnderlyingReturnValue: TaskHandle! + open var observeAccountDataEventEventTypeListenerReturnValue: TaskHandle! { + get { + if Thread.isMainThread { + return observeAccountDataEventEventTypeListenerUnderlyingReturnValue + } else { + var returnValue: TaskHandle? = nil + DispatchQueue.main.sync { + returnValue = observeAccountDataEventEventTypeListenerUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + observeAccountDataEventEventTypeListenerUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + observeAccountDataEventEventTypeListenerUnderlyingReturnValue = newValue + } + } + } + } + open var observeAccountDataEventEventTypeListenerClosure: ((AccountDataEventType, AccountDataListener) -> TaskHandle)? + + open override func observeAccountDataEvent(eventType: AccountDataEventType, listener: AccountDataListener) -> TaskHandle { + observeAccountDataEventEventTypeListenerCallsCount += 1 + observeAccountDataEventEventTypeListenerReceivedArguments = (eventType: eventType, listener: listener) + DispatchQueue.main.async { + self.observeAccountDataEventEventTypeListenerReceivedInvocations.append((eventType: eventType, listener: listener)) + } + if let observeAccountDataEventEventTypeListenerClosure = observeAccountDataEventEventTypeListenerClosure { + return observeAccountDataEventEventTypeListenerClosure(eventType, listener) + } else { + return observeAccountDataEventEventTypeListenerReturnValue + } + } + + //MARK: - observeRoomAccountDataEvent + + open var observeRoomAccountDataEventRoomIdEventTypeListenerThrowableError: Error? + var observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount = 0 + open var observeRoomAccountDataEventRoomIdEventTypeListenerCallsCount: Int { + get { + if Thread.isMainThread { + return observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount = newValue + } + } + } + } + open var observeRoomAccountDataEventRoomIdEventTypeListenerCalled: Bool { + return observeRoomAccountDataEventRoomIdEventTypeListenerCallsCount > 0 + } + open var observeRoomAccountDataEventRoomIdEventTypeListenerReceivedArguments: (roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener)? + open var observeRoomAccountDataEventRoomIdEventTypeListenerReceivedInvocations: [(roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener)] = [] + + var observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReturnValue: TaskHandle! + open var observeRoomAccountDataEventRoomIdEventTypeListenerReturnValue: TaskHandle! { + get { + if Thread.isMainThread { + return observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReturnValue + } else { + var returnValue: TaskHandle? = nil + DispatchQueue.main.sync { + returnValue = observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReturnValue = newValue + } + } + } + } + open var observeRoomAccountDataEventRoomIdEventTypeListenerClosure: ((String, RoomAccountDataEventType, RoomAccountDataListener) throws -> TaskHandle)? + + open override func observeRoomAccountDataEvent(roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener) throws -> TaskHandle { + if let error = observeRoomAccountDataEventRoomIdEventTypeListenerThrowableError { + throw error + } + observeRoomAccountDataEventRoomIdEventTypeListenerCallsCount += 1 + observeRoomAccountDataEventRoomIdEventTypeListenerReceivedArguments = (roomId: roomId, eventType: eventType, listener: listener) + DispatchQueue.main.async { + self.observeRoomAccountDataEventRoomIdEventTypeListenerReceivedInvocations.append((roomId: roomId, eventType: eventType, listener: listener)) + } + if let observeRoomAccountDataEventRoomIdEventTypeListenerClosure = observeRoomAccountDataEventRoomIdEventTypeListenerClosure { + return try observeRoomAccountDataEventRoomIdEventTypeListenerClosure(roomId, eventType, listener) + } else { + return observeRoomAccountDataEventRoomIdEventTypeListenerReturnValue + } + } + //MARK: - removeAvatar open var removeAvatarThrowableError: Error? @@ -6313,77 +6459,6 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl } } - //MARK: - useEventCachePersistentStorage - - var useEventCachePersistentStorageValueUnderlyingCallsCount = 0 - open var useEventCachePersistentStorageValueCallsCount: Int { - get { - if Thread.isMainThread { - return useEventCachePersistentStorageValueUnderlyingCallsCount - } else { - var returnValue: Int? = nil - DispatchQueue.main.sync { - returnValue = useEventCachePersistentStorageValueUnderlyingCallsCount - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - useEventCachePersistentStorageValueUnderlyingCallsCount = newValue - } else { - DispatchQueue.main.sync { - useEventCachePersistentStorageValueUnderlyingCallsCount = newValue - } - } - } - } - open var useEventCachePersistentStorageValueCalled: Bool { - return useEventCachePersistentStorageValueCallsCount > 0 - } - open var useEventCachePersistentStorageValueReceivedValue: Bool? - open var useEventCachePersistentStorageValueReceivedInvocations: [Bool] = [] - - var useEventCachePersistentStorageValueUnderlyingReturnValue: ClientBuilder! - open var useEventCachePersistentStorageValueReturnValue: ClientBuilder! { - get { - if Thread.isMainThread { - return useEventCachePersistentStorageValueUnderlyingReturnValue - } else { - var returnValue: ClientBuilder? = nil - DispatchQueue.main.sync { - returnValue = useEventCachePersistentStorageValueUnderlyingReturnValue - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - useEventCachePersistentStorageValueUnderlyingReturnValue = newValue - } else { - DispatchQueue.main.sync { - useEventCachePersistentStorageValueUnderlyingReturnValue = newValue - } - } - } - } - open var useEventCachePersistentStorageValueClosure: ((Bool) -> ClientBuilder)? - - open override func useEventCachePersistentStorage(value: Bool) -> ClientBuilder { - useEventCachePersistentStorageValueCallsCount += 1 - useEventCachePersistentStorageValueReceivedValue = value - DispatchQueue.main.async { - self.useEventCachePersistentStorageValueReceivedInvocations.append(value) - } - if let useEventCachePersistentStorageValueClosure = useEventCachePersistentStorageValueClosure { - return useEventCachePersistentStorageValueClosure(value) - } else { - return useEventCachePersistentStorageValueReturnValue - } - } - //MARK: - userAgent var userAgentUserAgentUnderlyingCallsCount = 0 @@ -9264,6 +9339,81 @@ open class NotificationClientSDKMock: MatrixRustSDK.NotificationClient, @uncheck } } + //MARK: - getNotifications + + open var getNotificationsRequestsThrowableError: Error? + var getNotificationsRequestsUnderlyingCallsCount = 0 + open var getNotificationsRequestsCallsCount: Int { + get { + if Thread.isMainThread { + return getNotificationsRequestsUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = getNotificationsRequestsUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + getNotificationsRequestsUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + getNotificationsRequestsUnderlyingCallsCount = newValue + } + } + } + } + open var getNotificationsRequestsCalled: Bool { + return getNotificationsRequestsCallsCount > 0 + } + open var getNotificationsRequestsReceivedRequests: [NotificationItemsRequest]? + open var getNotificationsRequestsReceivedInvocations: [[NotificationItemsRequest]] = [] + + var getNotificationsRequestsUnderlyingReturnValue: [String: NotificationItem]! + open var getNotificationsRequestsReturnValue: [String: NotificationItem]! { + get { + if Thread.isMainThread { + return getNotificationsRequestsUnderlyingReturnValue + } else { + var returnValue: [String: NotificationItem]? = nil + DispatchQueue.main.sync { + returnValue = getNotificationsRequestsUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + getNotificationsRequestsUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + getNotificationsRequestsUnderlyingReturnValue = newValue + } + } + } + } + open var getNotificationsRequestsClosure: (([NotificationItemsRequest]) async throws -> [String: NotificationItem])? + + open override func getNotifications(requests: [NotificationItemsRequest]) async throws -> [String: NotificationItem] { + if let error = getNotificationsRequestsThrowableError { + throw error + } + getNotificationsRequestsCallsCount += 1 + getNotificationsRequestsReceivedRequests = requests + DispatchQueue.main.async { + self.getNotificationsRequestsReceivedInvocations.append(requests) + } + if let getNotificationsRequestsClosure = getNotificationsRequestsClosure { + return try await getNotificationsRequestsClosure(requests) + } else { + return getNotificationsRequestsReturnValue + } + } + //MARK: - getRoom open var getRoomRoomIdThrowableError: Error? diff --git a/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift b/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift index 2edea75cc..92181a5fa 100644 --- a/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift @@ -42,7 +42,7 @@ extension RoomInfo { isDirect: false, isPublic: false, isSpace: false, - isTombstoned: false, + tombstone: nil, isFavourite: false, canonicalAlias: nil, alternativeAliases: [], diff --git a/ElementX/Sources/Mocks/JoinedRoomProxyMock.swift b/ElementX/Sources/Mocks/JoinedRoomProxyMock.swift index aa0e10ae7..0d574662a 100644 --- a/ElementX/Sources/Mocks/JoinedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/JoinedRoomProxyMock.swift @@ -147,7 +147,7 @@ extension RoomInfo { isDirect: configuration.isDirect, isPublic: configuration.isPublic, isSpace: configuration.isSpace, - isTombstoned: false, + tombstone: nil, isFavourite: false, canonicalAlias: configuration.canonicalAlias, alternativeAliases: configuration.alternativeAliases, diff --git a/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift b/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift index 02db85717..ad85c44d8 100644 --- a/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift @@ -38,7 +38,7 @@ extension RoomInfo { isDirect: false, isPublic: false, isSpace: false, - isTombstoned: false, + tombstone: nil, isFavourite: false, canonicalAlias: nil, alternativeAliases: [], diff --git a/ElementX/Sources/Other/Extensions/ClientBuilder.swift b/ElementX/Sources/Other/Extensions/ClientBuilder.swift index d49a2cfea..2ba5b096d 100644 --- a/ElementX/Sources/Other/Extensions/ClientBuilder.swift +++ b/ElementX/Sources/Other/Extensions/ClientBuilder.swift @@ -27,7 +27,6 @@ extension ClientBuilder { timeout: requestTimeout, maxConcurrentRequests: nil, maxRetryTime: maxRequestRetryTime)) - .useEventCachePersistentStorage(value: true) builder = switch slidingSync { case .restored: builder diff --git a/ElementX/Sources/Services/Room/RoomInfoProxy.swift b/ElementX/Sources/Services/Room/RoomInfoProxy.swift index d45b7019c..fc696c403 100644 --- a/ElementX/Sources/Services/Room/RoomInfoProxy.swift +++ b/ElementX/Sources/Services/Room/RoomInfoProxy.swift @@ -61,7 +61,7 @@ struct RoomInfoProxy: BaseRoomInfoProxyProtocol { } var isSpace: Bool { roomInfo.isSpace } - var isTombstoned: Bool { roomInfo.isTombstoned } + var tombstoneInfo: RoomTombstoneInfo? { roomInfo.tombstone } var isFavourite: Bool { roomInfo.isFavourite } var canonicalAlias: String? { roomInfo.canonicalAlias } var alternativeAliases: [String] { roomInfo.alternativeAliases } diff --git a/Package.resolved b/Package.resolved index 4226759ba..9db2b46f3 100644 --- a/Package.resolved +++ b/Package.resolved @@ -22,8 +22,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/jpsim/Yams", "state" : { - "revision" : "b4b8042411dc7bbb696300a34a4bf3ba1b7ad19b", - "version" : "5.3.1" + "revision" : "3d6871d5b4a5cd519adf233fbb576e0a2af71c17", + "version" : "5.4.0" } } ], diff --git a/project.yml b/project.yml index 1bf399ebd..05122b1dc 100644 --- a/project.yml +++ b/project.yml @@ -65,7 +65,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/element-hq/matrix-rust-components-swift - exactVersion: 25.05.09 + exactVersion: 25.05.15 # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios