mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Bump the RustSDK to v26.02.03 (#5051)
Bump the RustSDK to v26.02.03 Fix breaking changes and add support for the new background task error reporting delegate and the new room invite latest event.
This commit is contained in:
@@ -224,6 +224,19 @@ class ClientProxy: ClientProxyProtocol {
|
||||
delegateHandle = try client.setDelegate(delegate: ClientDelegateWrapper { [weak self] isSoftLogout in
|
||||
self?.hasEncounteredAuthError = true
|
||||
self?.actionsSubject.send(.receivedAuthError(isSoftLogout: isSoftLogout))
|
||||
} backgroundTaskErrorCallback: { error in
|
||||
switch error {
|
||||
case .panic(let message, let backtrace):
|
||||
MXLog.error("Received background task panic: \(message ?? "Missing message")\nBacktrace:\n\(backtrace ?? "Missing backtrace")")
|
||||
|
||||
if AppSettings.appBuildType == .debug || AppSettings.appBuildType == .nightly {
|
||||
fatalError(message ?? "")
|
||||
}
|
||||
case .error(let error):
|
||||
MXLog.error("Received background task error: \(error)")
|
||||
case .earlyTermination:
|
||||
MXLog.error("Received background task early termination")
|
||||
}
|
||||
})
|
||||
|
||||
try await client.setUtdDelegate(utdDelegate: ClientDecryptionErrorDelegate(actionsSubject: actionsSubject))
|
||||
@@ -1262,9 +1275,12 @@ class ClientProxy: ClientProxyProtocol {
|
||||
|
||||
private final class ClientDelegateWrapper: ClientDelegate {
|
||||
private let authErrorCallback: @Sendable (Bool) -> Void
|
||||
private let backgroundTaskErrorCallback: @Sendable (MatrixRustSDK.BackgroundTaskFailureReason) -> Void
|
||||
|
||||
init(authErrorCallback: @escaping @Sendable (Bool) -> Void) {
|
||||
init(authErrorCallback: @escaping @Sendable (Bool) -> Void,
|
||||
backgroundTaskErrorCallback: @escaping @Sendable (MatrixRustSDK.BackgroundTaskFailureReason) -> Void) {
|
||||
self.authErrorCallback = authErrorCallback
|
||||
self.backgroundTaskErrorCallback = backgroundTaskErrorCallback
|
||||
}
|
||||
|
||||
// MARK: - ClientDelegate
|
||||
@@ -1277,6 +1293,10 @@ private final class ClientDelegateWrapper: ClientDelegate {
|
||||
func didRefreshTokens() {
|
||||
MXLog.info("Delegating session updates to the ClientSessionDelegate.")
|
||||
}
|
||||
|
||||
func onBackgroundTaskErrorReport(taskName: String, error: MatrixRustSDK.BackgroundTaskFailureReason) {
|
||||
backgroundTaskErrorCallback(error)
|
||||
}
|
||||
}
|
||||
|
||||
private final class ClientDecryptionErrorDelegate: UnableToDecryptDelegate {
|
||||
|
||||
Reference in New Issue
Block a user