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:
Stefan Ceriu
2026-02-06 12:08:44 +02:00
committed by GitHub
parent 26060dde3a
commit 61763d9893
9 changed files with 56 additions and 29 deletions
@@ -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 {