Bump the RustSDK to v25.07.04

This commit is contained in:
Stefan Ceriu
2025-07-04 13:21:54 +03:00
committed by Stefan Ceriu
parent d7e83f3c16
commit d2933df2d0
6 changed files with 100 additions and 23 deletions

View File

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

View File

@@ -158,8 +158,8 @@
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift", "location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : { "state" : {
"revision" : "ab5a18fc12ff4b66a523edacecb8371b1d6fe86f", "revision" : "9ca4d9e3b6fc15f1decf024a7474b368525ef52a",
"version" : "25.7.3" "version" : "25.7.4"
} }
}, },
{ {

View File

@@ -7173,6 +7173,77 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl
} }
} }
//MARK: - threadsEnabled
var threadsEnabledEnabledUnderlyingCallsCount = 0
open var threadsEnabledEnabledCallsCount: Int {
get {
if Thread.isMainThread {
return threadsEnabledEnabledUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = threadsEnabledEnabledUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
threadsEnabledEnabledUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
threadsEnabledEnabledUnderlyingCallsCount = newValue
}
}
}
}
open var threadsEnabledEnabledCalled: Bool {
return threadsEnabledEnabledCallsCount > 0
}
open var threadsEnabledEnabledReceivedEnabled: Bool?
open var threadsEnabledEnabledReceivedInvocations: [Bool] = []
var threadsEnabledEnabledUnderlyingReturnValue: ClientBuilder!
open var threadsEnabledEnabledReturnValue: ClientBuilder! {
get {
if Thread.isMainThread {
return threadsEnabledEnabledUnderlyingReturnValue
} else {
var returnValue: ClientBuilder? = nil
DispatchQueue.main.sync {
returnValue = threadsEnabledEnabledUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
threadsEnabledEnabledUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
threadsEnabledEnabledUnderlyingReturnValue = newValue
}
}
}
}
open var threadsEnabledEnabledClosure: ((Bool) -> ClientBuilder)?
open override func threadsEnabled(enabled: Bool) -> ClientBuilder {
threadsEnabledEnabledCallsCount += 1
threadsEnabledEnabledReceivedEnabled = enabled
DispatchQueue.main.async {
self.threadsEnabledEnabledReceivedInvocations.append(enabled)
}
if let threadsEnabledEnabledClosure = threadsEnabledEnabledClosure {
return threadsEnabledEnabledClosure(enabled)
} else {
return threadsEnabledEnabledReturnValue
}
}
//MARK: - userAgent //MARK: - userAgent
var userAgentUserAgentUnderlyingCallsCount = 0 var userAgentUserAgentUnderlyingCallsCount = 0
@@ -10011,13 +10082,13 @@ open class NotificationClientSDKMock: MatrixRustSDK.NotificationClient, @uncheck
open var getNotificationRoomIdEventIdReceivedArguments: (roomId: String, eventId: String)? open var getNotificationRoomIdEventIdReceivedArguments: (roomId: String, eventId: String)?
open var getNotificationRoomIdEventIdReceivedInvocations: [(roomId: String, eventId: String)] = [] open var getNotificationRoomIdEventIdReceivedInvocations: [(roomId: String, eventId: String)] = []
var getNotificationRoomIdEventIdUnderlyingReturnValue: NotificationItem? var getNotificationRoomIdEventIdUnderlyingReturnValue: NotificationStatus!
open var getNotificationRoomIdEventIdReturnValue: NotificationItem? { open var getNotificationRoomIdEventIdReturnValue: NotificationStatus! {
get { get {
if Thread.isMainThread { if Thread.isMainThread {
return getNotificationRoomIdEventIdUnderlyingReturnValue return getNotificationRoomIdEventIdUnderlyingReturnValue
} else { } else {
var returnValue: NotificationItem?? = nil var returnValue: NotificationStatus? = nil
DispatchQueue.main.sync { DispatchQueue.main.sync {
returnValue = getNotificationRoomIdEventIdUnderlyingReturnValue returnValue = getNotificationRoomIdEventIdUnderlyingReturnValue
} }
@@ -10035,9 +10106,9 @@ open class NotificationClientSDKMock: MatrixRustSDK.NotificationClient, @uncheck
} }
} }
} }
open var getNotificationRoomIdEventIdClosure: ((String, String) async throws -> NotificationItem?)? open var getNotificationRoomIdEventIdClosure: ((String, String) async throws -> NotificationStatus)?
open override func getNotification(roomId: String, eventId: String) async throws -> NotificationItem? { open override func getNotification(roomId: String, eventId: String) async throws -> NotificationStatus {
if let error = getNotificationRoomIdEventIdThrowableError { if let error = getNotificationRoomIdEventIdThrowableError {
throw error throw error
} }
@@ -10086,13 +10157,13 @@ open class NotificationClientSDKMock: MatrixRustSDK.NotificationClient, @uncheck
open var getNotificationsRequestsReceivedRequests: [NotificationItemsRequest]? open var getNotificationsRequestsReceivedRequests: [NotificationItemsRequest]?
open var getNotificationsRequestsReceivedInvocations: [[NotificationItemsRequest]] = [] open var getNotificationsRequestsReceivedInvocations: [[NotificationItemsRequest]] = []
var getNotificationsRequestsUnderlyingReturnValue: [String: NotificationItem]! var getNotificationsRequestsUnderlyingReturnValue: [String: BatchNotificationResult]!
open var getNotificationsRequestsReturnValue: [String: NotificationItem]! { open var getNotificationsRequestsReturnValue: [String: BatchNotificationResult]! {
get { get {
if Thread.isMainThread { if Thread.isMainThread {
return getNotificationsRequestsUnderlyingReturnValue return getNotificationsRequestsUnderlyingReturnValue
} else { } else {
var returnValue: [String: NotificationItem]? = nil var returnValue: [String: BatchNotificationResult]? = nil
DispatchQueue.main.sync { DispatchQueue.main.sync {
returnValue = getNotificationsRequestsUnderlyingReturnValue returnValue = getNotificationsRequestsUnderlyingReturnValue
} }
@@ -10110,9 +10181,9 @@ open class NotificationClientSDKMock: MatrixRustSDK.NotificationClient, @uncheck
} }
} }
} }
open var getNotificationsRequestsClosure: (([NotificationItemsRequest]) async throws -> [String: NotificationItem])? open var getNotificationsRequestsClosure: (([NotificationItemsRequest]) async throws -> [String: BatchNotificationResult])?
open override func getNotifications(requests: [NotificationItemsRequest]) async throws -> [String: NotificationItem] { open override func getNotifications(requests: [NotificationItemsRequest]) async throws -> [String: BatchNotificationResult] {
if let error = getNotificationsRequestsThrowableError { if let error = getNotificationsRequestsThrowableError {
throw error throw error
} }

View File

@@ -82,15 +82,21 @@ final class NSEUserSession {
func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? { func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol? {
do { do {
let notification = try await notificationClient.getNotification(roomId: roomID, eventId: eventID) let notificationStatus = try await notificationClient.getNotification(roomId: roomID, eventId: eventID)
guard let notification else { switch notificationStatus {
case .event(let notification):
return NotificationItemProxy(notificationItem: notification,
eventID: eventID,
receiverID: userID,
roomID: roomID)
case .eventNotFound:
MXLog.error("Notification event not found - roomID: \(roomID) eventID: \(eventID)")
return nil
case .eventFilteredOut:
MXLog.warning("Notification event filtered out - roomID: \(roomID) eventID: \(eventID)")
return nil return nil
} }
return NotificationItemProxy(notificationItem: notification,
eventID: eventID,
receiverID: userID,
roomID: roomID)
} catch { } catch {
MXLog.error("Could not get notification's content creating an empty notification instead, error: \(error)") MXLog.error("Could not get notification's content creating an empty notification instead, error: \(error)")
return EmptyNotificationItemProxy(eventID: eventID, roomID: roomID, receiverID: userID) return EmptyNotificationItemProxy(eventID: eventID, roomID: roomID, receiverID: userID)

View File

@@ -1,13 +1,13 @@
{ {
"originHash" : "01d488b353462f8c88d3d89a9de08ed94fa42ef1cb444fc438e0c6aaaab83320", "originHash" : "fe65ad02360ab82a9283496b072022b8c403593a427e973b39783ab541e11a2f",
"pins" : [ "pins" : [
{ {
"identity" : "swift-argument-parser", "identity" : "swift-argument-parser",
"kind" : "remoteSourceControl", "kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser", "location" : "https://github.com/apple/swift-argument-parser",
"state" : { "state" : {
"revision" : "011f0c765fb46d9cac61bca19be0527e99c98c8b", "revision" : "309a47b2b1d9b5e991f36961c983ecec72275be3",
"version" : "1.5.1" "version" : "1.6.1"
} }
}, },
{ {

View File

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