mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Update the SDK and handle some API breaks. (#5986)
This commit is contained in:
@@ -10425,7 +10425,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 = 26.07.28;
|
version = 26.08.06;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"originHash" : "cae7b44fbecd696d2c8c67a101fa5937b4dbaa17a516bbe59d4b90c3ee2acdde",
|
"originHash" : "4bc536b8dc1a24c51f7aee755efcae049ef53f92314c1fa8dfe3467b8ac0d54d",
|
||||||
"pins" : [
|
"pins" : [
|
||||||
{
|
{
|
||||||
"identity" : "compound-design-tokens",
|
"identity" : "compound-design-tokens",
|
||||||
@@ -167,8 +167,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" : "af0cbc94741f39cc3e175e0449bbfae10f9436b0",
|
"revision" : "bb2701951010f08d39627e99a816f532d42e6f62",
|
||||||
"version" : "26.7.28"
|
"version" : "26.8.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3305,60 +3305,32 @@ nonisolated class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
|
|||||||
return setUserStatusReturnValue
|
return setUserStatusReturnValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//MARK: - removeUserStatus
|
//MARK: - clearUserStatus
|
||||||
|
|
||||||
private let removeUserStatusCallsCountLock = NSLock()
|
private let clearUserStatusCallsCountLock = NSLock()
|
||||||
private nonisolated(unsafe) var removeUserStatusUnderlyingCallsCount = 0
|
private nonisolated(unsafe) var clearUserStatusUnderlyingCallsCount = 0
|
||||||
var removeUserStatusCallsCount: Int {
|
var clearUserStatusCallsCount: Int {
|
||||||
get { removeUserStatusCallsCountLock.withLock { removeUserStatusUnderlyingCallsCount } }
|
get { clearUserStatusCallsCountLock.withLock { clearUserStatusUnderlyingCallsCount } }
|
||||||
set { removeUserStatusCallsCountLock.withLock { removeUserStatusUnderlyingCallsCount = newValue } }
|
set { clearUserStatusCallsCountLock.withLock { clearUserStatusUnderlyingCallsCount = newValue } }
|
||||||
}
|
}
|
||||||
var removeUserStatusCalled: Bool {
|
var clearUserStatusCalled: Bool {
|
||||||
return removeUserStatusCallsCount > 0
|
return clearUserStatusCallsCount > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
private let removeUserStatusReturnValueLock = NSLock()
|
private let clearUserStatusReturnValueLock = NSLock()
|
||||||
private nonisolated(unsafe) var removeUserStatusUnderlyingReturnValue: Result<Void, ClientProxyError>!
|
private nonisolated(unsafe) var clearUserStatusUnderlyingReturnValue: Result<Void, ClientProxyError>!
|
||||||
var removeUserStatusReturnValue: Result<Void, ClientProxyError>! {
|
var clearUserStatusReturnValue: Result<Void, ClientProxyError>! {
|
||||||
get { removeUserStatusReturnValueLock.withLock { removeUserStatusUnderlyingReturnValue } }
|
get { clearUserStatusReturnValueLock.withLock { clearUserStatusUnderlyingReturnValue } }
|
||||||
set { removeUserStatusReturnValueLock.withLock { removeUserStatusUnderlyingReturnValue = newValue } }
|
set { clearUserStatusReturnValueLock.withLock { clearUserStatusUnderlyingReturnValue = newValue } }
|
||||||
}
|
}
|
||||||
nonisolated(unsafe) var removeUserStatusClosure: (() async -> Result<Void, ClientProxyError>)?
|
nonisolated(unsafe) var clearUserStatusClosure: (() async -> Result<Void, ClientProxyError>)?
|
||||||
|
|
||||||
@concurrent func removeUserStatus() async -> Result<Void, ClientProxyError> {
|
@concurrent func clearUserStatus() async -> Result<Void, ClientProxyError> {
|
||||||
removeUserStatusCallsCountLock.withLock { removeUserStatusUnderlyingCallsCount += 1 }
|
clearUserStatusCallsCountLock.withLock { clearUserStatusUnderlyingCallsCount += 1 }
|
||||||
if let removeUserStatusClosure = removeUserStatusClosure {
|
if let clearUserStatusClosure = clearUserStatusClosure {
|
||||||
return await removeUserStatusClosure()
|
return await clearUserStatusClosure()
|
||||||
} else {
|
} else {
|
||||||
return removeUserStatusReturnValue
|
return clearUserStatusReturnValue
|
||||||
}
|
|
||||||
}
|
|
||||||
//MARK: - removeCallStatus
|
|
||||||
|
|
||||||
private let removeCallStatusCallsCountLock = NSLock()
|
|
||||||
private nonisolated(unsafe) var removeCallStatusUnderlyingCallsCount = 0
|
|
||||||
var removeCallStatusCallsCount: Int {
|
|
||||||
get { removeCallStatusCallsCountLock.withLock { removeCallStatusUnderlyingCallsCount } }
|
|
||||||
set { removeCallStatusCallsCountLock.withLock { removeCallStatusUnderlyingCallsCount = newValue } }
|
|
||||||
}
|
|
||||||
var removeCallStatusCalled: Bool {
|
|
||||||
return removeCallStatusCallsCount > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
private let removeCallStatusReturnValueLock = NSLock()
|
|
||||||
private nonisolated(unsafe) var removeCallStatusUnderlyingReturnValue: Result<Void, ClientProxyError>!
|
|
||||||
var removeCallStatusReturnValue: Result<Void, ClientProxyError>! {
|
|
||||||
get { removeCallStatusReturnValueLock.withLock { removeCallStatusUnderlyingReturnValue } }
|
|
||||||
set { removeCallStatusReturnValueLock.withLock { removeCallStatusUnderlyingReturnValue = newValue } }
|
|
||||||
}
|
|
||||||
nonisolated(unsafe) var removeCallStatusClosure: (() async -> Result<Void, ClientProxyError>)?
|
|
||||||
|
|
||||||
@concurrent func removeCallStatus() async -> Result<Void, ClientProxyError> {
|
|
||||||
removeCallStatusCallsCountLock.withLock { removeCallStatusUnderlyingCallsCount += 1 }
|
|
||||||
if let removeCallStatusClosure = removeCallStatusClosure {
|
|
||||||
return await removeCallStatusClosure()
|
|
||||||
} else {
|
|
||||||
return removeCallStatusReturnValue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//MARK: - linkNewDeviceService
|
//MARK: - linkNewDeviceService
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import Foundation
|
|||||||
import MatrixRustSDK
|
import MatrixRustSDK
|
||||||
|
|
||||||
nonisolated enum TraceLogPack: Codable, CaseIterable {
|
nonisolated enum TraceLogPack: Codable, CaseIterable {
|
||||||
case eventCache, sendQueue, timeline, notificationClient, syncProfiling, latestEvents
|
case eventCache, sendQueue, timeline, notificationClient, syncProfiling, latestEvents, search
|
||||||
|
|
||||||
var title: String {
|
var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
@@ -20,6 +20,7 @@ nonisolated enum TraceLogPack: Codable, CaseIterable {
|
|||||||
case .notificationClient: "Notification client"
|
case .notificationClient: "Notification client"
|
||||||
case .syncProfiling: "Sync profiling"
|
case .syncProfiling: "Sync profiling"
|
||||||
case .latestEvents: "Latest events"
|
case .latestEvents: "Latest events"
|
||||||
|
case .search: "Search"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,13 +28,14 @@ nonisolated enum TraceLogPack: Codable, CaseIterable {
|
|||||||
nonisolated extension TraceLogPack {
|
nonisolated extension TraceLogPack {
|
||||||
// periphery:ignore - Unused, but added to detect new cases when updating the SDK.
|
// periphery:ignore - Unused, but added to detect new cases when updating the SDK.
|
||||||
init(rustLogPack: MatrixRustSDK.TraceLogPacks) {
|
init(rustLogPack: MatrixRustSDK.TraceLogPacks) {
|
||||||
switch rustLogPack {
|
self = switch rustLogPack {
|
||||||
case .eventCache: self = .eventCache
|
case .eventCache: .eventCache
|
||||||
case .sendQueue: self = .sendQueue
|
case .sendQueue: .sendQueue
|
||||||
case .timeline: self = .timeline
|
case .timeline: .timeline
|
||||||
case .notificationClient: self = .notificationClient
|
case .notificationClient: .notificationClient
|
||||||
case .syncProfiling: self = .syncProfiling
|
case .syncProfiling: .syncProfiling
|
||||||
case .latestEvents: self = .latestEvents
|
case .latestEvents: .latestEvents
|
||||||
|
case .search: .search
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,6 +47,7 @@ nonisolated extension TraceLogPack {
|
|||||||
case .notificationClient: .notificationClient
|
case .notificationClient: .notificationClient
|
||||||
case .syncProfiling: .syncProfiling
|
case .syncProfiling: .syncProfiling
|
||||||
case .latestEvents: .latestEvents
|
case .latestEvents: .latestEvents
|
||||||
|
case .search: .search
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ enum SettingsScreenViewAction {
|
|||||||
/// Set the user's status to the provided value.
|
/// Set the user's status to the provided value.
|
||||||
case set(UserStatus.Raw)
|
case set(UserStatus.Raw)
|
||||||
/// Clears the user's currently displayed status.
|
/// Clears the user's currently displayed status.
|
||||||
case clear(UserStatus.Displayed)
|
case clear
|
||||||
/// Cancel user status picking/input.
|
/// Cancel user status picking/input.
|
||||||
case cancel
|
case cancel
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
|||||||
pickCustomEmoji()
|
pickCustomEmoji()
|
||||||
case .userStatus(.set(let status)):
|
case .userStatus(.set(let status)):
|
||||||
Task { await setUserStatus(status) }
|
Task { await setUserStatus(status) }
|
||||||
case .userStatus(.clear(let status)):
|
case .userStatus(.clear):
|
||||||
Task { await clearUserStatus(status) }
|
Task { await clearUserStatus() }
|
||||||
case .userStatus(.cancel):
|
case .userStatus(.cancel):
|
||||||
state.bindings.isPresentingStatusPicker = false
|
state.bindings.isPresentingStatusPicker = false
|
||||||
state.bindings.isShowingCustomStatusField = false
|
state.bindings.isShowingCustomStatusField = false
|
||||||
@@ -161,7 +161,7 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
|||||||
.asCancellable()
|
.asCancellable()
|
||||||
}
|
}
|
||||||
|
|
||||||
func setUserStatus(_ status: UserStatus.Raw) async {
|
private func setUserStatus(_ status: UserStatus.Raw) async {
|
||||||
// Loading state tbc
|
// Loading state tbc
|
||||||
state.bindings.isPresentingStatusPicker = false
|
state.bindings.isPresentingStatusPicker = false
|
||||||
state.bindings.isShowingCustomStatusField = false
|
state.bindings.isShowingCustomStatusField = false
|
||||||
@@ -177,19 +177,13 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func clearUserStatus(_ status: UserStatus.Displayed) async {
|
/// Clears both the `UserStatus.Raw` and `UserStatus.Call` values simultaneously.
|
||||||
|
private func clearUserStatus() async {
|
||||||
// Loading state tbc
|
// Loading state tbc
|
||||||
state.bindings.isPresentingStatusPicker = false
|
state.bindings.isPresentingStatusPicker = false
|
||||||
state.bindings.isShowingCustomStatusField = false
|
state.bindings.isShowingCustomStatusField = false
|
||||||
|
|
||||||
let result = switch status {
|
switch await clientProxy.clearUserStatus() {
|
||||||
case .userSet:
|
|
||||||
await clientProxy.removeUserStatus()
|
|
||||||
case .inCall:
|
|
||||||
await clientProxy.removeCallStatus()
|
|
||||||
}
|
|
||||||
|
|
||||||
switch result {
|
|
||||||
case .success:
|
case .success:
|
||||||
break // Loading/error state tbc
|
break // Loading/error state tbc
|
||||||
case .failure:
|
case .failure:
|
||||||
|
|||||||
+1
-1
@@ -71,7 +71,7 @@ struct SettingsScreenUserStatusRow: View {
|
|||||||
.accessibilityValue(Text(String(status.emoji)) + Text(status.text))
|
.accessibilityValue(Text(String(status.emoji)) + Text(status.text))
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
|
|
||||||
Button(L10n.actionClear) { action(.clear(status)) }
|
Button(L10n.actionClear) { action(.clear) }
|
||||||
.buttonStyle(.compound(.textLink))
|
.buttonStyle(.compound(.textLink))
|
||||||
}
|
}
|
||||||
.padding(ListRowPadding.insets)
|
.padding(ListRowPadding.insets)
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeUserStatus() async -> Result<Void, ClientProxyError> {
|
func clearUserStatus() async -> Result<Void, ClientProxyError> {
|
||||||
do {
|
do {
|
||||||
try await client.clearUserStatus()
|
try await client.clearUserStatus()
|
||||||
// No need to refresh the profile, we only support user status with the profiles /sync extension.
|
// No need to refresh the profile, we only support user status with the profiles /sync extension.
|
||||||
@@ -788,17 +788,6 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func removeCallStatus() async -> Result<Void, ClientProxyError> {
|
|
||||||
do {
|
|
||||||
try await client.clearCallStatus()
|
|
||||||
// No need to refresh the profile, we only support user status with the profiles /sync extension.
|
|
||||||
return .success(())
|
|
||||||
} catch {
|
|
||||||
MXLog.error("Failed removing call status with error: \(error)")
|
|
||||||
return .failure(.sdkError(error))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func linkNewDeviceService() -> LinkNewDeviceServiceProtocol {
|
func linkNewDeviceService() -> LinkNewDeviceServiceProtocol {
|
||||||
LinkNewDeviceService(handler: client.newGrantLoginWithQrCodeHandler())
|
LinkNewDeviceService(handler: client.newGrantLoginWithQrCodeHandler())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,8 +229,8 @@ protocol ClientProxyProtocol: AnyObject {
|
|||||||
func removeUserAvatar() async -> Result<Void, ClientProxyError>
|
func removeUserAvatar() async -> Result<Void, ClientProxyError>
|
||||||
func isUserStatusSupported() async -> Result<Bool, ClientProxyError>
|
func isUserStatusSupported() async -> Result<Bool, ClientProxyError>
|
||||||
func setUserStatus(_ status: UserStatus.Raw) async -> Result<Void, ClientProxyError>
|
func setUserStatus(_ status: UserStatus.Raw) async -> Result<Void, ClientProxyError>
|
||||||
func removeUserStatus() async -> Result<Void, ClientProxyError>
|
/// Removes both the `m.status` and `m.call` fields from the user's profile.
|
||||||
func removeCallStatus() async -> Result<Void, ClientProxyError>
|
func clearUserStatus() async -> Result<Void, ClientProxyError>
|
||||||
|
|
||||||
func linkNewDeviceService() -> LinkNewDeviceServiceProtocol
|
func linkNewDeviceService() -> LinkNewDeviceServiceProtocol
|
||||||
|
|
||||||
|
|||||||
@@ -742,6 +742,38 @@ open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
|
|||||||
enableAutomaticBackpaginationClosure?()
|
enableAutomaticBackpaginationClosure?()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - enableAutomaticCallStatus
|
||||||
|
|
||||||
|
private let enableAutomaticCallStatusEnabledCallsCountLock = NSLock()
|
||||||
|
private var enableAutomaticCallStatusEnabledUnderlyingCallsCount = 0
|
||||||
|
open var enableAutomaticCallStatusEnabledCallsCount: Int {
|
||||||
|
get { enableAutomaticCallStatusEnabledCallsCountLock.withLock { enableAutomaticCallStatusEnabledUnderlyingCallsCount } }
|
||||||
|
set { enableAutomaticCallStatusEnabledCallsCountLock.withLock { enableAutomaticCallStatusEnabledUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var enableAutomaticCallStatusEnabledCalled: Bool {
|
||||||
|
return enableAutomaticCallStatusEnabledCallsCount > 0
|
||||||
|
}
|
||||||
|
private let enableAutomaticCallStatusEnabledReceivedEnabledLock = NSLock()
|
||||||
|
private var enableAutomaticCallStatusEnabledUnderlyingReceivedEnabled: Bool?
|
||||||
|
open var enableAutomaticCallStatusEnabledReceivedEnabled: Bool? {
|
||||||
|
get { enableAutomaticCallStatusEnabledReceivedEnabledLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedEnabled } }
|
||||||
|
set { enableAutomaticCallStatusEnabledReceivedEnabledLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedEnabled = newValue } }
|
||||||
|
}
|
||||||
|
private let enableAutomaticCallStatusEnabledReceivedInvocationsLock = NSLock()
|
||||||
|
private var enableAutomaticCallStatusEnabledUnderlyingReceivedInvocations: [Bool] = []
|
||||||
|
open var enableAutomaticCallStatusEnabledReceivedInvocations: [Bool] {
|
||||||
|
get { enableAutomaticCallStatusEnabledReceivedInvocationsLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedInvocations } }
|
||||||
|
set { enableAutomaticCallStatusEnabledReceivedInvocationsLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
open var enableAutomaticCallStatusEnabledClosure: ((Bool) -> Void)?
|
||||||
|
|
||||||
|
open override func enableAutomaticCallStatus(enabled: Bool) {
|
||||||
|
enableAutomaticCallStatusEnabledCallsCountLock.withLock { enableAutomaticCallStatusEnabledUnderlyingCallsCount += 1 }
|
||||||
|
enableAutomaticCallStatusEnabledReceivedEnabled = enabled
|
||||||
|
enableAutomaticCallStatusEnabledReceivedInvocationsLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedInvocations.append(enabled) }
|
||||||
|
enableAutomaticCallStatusEnabledClosure?(enabled)
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - enableSendQueueUploadProgress
|
//MARK: - enableSendQueueUploadProgress
|
||||||
|
|
||||||
private let enableSendQueueUploadProgressEnableCallsCountLock = NSLock()
|
private let enableSendQueueUploadProgressEnableCallsCountLock = NSLock()
|
||||||
@@ -5556,6 +5588,65 @@ open class ContentScannerSDKMock: MatrixRustSDK.ContentScanner, @unchecked Senda
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
open class ContinuationMessageSenderSDKMock: MatrixRustSDK.ContinuationMessageSender, @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: - cancel
|
||||||
|
|
||||||
|
open var cancelThrowableError: Error?
|
||||||
|
private let cancelCallsCountLock = NSLock()
|
||||||
|
private var cancelUnderlyingCallsCount = 0
|
||||||
|
open var cancelCallsCount: Int {
|
||||||
|
get { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount } }
|
||||||
|
set { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var cancelCalled: Bool {
|
||||||
|
return cancelCallsCount > 0
|
||||||
|
}
|
||||||
|
open var cancelClosure: (() async throws -> Void)?
|
||||||
|
|
||||||
|
open override func cancel() async throws {
|
||||||
|
if let error = cancelThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
cancelCallsCountLock.withLock { cancelUnderlyingCallsCount += 1 }
|
||||||
|
try await cancelClosure?()
|
||||||
|
}
|
||||||
|
|
||||||
|
//MARK: - confirm
|
||||||
|
|
||||||
|
open var confirmThrowableError: Error?
|
||||||
|
private let confirmCallsCountLock = NSLock()
|
||||||
|
private var confirmUnderlyingCallsCount = 0
|
||||||
|
open var confirmCallsCount: Int {
|
||||||
|
get { confirmCallsCountLock.withLock { confirmUnderlyingCallsCount } }
|
||||||
|
set { confirmCallsCountLock.withLock { confirmUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var confirmCalled: Bool {
|
||||||
|
return confirmCallsCount > 0
|
||||||
|
}
|
||||||
|
open var confirmClosure: (() async throws -> Void)?
|
||||||
|
|
||||||
|
open override func confirm() async throws {
|
||||||
|
if let error = confirmThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
confirmCallsCountLock.withLock { confirmUnderlyingCallsCount += 1 }
|
||||||
|
try await confirmClosure?()
|
||||||
|
}
|
||||||
|
}
|
||||||
open class CrossSigningSecretsSDKMock: MatrixRustSDK.CrossSigningSecrets, @unchecked Sendable {
|
open class CrossSigningSecretsSDKMock: MatrixRustSDK.CrossSigningSecrets, @unchecked Sendable {
|
||||||
public init() {
|
public init() {
|
||||||
super.init(noHandle: .init())
|
super.init(noHandle: .init())
|
||||||
@@ -5691,6 +5782,53 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - createDehydratedDevice
|
||||||
|
|
||||||
|
open var createDehydratedDeviceDisplayNamePickleKeyThrowableError: Error?
|
||||||
|
private let createDehydratedDeviceDisplayNamePickleKeyCallsCountLock = NSLock()
|
||||||
|
private var createDehydratedDeviceDisplayNamePickleKeyUnderlyingCallsCount = 0
|
||||||
|
open var createDehydratedDeviceDisplayNamePickleKeyCallsCount: Int {
|
||||||
|
get { createDehydratedDeviceDisplayNamePickleKeyCallsCountLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingCallsCount } }
|
||||||
|
set { createDehydratedDeviceDisplayNamePickleKeyCallsCountLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var createDehydratedDeviceDisplayNamePickleKeyCalled: Bool {
|
||||||
|
return createDehydratedDeviceDisplayNamePickleKeyCallsCount > 0
|
||||||
|
}
|
||||||
|
private let createDehydratedDeviceDisplayNamePickleKeyReceivedArgumentsLock = NSLock()
|
||||||
|
private var createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedArguments: (displayName: String?, pickleKey: String)?
|
||||||
|
open var createDehydratedDeviceDisplayNamePickleKeyReceivedArguments: (displayName: String?, pickleKey: String)? {
|
||||||
|
get { createDehydratedDeviceDisplayNamePickleKeyReceivedArgumentsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedArguments } }
|
||||||
|
set { createDehydratedDeviceDisplayNamePickleKeyReceivedArgumentsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedArguments = newValue } }
|
||||||
|
}
|
||||||
|
private let createDehydratedDeviceDisplayNamePickleKeyReceivedInvocationsLock = NSLock()
|
||||||
|
private var createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedInvocations: [(displayName: String?, pickleKey: String)] = []
|
||||||
|
open var createDehydratedDeviceDisplayNamePickleKeyReceivedInvocations: [(displayName: String?, pickleKey: String)] {
|
||||||
|
get { createDehydratedDeviceDisplayNamePickleKeyReceivedInvocationsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedInvocations } }
|
||||||
|
set { createDehydratedDeviceDisplayNamePickleKeyReceivedInvocationsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
|
||||||
|
private let createDehydratedDeviceDisplayNamePickleKeyReturnValueLock = NSLock()
|
||||||
|
open var createDehydratedDeviceDisplayNamePickleKeyUnderlyingReturnValue: String!
|
||||||
|
open var createDehydratedDeviceDisplayNamePickleKeyReturnValue: String! {
|
||||||
|
get { createDehydratedDeviceDisplayNamePickleKeyReturnValueLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReturnValue } }
|
||||||
|
set { createDehydratedDeviceDisplayNamePickleKeyReturnValueLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReturnValue = newValue } }
|
||||||
|
}
|
||||||
|
open var createDehydratedDeviceDisplayNamePickleKeyClosure: ((String?, String) async throws -> String)?
|
||||||
|
|
||||||
|
open override func createDehydratedDevice(displayName: String?, pickleKey: String) async throws -> String {
|
||||||
|
if let error = createDehydratedDeviceDisplayNamePickleKeyThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
createDehydratedDeviceDisplayNamePickleKeyCallsCountLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingCallsCount += 1 }
|
||||||
|
createDehydratedDeviceDisplayNamePickleKeyReceivedArguments = (displayName: displayName, pickleKey: pickleKey)
|
||||||
|
createDehydratedDeviceDisplayNamePickleKeyReceivedInvocationsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedInvocations.append((displayName: displayName, pickleKey: pickleKey)) }
|
||||||
|
if let createDehydratedDeviceDisplayNamePickleKeyClosure = createDehydratedDeviceDisplayNamePickleKeyClosure {
|
||||||
|
return try await createDehydratedDeviceDisplayNamePickleKeyClosure(displayName, pickleKey)
|
||||||
|
} else {
|
||||||
|
return createDehydratedDeviceDisplayNamePickleKeyReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - curve25519Key
|
//MARK: - curve25519Key
|
||||||
|
|
||||||
private let curve25519KeyCallsCountLock = NSLock()
|
private let curve25519KeyCallsCountLock = NSLock()
|
||||||
@@ -5720,6 +5858,71 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - dehydratedDeviceEventListener
|
||||||
|
|
||||||
|
private let dehydratedDeviceEventListenerListenerCallsCountLock = NSLock()
|
||||||
|
private var dehydratedDeviceEventListenerListenerUnderlyingCallsCount = 0
|
||||||
|
open var dehydratedDeviceEventListenerListenerCallsCount: Int {
|
||||||
|
get { dehydratedDeviceEventListenerListenerCallsCountLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingCallsCount } }
|
||||||
|
set { dehydratedDeviceEventListenerListenerCallsCountLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var dehydratedDeviceEventListenerListenerCalled: Bool {
|
||||||
|
return dehydratedDeviceEventListenerListenerCallsCount > 0
|
||||||
|
}
|
||||||
|
private let dehydratedDeviceEventListenerListenerReceivedListenerLock = NSLock()
|
||||||
|
private var dehydratedDeviceEventListenerListenerUnderlyingReceivedListener: DehydratedDeviceEventListener?
|
||||||
|
open var dehydratedDeviceEventListenerListenerReceivedListener: DehydratedDeviceEventListener? {
|
||||||
|
get { dehydratedDeviceEventListenerListenerReceivedListenerLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedListener } }
|
||||||
|
set { dehydratedDeviceEventListenerListenerReceivedListenerLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedListener = newValue } }
|
||||||
|
}
|
||||||
|
private let dehydratedDeviceEventListenerListenerReceivedInvocationsLock = NSLock()
|
||||||
|
private var dehydratedDeviceEventListenerListenerUnderlyingReceivedInvocations: [DehydratedDeviceEventListener] = []
|
||||||
|
open var dehydratedDeviceEventListenerListenerReceivedInvocations: [DehydratedDeviceEventListener] {
|
||||||
|
get { dehydratedDeviceEventListenerListenerReceivedInvocationsLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedInvocations } }
|
||||||
|
set { dehydratedDeviceEventListenerListenerReceivedInvocationsLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
|
||||||
|
private let dehydratedDeviceEventListenerListenerReturnValueLock = NSLock()
|
||||||
|
open var dehydratedDeviceEventListenerListenerUnderlyingReturnValue: TaskHandle!
|
||||||
|
open var dehydratedDeviceEventListenerListenerReturnValue: TaskHandle! {
|
||||||
|
get { dehydratedDeviceEventListenerListenerReturnValueLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReturnValue } }
|
||||||
|
set { dehydratedDeviceEventListenerListenerReturnValueLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReturnValue = newValue } }
|
||||||
|
}
|
||||||
|
open var dehydratedDeviceEventListenerListenerClosure: ((DehydratedDeviceEventListener) -> TaskHandle)?
|
||||||
|
|
||||||
|
open override func dehydratedDeviceEventListener(listener: DehydratedDeviceEventListener) -> TaskHandle {
|
||||||
|
dehydratedDeviceEventListenerListenerCallsCountLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingCallsCount += 1 }
|
||||||
|
dehydratedDeviceEventListenerListenerReceivedListener = listener
|
||||||
|
dehydratedDeviceEventListenerListenerReceivedInvocationsLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedInvocations.append(listener) }
|
||||||
|
if let dehydratedDeviceEventListenerListenerClosure = dehydratedDeviceEventListenerListenerClosure {
|
||||||
|
return dehydratedDeviceEventListenerListenerClosure(listener)
|
||||||
|
} else {
|
||||||
|
return dehydratedDeviceEventListenerListenerReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//MARK: - deleteDehydratedDevice
|
||||||
|
|
||||||
|
open var deleteDehydratedDeviceThrowableError: Error?
|
||||||
|
private let deleteDehydratedDeviceCallsCountLock = NSLock()
|
||||||
|
private var deleteDehydratedDeviceUnderlyingCallsCount = 0
|
||||||
|
open var deleteDehydratedDeviceCallsCount: Int {
|
||||||
|
get { deleteDehydratedDeviceCallsCountLock.withLock { deleteDehydratedDeviceUnderlyingCallsCount } }
|
||||||
|
set { deleteDehydratedDeviceCallsCountLock.withLock { deleteDehydratedDeviceUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var deleteDehydratedDeviceCalled: Bool {
|
||||||
|
return deleteDehydratedDeviceCallsCount > 0
|
||||||
|
}
|
||||||
|
open var deleteDehydratedDeviceClosure: (() async throws -> Void)?
|
||||||
|
|
||||||
|
open override func deleteDehydratedDevice() async throws {
|
||||||
|
if let error = deleteDehydratedDeviceThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
deleteDehydratedDeviceCallsCountLock.withLock { deleteDehydratedDeviceUnderlyingCallsCount += 1 }
|
||||||
|
try await deleteDehydratedDeviceClosure?()
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - disableRecovery
|
//MARK: - disableRecovery
|
||||||
|
|
||||||
open var disableRecoveryThrowableError: Error?
|
open var disableRecoveryThrowableError: Error?
|
||||||
@@ -5909,6 +6112,39 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
|
|||||||
try await importSecretsBundleSecretsBundleClosure?(secretsBundle)
|
try await importSecretsBundleSecretsBundleClosure?(secretsBundle)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - isDehydratedDeviceSupported
|
||||||
|
|
||||||
|
open var isDehydratedDeviceSupportedThrowableError: Error?
|
||||||
|
private let isDehydratedDeviceSupportedCallsCountLock = NSLock()
|
||||||
|
private var isDehydratedDeviceSupportedUnderlyingCallsCount = 0
|
||||||
|
open var isDehydratedDeviceSupportedCallsCount: Int {
|
||||||
|
get { isDehydratedDeviceSupportedCallsCountLock.withLock { isDehydratedDeviceSupportedUnderlyingCallsCount } }
|
||||||
|
set { isDehydratedDeviceSupportedCallsCountLock.withLock { isDehydratedDeviceSupportedUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var isDehydratedDeviceSupportedCalled: Bool {
|
||||||
|
return isDehydratedDeviceSupportedCallsCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
private let isDehydratedDeviceSupportedReturnValueLock = NSLock()
|
||||||
|
open var isDehydratedDeviceSupportedUnderlyingReturnValue: Bool!
|
||||||
|
open var isDehydratedDeviceSupportedReturnValue: Bool! {
|
||||||
|
get { isDehydratedDeviceSupportedReturnValueLock.withLock { isDehydratedDeviceSupportedUnderlyingReturnValue } }
|
||||||
|
set { isDehydratedDeviceSupportedReturnValueLock.withLock { isDehydratedDeviceSupportedUnderlyingReturnValue = newValue } }
|
||||||
|
}
|
||||||
|
open var isDehydratedDeviceSupportedClosure: (() async throws -> Bool)?
|
||||||
|
|
||||||
|
open override func isDehydratedDeviceSupported() async throws -> Bool {
|
||||||
|
if let error = isDehydratedDeviceSupportedThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
isDehydratedDeviceSupportedCallsCountLock.withLock { isDehydratedDeviceSupportedUnderlyingCallsCount += 1 }
|
||||||
|
if let isDehydratedDeviceSupportedClosure = isDehydratedDeviceSupportedClosure {
|
||||||
|
return try await isDehydratedDeviceSupportedClosure()
|
||||||
|
} else {
|
||||||
|
return isDehydratedDeviceSupportedReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - isLastDevice
|
//MARK: - isLastDevice
|
||||||
|
|
||||||
open var isLastDeviceThrowableError: Error?
|
open var isLastDeviceThrowableError: Error?
|
||||||
@@ -6133,6 +6369,53 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - rehydrateDehydratedDevice
|
||||||
|
|
||||||
|
open var rehydrateDehydratedDevicePickleKeyThrowableError: Error?
|
||||||
|
private let rehydrateDehydratedDevicePickleKeyCallsCountLock = NSLock()
|
||||||
|
private var rehydrateDehydratedDevicePickleKeyUnderlyingCallsCount = 0
|
||||||
|
open var rehydrateDehydratedDevicePickleKeyCallsCount: Int {
|
||||||
|
get { rehydrateDehydratedDevicePickleKeyCallsCountLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingCallsCount } }
|
||||||
|
set { rehydrateDehydratedDevicePickleKeyCallsCountLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var rehydrateDehydratedDevicePickleKeyCalled: Bool {
|
||||||
|
return rehydrateDehydratedDevicePickleKeyCallsCount > 0
|
||||||
|
}
|
||||||
|
private let rehydrateDehydratedDevicePickleKeyReceivedPickleKeyLock = NSLock()
|
||||||
|
private var rehydrateDehydratedDevicePickleKeyUnderlyingReceivedPickleKey: String?
|
||||||
|
open var rehydrateDehydratedDevicePickleKeyReceivedPickleKey: String? {
|
||||||
|
get { rehydrateDehydratedDevicePickleKeyReceivedPickleKeyLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedPickleKey } }
|
||||||
|
set { rehydrateDehydratedDevicePickleKeyReceivedPickleKeyLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedPickleKey = newValue } }
|
||||||
|
}
|
||||||
|
private let rehydrateDehydratedDevicePickleKeyReceivedInvocationsLock = NSLock()
|
||||||
|
private var rehydrateDehydratedDevicePickleKeyUnderlyingReceivedInvocations: [String] = []
|
||||||
|
open var rehydrateDehydratedDevicePickleKeyReceivedInvocations: [String] {
|
||||||
|
get { rehydrateDehydratedDevicePickleKeyReceivedInvocationsLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedInvocations } }
|
||||||
|
set { rehydrateDehydratedDevicePickleKeyReceivedInvocationsLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
|
||||||
|
private let rehydrateDehydratedDevicePickleKeyReturnValueLock = NSLock()
|
||||||
|
open var rehydrateDehydratedDevicePickleKeyUnderlyingReturnValue: Bool!
|
||||||
|
open var rehydrateDehydratedDevicePickleKeyReturnValue: Bool! {
|
||||||
|
get { rehydrateDehydratedDevicePickleKeyReturnValueLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReturnValue } }
|
||||||
|
set { rehydrateDehydratedDevicePickleKeyReturnValueLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReturnValue = newValue } }
|
||||||
|
}
|
||||||
|
open var rehydrateDehydratedDevicePickleKeyClosure: ((String) async throws -> Bool)?
|
||||||
|
|
||||||
|
open override func rehydrateDehydratedDevice(pickleKey: String) async throws -> Bool {
|
||||||
|
if let error = rehydrateDehydratedDevicePickleKeyThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
rehydrateDehydratedDevicePickleKeyCallsCountLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingCallsCount += 1 }
|
||||||
|
rehydrateDehydratedDevicePickleKeyReceivedPickleKey = pickleKey
|
||||||
|
rehydrateDehydratedDevicePickleKeyReceivedInvocationsLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedInvocations.append(pickleKey) }
|
||||||
|
if let rehydrateDehydratedDevicePickleKeyClosure = rehydrateDehydratedDevicePickleKeyClosure {
|
||||||
|
return try await rehydrateDehydratedDevicePickleKeyClosure(pickleKey)
|
||||||
|
} else {
|
||||||
|
return rehydrateDehydratedDevicePickleKeyReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - resetIdentity
|
//MARK: - resetIdentity
|
||||||
|
|
||||||
open var resetIdentityThrowableError: Error?
|
open var resetIdentityThrowableError: Error?
|
||||||
@@ -6199,6 +6482,60 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - startDehydratedDevices
|
||||||
|
|
||||||
|
open var startDehydratedDevicesRecoveryKeySettingsThrowableError: Error?
|
||||||
|
private let startDehydratedDevicesRecoveryKeySettingsCallsCountLock = NSLock()
|
||||||
|
private var startDehydratedDevicesRecoveryKeySettingsUnderlyingCallsCount = 0
|
||||||
|
open var startDehydratedDevicesRecoveryKeySettingsCallsCount: Int {
|
||||||
|
get { startDehydratedDevicesRecoveryKeySettingsCallsCountLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingCallsCount } }
|
||||||
|
set { startDehydratedDevicesRecoveryKeySettingsCallsCountLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var startDehydratedDevicesRecoveryKeySettingsCalled: Bool {
|
||||||
|
return startDehydratedDevicesRecoveryKeySettingsCallsCount > 0
|
||||||
|
}
|
||||||
|
private let startDehydratedDevicesRecoveryKeySettingsReceivedArgumentsLock = NSLock()
|
||||||
|
private var startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedArguments: (recoveryKey: String, settings: StartDehydratedDevicesSettings)?
|
||||||
|
open var startDehydratedDevicesRecoveryKeySettingsReceivedArguments: (recoveryKey: String, settings: StartDehydratedDevicesSettings)? {
|
||||||
|
get { startDehydratedDevicesRecoveryKeySettingsReceivedArgumentsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedArguments } }
|
||||||
|
set { startDehydratedDevicesRecoveryKeySettingsReceivedArgumentsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedArguments = newValue } }
|
||||||
|
}
|
||||||
|
private let startDehydratedDevicesRecoveryKeySettingsReceivedInvocationsLock = NSLock()
|
||||||
|
private var startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedInvocations: [(recoveryKey: String, settings: StartDehydratedDevicesSettings)] = []
|
||||||
|
open var startDehydratedDevicesRecoveryKeySettingsReceivedInvocations: [(recoveryKey: String, settings: StartDehydratedDevicesSettings)] {
|
||||||
|
get { startDehydratedDevicesRecoveryKeySettingsReceivedInvocationsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedInvocations } }
|
||||||
|
set { startDehydratedDevicesRecoveryKeySettingsReceivedInvocationsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
open var startDehydratedDevicesRecoveryKeySettingsClosure: ((String, StartDehydratedDevicesSettings) async throws -> Void)?
|
||||||
|
|
||||||
|
open override func startDehydratedDevices(recoveryKey: String, settings: StartDehydratedDevicesSettings) async throws {
|
||||||
|
if let error = startDehydratedDevicesRecoveryKeySettingsThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
startDehydratedDevicesRecoveryKeySettingsCallsCountLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingCallsCount += 1 }
|
||||||
|
startDehydratedDevicesRecoveryKeySettingsReceivedArguments = (recoveryKey: recoveryKey, settings: settings)
|
||||||
|
startDehydratedDevicesRecoveryKeySettingsReceivedInvocationsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedInvocations.append((recoveryKey: recoveryKey, settings: settings)) }
|
||||||
|
try await startDehydratedDevicesRecoveryKeySettingsClosure?(recoveryKey, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
//MARK: - stopDehydratedDevices
|
||||||
|
|
||||||
|
private let stopDehydratedDevicesCallsCountLock = NSLock()
|
||||||
|
private var stopDehydratedDevicesUnderlyingCallsCount = 0
|
||||||
|
open var stopDehydratedDevicesCallsCount: Int {
|
||||||
|
get { stopDehydratedDevicesCallsCountLock.withLock { stopDehydratedDevicesUnderlyingCallsCount } }
|
||||||
|
set { stopDehydratedDevicesCallsCountLock.withLock { stopDehydratedDevicesUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var stopDehydratedDevicesCalled: Bool {
|
||||||
|
return stopDehydratedDevicesCallsCount > 0
|
||||||
|
}
|
||||||
|
open var stopDehydratedDevicesClosure: (() -> Void)?
|
||||||
|
|
||||||
|
open override func stopDehydratedDevices() {
|
||||||
|
stopDehydratedDevicesCallsCountLock.withLock { stopDehydratedDevicesUnderlyingCallsCount += 1 }
|
||||||
|
stopDehydratedDevicesClosure?()
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - userIdentity
|
//MARK: - userIdentity
|
||||||
|
|
||||||
open var userIdentityUserIdFallbackToServerThrowableError: Error?
|
open var userIdentityUserIdFallbackToServerThrowableError: Error?
|
||||||
@@ -10335,6 +10672,53 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - loadUserReceipt
|
||||||
|
|
||||||
|
open var loadUserReceiptReceiptTypeThreadUserIdThrowableError: Error?
|
||||||
|
private let loadUserReceiptReceiptTypeThreadUserIdCallsCountLock = NSLock()
|
||||||
|
private var loadUserReceiptReceiptTypeThreadUserIdUnderlyingCallsCount = 0
|
||||||
|
open var loadUserReceiptReceiptTypeThreadUserIdCallsCount: Int {
|
||||||
|
get { loadUserReceiptReceiptTypeThreadUserIdCallsCountLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingCallsCount } }
|
||||||
|
set { loadUserReceiptReceiptTypeThreadUserIdCallsCountLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var loadUserReceiptReceiptTypeThreadUserIdCalled: Bool {
|
||||||
|
return loadUserReceiptReceiptTypeThreadUserIdCallsCount > 0
|
||||||
|
}
|
||||||
|
private let loadUserReceiptReceiptTypeThreadUserIdReceivedArgumentsLock = NSLock()
|
||||||
|
private var loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedArguments: (receiptType: ReceiptType, thread: ReceiptThread, userId: String)?
|
||||||
|
open var loadUserReceiptReceiptTypeThreadUserIdReceivedArguments: (receiptType: ReceiptType, thread: ReceiptThread, userId: String)? {
|
||||||
|
get { loadUserReceiptReceiptTypeThreadUserIdReceivedArgumentsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedArguments } }
|
||||||
|
set { loadUserReceiptReceiptTypeThreadUserIdReceivedArgumentsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedArguments = newValue } }
|
||||||
|
}
|
||||||
|
private let loadUserReceiptReceiptTypeThreadUserIdReceivedInvocationsLock = NSLock()
|
||||||
|
private var loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedInvocations: [(receiptType: ReceiptType, thread: ReceiptThread, userId: String)] = []
|
||||||
|
open var loadUserReceiptReceiptTypeThreadUserIdReceivedInvocations: [(receiptType: ReceiptType, thread: ReceiptThread, userId: String)] {
|
||||||
|
get { loadUserReceiptReceiptTypeThreadUserIdReceivedInvocationsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedInvocations } }
|
||||||
|
set { loadUserReceiptReceiptTypeThreadUserIdReceivedInvocationsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
|
||||||
|
private let loadUserReceiptReceiptTypeThreadUserIdReturnValueLock = NSLock()
|
||||||
|
open var loadUserReceiptReceiptTypeThreadUserIdUnderlyingReturnValue: UserReceipt?
|
||||||
|
open var loadUserReceiptReceiptTypeThreadUserIdReturnValue: UserReceipt? {
|
||||||
|
get { loadUserReceiptReceiptTypeThreadUserIdReturnValueLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReturnValue } }
|
||||||
|
set { loadUserReceiptReceiptTypeThreadUserIdReturnValueLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReturnValue = newValue } }
|
||||||
|
}
|
||||||
|
open var loadUserReceiptReceiptTypeThreadUserIdClosure: ((ReceiptType, ReceiptThread, String) async throws -> UserReceipt?)?
|
||||||
|
|
||||||
|
open override func loadUserReceipt(receiptType: ReceiptType, thread: ReceiptThread, userId: String) async throws -> UserReceipt? {
|
||||||
|
if let error = loadUserReceiptReceiptTypeThreadUserIdThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
loadUserReceiptReceiptTypeThreadUserIdCallsCountLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingCallsCount += 1 }
|
||||||
|
loadUserReceiptReceiptTypeThreadUserIdReceivedArguments = (receiptType: receiptType, thread: thread, userId: userId)
|
||||||
|
loadUserReceiptReceiptTypeThreadUserIdReceivedInvocationsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedInvocations.append((receiptType: receiptType, thread: thread, userId: userId)) }
|
||||||
|
if let loadUserReceiptReceiptTypeThreadUserIdClosure = loadUserReceiptReceiptTypeThreadUserIdClosure {
|
||||||
|
return try await loadUserReceiptReceiptTypeThreadUserIdClosure(receiptType, thread, userId)
|
||||||
|
} else {
|
||||||
|
return loadUserReceiptReceiptTypeThreadUserIdReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - markAsFullyReadUnchecked
|
//MARK: - markAsFullyReadUnchecked
|
||||||
|
|
||||||
open var markAsFullyReadUncheckedEventIdThrowableError: Error?
|
open var markAsFullyReadUncheckedEventIdThrowableError: Error?
|
||||||
@@ -11335,6 +11719,42 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
|
|||||||
try await sendRawEventTypeContentClosure?(eventType, content)
|
try await sendRawEventTypeContentClosure?(eventType, content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - sendSingleReceipt
|
||||||
|
|
||||||
|
open var sendSingleReceiptReceiptTypeThreadEventIdThrowableError: Error?
|
||||||
|
private let sendSingleReceiptReceiptTypeThreadEventIdCallsCountLock = NSLock()
|
||||||
|
private var sendSingleReceiptReceiptTypeThreadEventIdUnderlyingCallsCount = 0
|
||||||
|
open var sendSingleReceiptReceiptTypeThreadEventIdCallsCount: Int {
|
||||||
|
get { sendSingleReceiptReceiptTypeThreadEventIdCallsCountLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingCallsCount } }
|
||||||
|
set { sendSingleReceiptReceiptTypeThreadEventIdCallsCountLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var sendSingleReceiptReceiptTypeThreadEventIdCalled: Bool {
|
||||||
|
return sendSingleReceiptReceiptTypeThreadEventIdCallsCount > 0
|
||||||
|
}
|
||||||
|
private let sendSingleReceiptReceiptTypeThreadEventIdReceivedArgumentsLock = NSLock()
|
||||||
|
private var sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedArguments: (receiptType: ReceiptType, thread: ReceiptThread, eventId: String)?
|
||||||
|
open var sendSingleReceiptReceiptTypeThreadEventIdReceivedArguments: (receiptType: ReceiptType, thread: ReceiptThread, eventId: String)? {
|
||||||
|
get { sendSingleReceiptReceiptTypeThreadEventIdReceivedArgumentsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedArguments } }
|
||||||
|
set { sendSingleReceiptReceiptTypeThreadEventIdReceivedArgumentsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedArguments = newValue } }
|
||||||
|
}
|
||||||
|
private let sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocationsLock = NSLock()
|
||||||
|
private var sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedInvocations: [(receiptType: ReceiptType, thread: ReceiptThread, eventId: String)] = []
|
||||||
|
open var sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocations: [(receiptType: ReceiptType, thread: ReceiptThread, eventId: String)] {
|
||||||
|
get { sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocationsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedInvocations } }
|
||||||
|
set { sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocationsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
open var sendSingleReceiptReceiptTypeThreadEventIdClosure: ((ReceiptType, ReceiptThread, String) async throws -> Void)?
|
||||||
|
|
||||||
|
open override func sendSingleReceipt(receiptType: ReceiptType, thread: ReceiptThread, eventId: String) async throws {
|
||||||
|
if let error = sendSingleReceiptReceiptTypeThreadEventIdThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
sendSingleReceiptReceiptTypeThreadEventIdCallsCountLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingCallsCount += 1 }
|
||||||
|
sendSingleReceiptReceiptTypeThreadEventIdReceivedArguments = (receiptType: receiptType, thread: thread, eventId: eventId)
|
||||||
|
sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocationsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedInvocations.append((receiptType: receiptType, thread: thread, eventId: eventId)) }
|
||||||
|
try await sendSingleReceiptReceiptTypeThreadEventIdClosure?(receiptType, thread, eventId)
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - sendStateEventRaw
|
//MARK: - sendStateEventRaw
|
||||||
|
|
||||||
open var sendStateEventRawEventTypeStateKeyContentThrowableError: Error?
|
open var sendStateEventRawEventTypeStateKeyContentThrowableError: Error?
|
||||||
@@ -16451,6 +16871,49 @@ open class SyncServiceBuilderSDKMock: MatrixRustSDK.SyncServiceBuilder, @uncheck
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - withParentSpan
|
||||||
|
|
||||||
|
private let withParentSpanSpanCallsCountLock = NSLock()
|
||||||
|
private var withParentSpanSpanUnderlyingCallsCount = 0
|
||||||
|
open var withParentSpanSpanCallsCount: Int {
|
||||||
|
get { withParentSpanSpanCallsCountLock.withLock { withParentSpanSpanUnderlyingCallsCount } }
|
||||||
|
set { withParentSpanSpanCallsCountLock.withLock { withParentSpanSpanUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var withParentSpanSpanCalled: Bool {
|
||||||
|
return withParentSpanSpanCallsCount > 0
|
||||||
|
}
|
||||||
|
private let withParentSpanSpanReceivedSpanLock = NSLock()
|
||||||
|
private var withParentSpanSpanUnderlyingReceivedSpan: Span?
|
||||||
|
open var withParentSpanSpanReceivedSpan: Span? {
|
||||||
|
get { withParentSpanSpanReceivedSpanLock.withLock { withParentSpanSpanUnderlyingReceivedSpan } }
|
||||||
|
set { withParentSpanSpanReceivedSpanLock.withLock { withParentSpanSpanUnderlyingReceivedSpan = newValue } }
|
||||||
|
}
|
||||||
|
private let withParentSpanSpanReceivedInvocationsLock = NSLock()
|
||||||
|
private var withParentSpanSpanUnderlyingReceivedInvocations: [Span] = []
|
||||||
|
open var withParentSpanSpanReceivedInvocations: [Span] {
|
||||||
|
get { withParentSpanSpanReceivedInvocationsLock.withLock { withParentSpanSpanUnderlyingReceivedInvocations } }
|
||||||
|
set { withParentSpanSpanReceivedInvocationsLock.withLock { withParentSpanSpanUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
|
||||||
|
private let withParentSpanSpanReturnValueLock = NSLock()
|
||||||
|
open var withParentSpanSpanUnderlyingReturnValue: SyncServiceBuilder!
|
||||||
|
open var withParentSpanSpanReturnValue: SyncServiceBuilder! {
|
||||||
|
get { withParentSpanSpanReturnValueLock.withLock { withParentSpanSpanUnderlyingReturnValue } }
|
||||||
|
set { withParentSpanSpanReturnValueLock.withLock { withParentSpanSpanUnderlyingReturnValue = newValue } }
|
||||||
|
}
|
||||||
|
open var withParentSpanSpanClosure: ((Span) -> SyncServiceBuilder)?
|
||||||
|
|
||||||
|
open override func withParentSpan(span: Span) -> SyncServiceBuilder {
|
||||||
|
withParentSpanSpanCallsCountLock.withLock { withParentSpanSpanUnderlyingCallsCount += 1 }
|
||||||
|
withParentSpanSpanReceivedSpan = span
|
||||||
|
withParentSpanSpanReceivedInvocationsLock.withLock { withParentSpanSpanUnderlyingReceivedInvocations.append(span) }
|
||||||
|
if let withParentSpanSpanClosure = withParentSpanSpanClosure {
|
||||||
|
return withParentSpanSpanClosure(span)
|
||||||
|
} else {
|
||||||
|
return withParentSpanSpanReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - withProfilesExtension
|
//MARK: - withProfilesExtension
|
||||||
|
|
||||||
private let withProfilesExtensionCallsCountLock = NSLock()
|
private let withProfilesExtensionCallsCountLock = NSLock()
|
||||||
@@ -18000,6 +18463,53 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - sendWithExtraContent
|
||||||
|
|
||||||
|
open var sendWithExtraContentMsgExtraContentJsonThrowableError: Error?
|
||||||
|
private let sendWithExtraContentMsgExtraContentJsonCallsCountLock = NSLock()
|
||||||
|
private var sendWithExtraContentMsgExtraContentJsonUnderlyingCallsCount = 0
|
||||||
|
open var sendWithExtraContentMsgExtraContentJsonCallsCount: Int {
|
||||||
|
get { sendWithExtraContentMsgExtraContentJsonCallsCountLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingCallsCount } }
|
||||||
|
set { sendWithExtraContentMsgExtraContentJsonCallsCountLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingCallsCount = newValue } }
|
||||||
|
}
|
||||||
|
open var sendWithExtraContentMsgExtraContentJsonCalled: Bool {
|
||||||
|
return sendWithExtraContentMsgExtraContentJsonCallsCount > 0
|
||||||
|
}
|
||||||
|
private let sendWithExtraContentMsgExtraContentJsonReceivedArgumentsLock = NSLock()
|
||||||
|
private var sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?)?
|
||||||
|
open var sendWithExtraContentMsgExtraContentJsonReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?)? {
|
||||||
|
get { sendWithExtraContentMsgExtraContentJsonReceivedArgumentsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedArguments } }
|
||||||
|
set { sendWithExtraContentMsgExtraContentJsonReceivedArgumentsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedArguments = newValue } }
|
||||||
|
}
|
||||||
|
private let sendWithExtraContentMsgExtraContentJsonReceivedInvocationsLock = NSLock()
|
||||||
|
private var sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?)] = []
|
||||||
|
open var sendWithExtraContentMsgExtraContentJsonReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?)] {
|
||||||
|
get { sendWithExtraContentMsgExtraContentJsonReceivedInvocationsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedInvocations } }
|
||||||
|
set { sendWithExtraContentMsgExtraContentJsonReceivedInvocationsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedInvocations = newValue } }
|
||||||
|
}
|
||||||
|
|
||||||
|
private let sendWithExtraContentMsgExtraContentJsonReturnValueLock = NSLock()
|
||||||
|
open var sendWithExtraContentMsgExtraContentJsonUnderlyingReturnValue: SendHandle!
|
||||||
|
open var sendWithExtraContentMsgExtraContentJsonReturnValue: SendHandle! {
|
||||||
|
get { sendWithExtraContentMsgExtraContentJsonReturnValueLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReturnValue } }
|
||||||
|
set { sendWithExtraContentMsgExtraContentJsonReturnValueLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReturnValue = newValue } }
|
||||||
|
}
|
||||||
|
open var sendWithExtraContentMsgExtraContentJsonClosure: ((RoomMessageEventContentWithoutRelation, String?) async throws -> SendHandle)?
|
||||||
|
|
||||||
|
open override func sendWithExtraContent(msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?) async throws -> SendHandle {
|
||||||
|
if let error = sendWithExtraContentMsgExtraContentJsonThrowableError {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
sendWithExtraContentMsgExtraContentJsonCallsCountLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingCallsCount += 1 }
|
||||||
|
sendWithExtraContentMsgExtraContentJsonReceivedArguments = (msg: msg, extraContentJson: extraContentJson)
|
||||||
|
sendWithExtraContentMsgExtraContentJsonReceivedInvocationsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedInvocations.append((msg: msg, extraContentJson: extraContentJson)) }
|
||||||
|
if let sendWithExtraContentMsgExtraContentJsonClosure = sendWithExtraContentMsgExtraContentJsonClosure {
|
||||||
|
return try await sendWithExtraContentMsgExtraContentJsonClosure(msg, extraContentJson)
|
||||||
|
} else {
|
||||||
|
return sendWithExtraContentMsgExtraContentJsonReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - subscribeToBackPaginationStatus
|
//MARK: - subscribeToBackPaginationStatus
|
||||||
|
|
||||||
open var subscribeToBackPaginationStatusListenerThrowableError: Error?
|
open var subscribeToBackPaginationStatusListenerThrowableError: Error?
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ struct SettingsScreenViewModelTests {
|
|||||||
// Given a screen where no status has been set or removed yet.
|
// Given a screen where no status has been set or removed yet.
|
||||||
setupViewModel()
|
setupViewModel()
|
||||||
#expect(clientProxy.setUserStatusCallsCount == 0)
|
#expect(clientProxy.setUserStatusCallsCount == 0)
|
||||||
#expect(clientProxy.removeUserStatusCallsCount == 0)
|
#expect(clientProxy.clearUserStatusCallsCount == 0)
|
||||||
|
|
||||||
// When setting a status.
|
// When setting a status.
|
||||||
let status = UserStatus.Raw(text: "Away", emoji: "🌴")
|
let status = UserStatus.Raw(text: "Away", emoji: "🌴")
|
||||||
@@ -73,21 +73,20 @@ struct SettingsScreenViewModelTests {
|
|||||||
// Then only the set endpoint should be called, with the chosen status.
|
// Then only the set endpoint should be called, with the chosen status.
|
||||||
#expect(try await statusSet.fulfill() == status)
|
#expect(try await statusSet.fulfill() == status)
|
||||||
#expect(clientProxy.setUserStatusCallsCount == 1)
|
#expect(clientProxy.setUserStatusCallsCount == 1)
|
||||||
#expect(clientProxy.removeUserStatusCallsCount == 0)
|
#expect(clientProxy.clearUserStatusCallsCount == 0)
|
||||||
|
|
||||||
// When clearing the status.
|
// When clearing the status.
|
||||||
let (removeStream, removeContinuation) = AsyncStream<Void>.makeStream()
|
let (removeStream, removeContinuation) = AsyncStream<Void>.makeStream()
|
||||||
clientProxy.removeUserStatusClosure = {
|
clientProxy.clearUserStatusClosure = {
|
||||||
removeContinuation.yield()
|
removeContinuation.yield()
|
||||||
return .success(())
|
return .success(())
|
||||||
}
|
}
|
||||||
let statusRemoved = deferFulfillment(removeStream) { _ in true }
|
let statusRemoved = deferFulfillment(removeStream) { _ in true }
|
||||||
context.send(viewAction: .userStatus(.clear(.userSet(status))))
|
context.send(viewAction: .userStatus(.clear))
|
||||||
|
|
||||||
// Then only the remove user status endpoint should be called.
|
// Then the clear user status endpoint should be called.
|
||||||
try await statusRemoved.fulfill()
|
try await statusRemoved.fulfill()
|
||||||
#expect(clientProxy.removeUserStatusCallsCount == 1)
|
#expect(clientProxy.clearUserStatusCallsCount == 1)
|
||||||
#expect(!clientProxy.removeCallStatusCalled)
|
|
||||||
#expect(clientProxy.setUserStatusCallsCount == 1)
|
#expect(clientProxy.setUserStatusCallsCount == 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,21 +95,21 @@ struct SettingsScreenViewModelTests {
|
|||||||
// Given a screen where the user has a call status set.
|
// Given a screen where the user has a call status set.
|
||||||
let callStatus = UserStatus.mockCall
|
let callStatus = UserStatus.mockCall
|
||||||
setupViewModel(status: callStatus)
|
setupViewModel(status: callStatus)
|
||||||
let displayedStatus = try #require(callStatus.displayed)
|
#expect(!clientProxy.clearUserStatusCalled)
|
||||||
|
#expect(!clientProxy.setUserStatusCalled)
|
||||||
|
|
||||||
// When clearing the status.
|
// When clearing the status.
|
||||||
let (removeStream, removeContinuation) = AsyncStream<Void>.makeStream()
|
let (removeStream, removeContinuation) = AsyncStream<Void>.makeStream()
|
||||||
clientProxy.removeCallStatusClosure = {
|
clientProxy.clearUserStatusClosure = {
|
||||||
removeContinuation.yield()
|
removeContinuation.yield()
|
||||||
return .success(())
|
return .success(())
|
||||||
}
|
}
|
||||||
let statusRemoved = deferFulfillment(removeStream) { _ in true }
|
let statusRemoved = deferFulfillment(removeStream) { _ in true }
|
||||||
context.send(viewAction: .userStatus(.clear(displayedStatus)))
|
context.send(viewAction: .userStatus(.clear))
|
||||||
|
|
||||||
// Then only the remove endpoint should be called, leaving the set call untouched.
|
// Then the clear user status endpoint should be called.
|
||||||
try await statusRemoved.fulfill()
|
try await statusRemoved.fulfill()
|
||||||
#expect(clientProxy.removeCallStatusCallsCount == 1)
|
#expect(clientProxy.clearUserStatusCallsCount == 1)
|
||||||
#expect(!clientProxy.removeUserStatusCalled)
|
|
||||||
#expect(!clientProxy.setUserStatusCalled)
|
#expect(!clientProxy.setUserStatusCalled)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -74,7 +74,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: 26.07.28
|
exactVersion: 26.08.06
|
||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
Compound:
|
Compound:
|
||||||
path: compound-ios
|
path: compound-ios
|
||||||
|
|||||||
Reference in New Issue
Block a user