Update SDK to 26.04.23 (#5478)

updated sdk, and added error management on the send LLS API
This commit is contained in:
Mauro
2026-04-24 13:07:16 +02:00
committed by GitHub
parent 5fa8f24c04
commit 52d16618f6
9 changed files with 773 additions and 39 deletions

View File

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

View File

@@ -1,5 +1,5 @@
{
"originHash" : "307a0af81ae7a463ea2d0c101af1045c15def8948a63c21aa97fc7929759206e",
"originHash" : "ffbed4fcb99c97f1daf5f706d30ba2acbdb0810f8774b9720d29257d9854f83e",
"pins" : [
{
"identity" : "compound-design-tokens",
@@ -158,8 +158,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "7b99a1d16c62794596fac0b34bf21ceec26578b5",
"version" : "26.4.21"
"revision" : "cadee968c71d7ddff8f4b04e934b963b6c08c2bd",
"version" : "26.4.23"
}
},
{

View File

@@ -197,7 +197,7 @@ extension SDKListener: KnockRequestsListener where T == [KnockRequest] {
}
}
extension SDKListener: LiveLocationShareListener where T == [LiveLocationShareUpdate] {
extension SDKListener: LiveLocationsListener where T == [LiveLocationShareUpdate] {
func onUpdate(updates: [LiveLocationShareUpdate]) {
onUpdateClosure(updates)
}

View File

@@ -278,10 +278,16 @@ class LiveLocationManager: NSObject, LiveLocationManagerProtocol, CLLocationMana
case .success:
MXLog.debug("Sent live location to room: \(roomID)")
case .failure(let error):
switch error {
case .liveLocationSessionIsNotActive:
MXLog.error("Failed to send live locatio update to room \(roomID): session not active")
await stopLiveLocation(roomID: roomID)
default:
MXLog.error("Failed to send live location update to room \(roomID): \(error)")
}
}
}
}
private func resolveRoomProxy(for roomID: String) async -> JoinedRoomProxyProtocol? {
if let cached = activeRoomProxies[roomID] {

View File

@@ -11,7 +11,7 @@ import MatrixRustSDK
final class RoomLiveLocationService: RoomLiveLocationServiceProtocol {
// periphery:ignore - required for instance retention in the rust codebase
private let liveLocationShares: LiveLocationShares
private let liveLocationsObserver: LiveLocationsObserver
// periphery:ignore - required for instance retention in the rust codebase
private var observationToken: TaskHandle?
@@ -20,9 +20,9 @@ final class RoomLiveLocationService: RoomLiveLocationServiceProtocol {
liveLocationsSubject.asCurrentValuePublisher()
}
init(liveLocationShares: LiveLocationShares) {
self.liveLocationShares = liveLocationShares
observationToken = liveLocationShares
init(liveLocationsObserver: LiveLocationsObserver) {
self.liveLocationsObserver = liveLocationsObserver
observationToken = liveLocationsObserver
.subscribe(listener: SDKListener { [weak self] updates in
guard let self else { return }

View File

@@ -755,7 +755,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
// MARK: - Live Location
func makeLiveLocationService() async -> RoomLiveLocationServiceProtocol {
await RoomLiveLocationService(liveLocationShares: room.liveLocationShares())
await RoomLiveLocationService(liveLocationsObserver: room.liveLocationsObserver())
}
func startLiveLocationShare(duration: Duration) async -> Result<Void, RoomProxyError> {
@@ -772,6 +772,16 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
do {
try await room.sendLiveLocation(geoUri: geoURI.string)
return .success(())
} catch let error as LiveLocationError {
switch error {
case .Network:
MXLog.error("Failed sending live location with error: \(error)")
return .failure(.sdkError(error))
// We can consider the session not active for any error other the Network one.
default:
MXLog.error("Failed sending live location, session is not active")
return .failure(.liveLocationSessionIsNotActive)
}
} catch {
MXLog.error("Failed sending live location with error: \(error)")
return .failure(.sdkError(error))

View File

@@ -20,6 +20,7 @@ enum RoomProxyError: Error {
case missingTransactionID
case failedCreatingPinnedTimeline
case timelineError(TimelineProxyError)
case liveLocationSessionIsNotActive
}
/// An enum that describes the relationship between the current user and the room, and contains a reference to the specific implementation of the `RoomProxy`.

View File

@@ -1343,6 +1343,81 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
}
}
//MARK: - getDmRooms
open var getDmRoomsUserIdThrowableError: Error?
open var getDmRoomsUserIdUnderlyingCallsCount = 0
open var getDmRoomsUserIdCallsCount: Int {
get {
if Thread.isMainThread {
return getDmRoomsUserIdUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = getDmRoomsUserIdUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
getDmRoomsUserIdUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
getDmRoomsUserIdUnderlyingCallsCount = newValue
}
}
}
}
open var getDmRoomsUserIdCalled: Bool {
return getDmRoomsUserIdCallsCount > 0
}
open var getDmRoomsUserIdReceivedUserId: String?
open var getDmRoomsUserIdReceivedInvocations: [String] = []
open var getDmRoomsUserIdUnderlyingReturnValue: [Room]!
open var getDmRoomsUserIdReturnValue: [Room]! {
get {
if Thread.isMainThread {
return getDmRoomsUserIdUnderlyingReturnValue
} else {
var returnValue: [Room]? = nil
DispatchQueue.main.sync {
returnValue = getDmRoomsUserIdUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
getDmRoomsUserIdUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
getDmRoomsUserIdUnderlyingReturnValue = newValue
}
}
}
}
open var getDmRoomsUserIdClosure: ((String) throws -> [Room])?
open override func getDmRooms(userId: String) throws -> [Room] {
if let error = getDmRoomsUserIdThrowableError {
throw error
}
getDmRoomsUserIdCallsCount += 1
getDmRoomsUserIdReceivedUserId = userId
DispatchQueue.main.async {
self.getDmRoomsUserIdReceivedInvocations.append(userId)
}
if let getDmRoomsUserIdClosure = getDmRoomsUserIdClosure {
return try getDmRoomsUserIdClosure(userId)
} else {
return getDmRoomsUserIdReturnValue
}
}
//MARK: - getInviteAvatarsDisplayPolicy
open var getInviteAvatarsDisplayPolicyThrowableError: Error?
@@ -3896,6 +3971,75 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
try await removeAvatarClosure?()
}
//MARK: - requestOpenidToken
open var requestOpenidTokenThrowableError: Error?
open var requestOpenidTokenUnderlyingCallsCount = 0
open var requestOpenidTokenCallsCount: Int {
get {
if Thread.isMainThread {
return requestOpenidTokenUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = requestOpenidTokenUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
requestOpenidTokenUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
requestOpenidTokenUnderlyingCallsCount = newValue
}
}
}
}
open var requestOpenidTokenCalled: Bool {
return requestOpenidTokenCallsCount > 0
}
open var requestOpenidTokenUnderlyingReturnValue: OpenIdToken!
open var requestOpenidTokenReturnValue: OpenIdToken! {
get {
if Thread.isMainThread {
return requestOpenidTokenUnderlyingReturnValue
} else {
var returnValue: OpenIdToken? = nil
DispatchQueue.main.sync {
returnValue = requestOpenidTokenUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
requestOpenidTokenUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
requestOpenidTokenUnderlyingReturnValue = newValue
}
}
}
}
open var requestOpenidTokenClosure: (() async throws -> OpenIdToken)?
open override func requestOpenidToken() async throws -> OpenIdToken {
if let error = requestOpenidTokenThrowableError {
throw error
}
requestOpenidTokenCallsCount += 1
if let requestOpenidTokenClosure = requestOpenidTokenClosure {
return try await requestOpenidTokenClosure()
} else {
return requestOpenidTokenReturnValue
}
}
//MARK: - resetSupportedVersions
open var resetSupportedVersionsThrowableError: Error?
@@ -4672,6 +4816,52 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
try await setAccountDataEventTypeContentClosure?(eventType, content)
}
//MARK: - setAvatarUrl
open var setAvatarUrlUrlThrowableError: Error?
open var setAvatarUrlUrlUnderlyingCallsCount = 0
open var setAvatarUrlUrlCallsCount: Int {
get {
if Thread.isMainThread {
return setAvatarUrlUrlUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = setAvatarUrlUrlUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
setAvatarUrlUrlUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
setAvatarUrlUrlUnderlyingCallsCount = newValue
}
}
}
}
open var setAvatarUrlUrlCalled: Bool {
return setAvatarUrlUrlCallsCount > 0
}
open var setAvatarUrlUrlReceivedUrl: String?
open var setAvatarUrlUrlReceivedInvocations: [String] = []
open var setAvatarUrlUrlClosure: ((String) async throws -> Void)?
open override func setAvatarUrl(url: String) async throws {
if let error = setAvatarUrlUrlThrowableError {
throw error
}
setAvatarUrlUrlCallsCount += 1
setAvatarUrlUrlReceivedUrl = url
DispatchQueue.main.async {
self.setAvatarUrlUrlReceivedInvocations.append(url)
}
try await setAvatarUrlUrlClosure?(url)
}
//MARK: - setDelegate
open var setDelegateDelegateThrowableError: Error?
@@ -6417,6 +6607,81 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
return getRecentEmojisReturnValue
}
}
//MARK: - searchMessages
open var searchMessagesQueryFilterNumResultsPerBatchThrowableError: Error?
open var searchMessagesQueryFilterNumResultsPerBatchUnderlyingCallsCount = 0
open var searchMessagesQueryFilterNumResultsPerBatchCallsCount: Int {
get {
if Thread.isMainThread {
return searchMessagesQueryFilterNumResultsPerBatchUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = searchMessagesQueryFilterNumResultsPerBatchUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
searchMessagesQueryFilterNumResultsPerBatchUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
searchMessagesQueryFilterNumResultsPerBatchUnderlyingCallsCount = newValue
}
}
}
}
open var searchMessagesQueryFilterNumResultsPerBatchCalled: Bool {
return searchMessagesQueryFilterNumResultsPerBatchCallsCount > 0
}
open var searchMessagesQueryFilterNumResultsPerBatchReceivedArguments: (query: String, filter: SearchRoomFilter, numResultsPerBatch: UInt32)?
open var searchMessagesQueryFilterNumResultsPerBatchReceivedInvocations: [(query: String, filter: SearchRoomFilter, numResultsPerBatch: UInt32)] = []
open var searchMessagesQueryFilterNumResultsPerBatchUnderlyingReturnValue: GlobalSearchIterator!
open var searchMessagesQueryFilterNumResultsPerBatchReturnValue: GlobalSearchIterator! {
get {
if Thread.isMainThread {
return searchMessagesQueryFilterNumResultsPerBatchUnderlyingReturnValue
} else {
var returnValue: GlobalSearchIterator? = nil
DispatchQueue.main.sync {
returnValue = searchMessagesQueryFilterNumResultsPerBatchUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
searchMessagesQueryFilterNumResultsPerBatchUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
searchMessagesQueryFilterNumResultsPerBatchUnderlyingReturnValue = newValue
}
}
}
}
open var searchMessagesQueryFilterNumResultsPerBatchClosure: ((String, SearchRoomFilter, UInt32) async throws -> GlobalSearchIterator)?
open override func searchMessages(query: String, filter: SearchRoomFilter, numResultsPerBatch: UInt32) async throws -> GlobalSearchIterator {
if let error = searchMessagesQueryFilterNumResultsPerBatchThrowableError {
throw error
}
searchMessagesQueryFilterNumResultsPerBatchCallsCount += 1
searchMessagesQueryFilterNumResultsPerBatchReceivedArguments = (query: query, filter: filter, numResultsPerBatch: numResultsPerBatch)
DispatchQueue.main.async {
self.searchMessagesQueryFilterNumResultsPerBatchReceivedInvocations.append((query: query, filter: filter, numResultsPerBatch: numResultsPerBatch))
}
if let searchMessagesQueryFilterNumResultsPerBatchClosure = searchMessagesQueryFilterNumResultsPerBatchClosure {
return try await searchMessagesQueryFilterNumResultsPerBatchClosure(query, filter, numResultsPerBatch)
} else {
return searchMessagesQueryFilterNumResultsPerBatchReturnValue
}
}
}
open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendable {
public init() {
@@ -8246,6 +8511,77 @@ open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendabl
return usernameUsernameReturnValue
}
}
//MARK: - withSearchIndexStore
open var withSearchIndexStorePathPasswordUnderlyingCallsCount = 0
open var withSearchIndexStorePathPasswordCallsCount: Int {
get {
if Thread.isMainThread {
return withSearchIndexStorePathPasswordUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = withSearchIndexStorePathPasswordUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
withSearchIndexStorePathPasswordUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
withSearchIndexStorePathPasswordUnderlyingCallsCount = newValue
}
}
}
}
open var withSearchIndexStorePathPasswordCalled: Bool {
return withSearchIndexStorePathPasswordCallsCount > 0
}
open var withSearchIndexStorePathPasswordReceivedArguments: (path: String, password: String?)?
open var withSearchIndexStorePathPasswordReceivedInvocations: [(path: String, password: String?)] = []
open var withSearchIndexStorePathPasswordUnderlyingReturnValue: ClientBuilder!
open var withSearchIndexStorePathPasswordReturnValue: ClientBuilder! {
get {
if Thread.isMainThread {
return withSearchIndexStorePathPasswordUnderlyingReturnValue
} else {
var returnValue: ClientBuilder? = nil
DispatchQueue.main.sync {
returnValue = withSearchIndexStorePathPasswordUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
withSearchIndexStorePathPasswordUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
withSearchIndexStorePathPasswordUnderlyingReturnValue = newValue
}
}
}
}
open var withSearchIndexStorePathPasswordClosure: ((String, String?) -> ClientBuilder)?
open override func withSearchIndexStore(path: String, password: String?) -> ClientBuilder {
withSearchIndexStorePathPasswordCallsCount += 1
withSearchIndexStorePathPasswordReceivedArguments = (path: path, password: password)
DispatchQueue.main.async {
self.withSearchIndexStorePathPasswordReceivedInvocations.append((path: path, password: password))
}
if let withSearchIndexStorePathPasswordClosure = withSearchIndexStorePathPasswordClosure {
return withSearchIndexStorePathPasswordClosure(path, password)
} else {
return withSearchIndexStorePathPasswordReturnValue
}
}
}
open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
public init() {
@@ -9670,6 +10006,90 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
await waitForE2eeInitializationTasksClosure?()
}
}
open class GlobalSearchIteratorSDKMock: MatrixRustSDK.GlobalSearchIterator, @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!
//MARK: - nextEvents
open var nextEventsThrowableError: Error?
open var nextEventsUnderlyingCallsCount = 0
open var nextEventsCallsCount: Int {
get {
if Thread.isMainThread {
return nextEventsUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = nextEventsUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
nextEventsUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
nextEventsUnderlyingCallsCount = newValue
}
}
}
}
open var nextEventsCalled: Bool {
return nextEventsCallsCount > 0
}
open var nextEventsUnderlyingReturnValue: [GlobalSearchResult]?
open var nextEventsReturnValue: [GlobalSearchResult]? {
get {
if Thread.isMainThread {
return nextEventsUnderlyingReturnValue
} else {
var returnValue: [GlobalSearchResult]?? = nil
DispatchQueue.main.sync {
returnValue = nextEventsUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
nextEventsUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
nextEventsUnderlyingReturnValue = newValue
}
}
}
}
open var nextEventsClosure: (() async throws -> [GlobalSearchResult]?)?
open override func nextEvents() async throws -> [GlobalSearchResult]? {
if let error = nextEventsThrowableError {
throw error
}
nextEventsCallsCount += 1
if let nextEventsClosure = nextEventsClosure {
return try await nextEventsClosure()
} else {
return nextEventsReturnValue
}
}
}
open class GrantLoginWithQrCodeHandlerSDKMock: MatrixRustSDK.GrantLoginWithQrCodeHandler, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
@@ -11686,7 +12106,7 @@ open class LeaveSpaceHandleSDKMock: MatrixRustSDK.LeaveSpaceHandle, @unchecked S
}
}
}
open class LiveLocationSharesSDKMock: MatrixRustSDK.LiveLocationShares, @unchecked Sendable {
open class LiveLocationsObserverSDKMock: MatrixRustSDK.LiveLocationsObserver, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
@@ -11730,8 +12150,8 @@ open class LiveLocationSharesSDKMock: MatrixRustSDK.LiveLocationShares, @uncheck
open var subscribeListenerCalled: Bool {
return subscribeListenerCallsCount > 0
}
open var subscribeListenerReceivedListener: LiveLocationShareListener?
open var subscribeListenerReceivedInvocations: [LiveLocationShareListener] = []
open var subscribeListenerReceivedListener: LiveLocationsListener?
open var subscribeListenerReceivedInvocations: [LiveLocationsListener] = []
open var subscribeListenerUnderlyingReturnValue: TaskHandle!
open var subscribeListenerReturnValue: TaskHandle! {
@@ -11757,9 +12177,9 @@ open class LiveLocationSharesSDKMock: MatrixRustSDK.LiveLocationShares, @uncheck
}
}
}
open var subscribeListenerClosure: ((LiveLocationShareListener) -> TaskHandle)?
open var subscribeListenerClosure: ((LiveLocationsListener) -> TaskHandle)?
open override func subscribe(listener: LiveLocationShareListener) -> TaskHandle {
open override func subscribe(listener: LiveLocationsListener) -> TaskHandle {
subscribeListenerCallsCount += 1
subscribeListenerReceivedListener = listener
DispatchQueue.main.async {
@@ -16319,17 +16739,17 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
try await leaveClosure?()
}
//MARK: - liveLocationShares
//MARK: - liveLocationsObserver
open var liveLocationSharesUnderlyingCallsCount = 0
open var liveLocationSharesCallsCount: Int {
open var liveLocationsObserverUnderlyingCallsCount = 0
open var liveLocationsObserverCallsCount: Int {
get {
if Thread.isMainThread {
return liveLocationSharesUnderlyingCallsCount
return liveLocationsObserverUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = liveLocationSharesUnderlyingCallsCount
returnValue = liveLocationsObserverUnderlyingCallsCount
}
return returnValue!
@@ -16337,27 +16757,27 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
}
set {
if Thread.isMainThread {
liveLocationSharesUnderlyingCallsCount = newValue
liveLocationsObserverUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
liveLocationSharesUnderlyingCallsCount = newValue
liveLocationsObserverUnderlyingCallsCount = newValue
}
}
}
}
open var liveLocationSharesCalled: Bool {
return liveLocationSharesCallsCount > 0
open var liveLocationsObserverCalled: Bool {
return liveLocationsObserverCallsCount > 0
}
open var liveLocationSharesUnderlyingReturnValue: LiveLocationShares!
open var liveLocationSharesReturnValue: LiveLocationShares! {
open var liveLocationsObserverUnderlyingReturnValue: LiveLocationsObserver!
open var liveLocationsObserverReturnValue: LiveLocationsObserver! {
get {
if Thread.isMainThread {
return liveLocationSharesUnderlyingReturnValue
return liveLocationsObserverUnderlyingReturnValue
} else {
var returnValue: LiveLocationShares? = nil
var returnValue: LiveLocationsObserver? = nil
DispatchQueue.main.sync {
returnValue = liveLocationSharesUnderlyingReturnValue
returnValue = liveLocationsObserverUnderlyingReturnValue
}
return returnValue!
@@ -16365,22 +16785,22 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
}
set {
if Thread.isMainThread {
liveLocationSharesUnderlyingReturnValue = newValue
liveLocationsObserverUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
liveLocationSharesUnderlyingReturnValue = newValue
liveLocationsObserverUnderlyingReturnValue = newValue
}
}
}
}
open var liveLocationSharesClosure: (() async -> LiveLocationShares)?
open var liveLocationsObserverClosure: (() async -> LiveLocationsObserver)?
open override func liveLocationShares() async -> LiveLocationShares {
liveLocationSharesCallsCount += 1
if let liveLocationSharesClosure = liveLocationSharesClosure {
return await liveLocationSharesClosure()
open override func liveLocationsObserver() async -> LiveLocationsObserver {
liveLocationsObserverCallsCount += 1
if let liveLocationsObserverClosure = liveLocationsObserverClosure {
return await liveLocationsObserverClosure()
} else {
return liveLocationSharesReturnValue
return liveLocationsObserverReturnValue
}
}
@@ -19968,6 +20388,77 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
}
try await withdrawVerificationAndResendUserIdsSendHandleClosure?(userIds, sendHandle)
}
//MARK: - searchMessages
open var searchMessagesQueryNumResultsPerBatchUnderlyingCallsCount = 0
open var searchMessagesQueryNumResultsPerBatchCallsCount: Int {
get {
if Thread.isMainThread {
return searchMessagesQueryNumResultsPerBatchUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = searchMessagesQueryNumResultsPerBatchUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
searchMessagesQueryNumResultsPerBatchUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
searchMessagesQueryNumResultsPerBatchUnderlyingCallsCount = newValue
}
}
}
}
open var searchMessagesQueryNumResultsPerBatchCalled: Bool {
return searchMessagesQueryNumResultsPerBatchCallsCount > 0
}
open var searchMessagesQueryNumResultsPerBatchReceivedArguments: (query: String, numResultsPerBatch: UInt32)?
open var searchMessagesQueryNumResultsPerBatchReceivedInvocations: [(query: String, numResultsPerBatch: UInt32)] = []
open var searchMessagesQueryNumResultsPerBatchUnderlyingReturnValue: RoomSearchIterator!
open var searchMessagesQueryNumResultsPerBatchReturnValue: RoomSearchIterator! {
get {
if Thread.isMainThread {
return searchMessagesQueryNumResultsPerBatchUnderlyingReturnValue
} else {
var returnValue: RoomSearchIterator? = nil
DispatchQueue.main.sync {
returnValue = searchMessagesQueryNumResultsPerBatchUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
searchMessagesQueryNumResultsPerBatchUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
searchMessagesQueryNumResultsPerBatchUnderlyingReturnValue = newValue
}
}
}
}
open var searchMessagesQueryNumResultsPerBatchClosure: ((String, UInt32) -> RoomSearchIterator)?
open override func searchMessages(query: String, numResultsPerBatch: UInt32) -> RoomSearchIterator {
searchMessagesQueryNumResultsPerBatchCallsCount += 1
searchMessagesQueryNumResultsPerBatchReceivedArguments = (query: query, numResultsPerBatch: numResultsPerBatch)
DispatchQueue.main.async {
self.searchMessagesQueryNumResultsPerBatchReceivedInvocations.append((query: query, numResultsPerBatch: numResultsPerBatch))
}
if let searchMessagesQueryNumResultsPerBatchClosure = searchMessagesQueryNumResultsPerBatchClosure {
return searchMessagesQueryNumResultsPerBatchClosure(query, numResultsPerBatch)
} else {
return searchMessagesQueryNumResultsPerBatchReturnValue
}
}
}
open class RoomDirectorySearchSDKMock: MatrixRustSDK.RoomDirectorySearch, @unchecked Sendable {
public init() {
@@ -23174,6 +23665,90 @@ open class RoomPreviewSDKMock: MatrixRustSDK.RoomPreview, @unchecked Sendable {
}
}
}
open class RoomSearchIteratorSDKMock: MatrixRustSDK.RoomSearchIterator, @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!
//MARK: - nextEvents
open var nextEventsThrowableError: Error?
open var nextEventsUnderlyingCallsCount = 0
open var nextEventsCallsCount: Int {
get {
if Thread.isMainThread {
return nextEventsUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = nextEventsUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
nextEventsUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
nextEventsUnderlyingCallsCount = newValue
}
}
}
}
open var nextEventsCalled: Bool {
return nextEventsCallsCount > 0
}
open var nextEventsUnderlyingReturnValue: [RoomSearchResult]?
open var nextEventsReturnValue: [RoomSearchResult]? {
get {
if Thread.isMainThread {
return nextEventsUnderlyingReturnValue
} else {
var returnValue: [RoomSearchResult]?? = nil
DispatchQueue.main.sync {
returnValue = nextEventsUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
nextEventsUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
nextEventsUnderlyingReturnValue = newValue
}
}
}
}
open var nextEventsClosure: (() async throws -> [RoomSearchResult]?)?
open override func nextEvents() async throws -> [RoomSearchResult]? {
if let error = nextEventsThrowableError {
throw error
}
nextEventsCallsCount += 1
if let nextEventsClosure = nextEventsClosure {
return try await nextEventsClosure()
} else {
return nextEventsReturnValue
}
}
}
open class SecretsBundleWithUserIdSDKMock: MatrixRustSDK.SecretsBundleWithUserId, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
@@ -26393,6 +26968,148 @@ open class SyncServiceBuilderSDKMock: MatrixRustSDK.SyncServiceBuilder, @uncheck
}
}
//MARK: - withRoomListConnectionId
open var withRoomListConnectionIdConnectionIdUnderlyingCallsCount = 0
open var withRoomListConnectionIdConnectionIdCallsCount: Int {
get {
if Thread.isMainThread {
return withRoomListConnectionIdConnectionIdUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = withRoomListConnectionIdConnectionIdUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
withRoomListConnectionIdConnectionIdUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
withRoomListConnectionIdConnectionIdUnderlyingCallsCount = newValue
}
}
}
}
open var withRoomListConnectionIdConnectionIdCalled: Bool {
return withRoomListConnectionIdConnectionIdCallsCount > 0
}
open var withRoomListConnectionIdConnectionIdReceivedConnectionId: String?
open var withRoomListConnectionIdConnectionIdReceivedInvocations: [String] = []
open var withRoomListConnectionIdConnectionIdUnderlyingReturnValue: SyncServiceBuilder!
open var withRoomListConnectionIdConnectionIdReturnValue: SyncServiceBuilder! {
get {
if Thread.isMainThread {
return withRoomListConnectionIdConnectionIdUnderlyingReturnValue
} else {
var returnValue: SyncServiceBuilder? = nil
DispatchQueue.main.sync {
returnValue = withRoomListConnectionIdConnectionIdUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
withRoomListConnectionIdConnectionIdUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
withRoomListConnectionIdConnectionIdUnderlyingReturnValue = newValue
}
}
}
}
open var withRoomListConnectionIdConnectionIdClosure: ((String) -> SyncServiceBuilder)?
open override func withRoomListConnectionId(connectionId: String) -> SyncServiceBuilder {
withRoomListConnectionIdConnectionIdCallsCount += 1
withRoomListConnectionIdConnectionIdReceivedConnectionId = connectionId
DispatchQueue.main.async {
self.withRoomListConnectionIdConnectionIdReceivedInvocations.append(connectionId)
}
if let withRoomListConnectionIdConnectionIdClosure = withRoomListConnectionIdConnectionIdClosure {
return withRoomListConnectionIdConnectionIdClosure(connectionId)
} else {
return withRoomListConnectionIdConnectionIdReturnValue
}
}
//MARK: - withRoomListTimelineLimit
open var withRoomListTimelineLimitLimitUnderlyingCallsCount = 0
open var withRoomListTimelineLimitLimitCallsCount: Int {
get {
if Thread.isMainThread {
return withRoomListTimelineLimitLimitUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = withRoomListTimelineLimitLimitUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
withRoomListTimelineLimitLimitUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
withRoomListTimelineLimitLimitUnderlyingCallsCount = newValue
}
}
}
}
open var withRoomListTimelineLimitLimitCalled: Bool {
return withRoomListTimelineLimitLimitCallsCount > 0
}
open var withRoomListTimelineLimitLimitReceivedLimit: UInt32?
open var withRoomListTimelineLimitLimitReceivedInvocations: [UInt32] = []
open var withRoomListTimelineLimitLimitUnderlyingReturnValue: SyncServiceBuilder!
open var withRoomListTimelineLimitLimitReturnValue: SyncServiceBuilder! {
get {
if Thread.isMainThread {
return withRoomListTimelineLimitLimitUnderlyingReturnValue
} else {
var returnValue: SyncServiceBuilder? = nil
DispatchQueue.main.sync {
returnValue = withRoomListTimelineLimitLimitUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
withRoomListTimelineLimitLimitUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
withRoomListTimelineLimitLimitUnderlyingReturnValue = newValue
}
}
}
}
open var withRoomListTimelineLimitLimitClosure: ((UInt32) -> SyncServiceBuilder)?
open override func withRoomListTimelineLimit(limit: UInt32) -> SyncServiceBuilder {
withRoomListTimelineLimitLimitCallsCount += 1
withRoomListTimelineLimitLimitReceivedLimit = limit
DispatchQueue.main.async {
self.withRoomListTimelineLimitLimitReceivedInvocations.append(limit)
}
if let withRoomListTimelineLimitLimitClosure = withRoomListTimelineLimitLimitClosure {
return withRoomListTimelineLimitLimitClosure(limit)
} else {
return withRoomListTimelineLimitLimitReturnValue
}
}
//MARK: - withSharePos
open var withSharePosEnableUnderlyingCallsCount = 0

View File

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