From 266fccefbbf088cbb1d622c93832ab89252cad76 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Wed, 15 Mar 2023 12:42:19 +0000 Subject: [PATCH] Bump SDK version and fix breaking changes. (#703) --- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- .../Sources/Services/Media/MediaLoader.swift | 4 ++-- .../MediaProvider/MediaLoaderTests.swift | 20 ++++++++++++++++--- changelog.d/pr-703.change | 1 + project.yml | 2 +- 5 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 changelog.d/pr-703.change diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index eb3051a36..2326c8769 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -95,8 +95,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/matrix-org/matrix-rust-components-swift", "state" : { - "revision" : "8d7ace5140d0f024b9a03939cdff29c837dc5645", - "version" : "1.0.45-alpha" + "revision" : "6e9c8b7f0f68fd8e617e9d6c1ad902736899557a", + "version" : "1.0.46-alpha" } }, { diff --git a/ElementX/Sources/Services/Media/MediaLoader.swift b/ElementX/Sources/Services/Media/MediaLoader.swift index cf311fbdc..bbb43bb81 100644 --- a/ElementX/Sources/Services/Media/MediaLoader.swift +++ b/ElementX/Sources/Services/Media/MediaLoader.swift @@ -36,13 +36,13 @@ actor MediaLoader: MediaLoaderProtocol { func loadMediaContentForSource(_ source: MediaSourceProxy) async throws -> Data { try await enqueueLoadMediaRequest(forSource: source) { - try self.client.getMediaContent(source: source.underlyingSource) + try self.client.getMediaContent(mediaSource: source.underlyingSource) } } func loadMediaThumbnailForSource(_ source: MediaSourceProxy, width: UInt, height: UInt) async throws -> Data { try await enqueueLoadMediaRequest(forSource: source) { - try self.client.getMediaThumbnail(source: source.underlyingSource, width: UInt64(width), height: UInt64(height)) + try self.client.getMediaThumbnail(mediaSource: source.underlyingSource, width: UInt64(width), height: UInt64(height)) } } diff --git a/UnitTests/Sources/MediaProvider/MediaLoaderTests.swift b/UnitTests/Sources/MediaProvider/MediaLoaderTests.swift index 89822d3a0..049dcfa04 100644 --- a/UnitTests/Sources/MediaProvider/MediaLoaderTests.swift +++ b/UnitTests/Sources/MediaProvider/MediaLoaderTests.swift @@ -57,12 +57,12 @@ final class MediaLoaderTests: XCTestCase { private class MockMediaLoadingClient: ClientProtocol { private(set) var numberOfInvocations = 0 - func getMediaContent(source: MatrixRustSDK.MediaSource) throws -> [UInt8] { + func getMediaContent(mediaSource: MatrixRustSDK.MediaSource) throws -> [UInt8] { numberOfInvocations += 1 return [] } - func getMediaThumbnail(source: MatrixRustSDK.MediaSource, width: UInt64, height: UInt64) throws -> [UInt8] { + func getMediaThumbnail(mediaSource: MatrixRustSDK.MediaSource, width: UInt64, height: UInt64) throws -> [UInt8] { numberOfInvocations += 1 return [] } @@ -93,7 +93,9 @@ private class MockMediaLoadingClient: ClientProtocol { func setAccountData(eventType: String, content: String) throws { fatalError() } - func uploadMedia(mimeType: String, content: [UInt8]) throws -> String { fatalError() } + func uploadMedia(mimeType: String, data content: [UInt8]) throws -> String { fatalError() } + + func getMediaFile(source: MatrixRustSDK.MediaSource, mimeType: String) throws -> MatrixRustSDK.MediaFileHandle { fatalError() } func getSessionVerificationController() throws -> MatrixRustSDK.SessionVerificationController { fatalError() } @@ -114,4 +116,16 @@ private class MockMediaLoadingClient: ClientProtocol { func slidingSync() -> MatrixRustSDK.SlidingSyncBuilder { fatalError() } func startSync(timelineLimit: UInt16?) { } + + func createRoom(request: MatrixRustSDK.CreateRoomParameters) throws -> String { fatalError() } + + // swiftlint:disable:next function_parameter_count + func setPusher(identifiers: MatrixRustSDK.PusherIdentifiers, + kind: MatrixRustSDK.PusherKind, + appDisplayName: String, + deviceDisplayName: String, + profileTag: String?, + lang: String) throws { + fatalError() + } } diff --git a/changelog.d/pr-703.change b/changelog.d/pr-703.change new file mode 100644 index 000000000..70020386b --- /dev/null +++ b/changelog.d/pr-703.change @@ -0,0 +1 @@ +Bump the SDK version and fix breaking changes. diff --git a/project.yml b/project.yml index 2a1258981..a94e1b1d2 100644 --- a/project.yml +++ b/project.yml @@ -40,7 +40,7 @@ include: packages: MatrixRustSDK: url: https://github.com/matrix-org/matrix-rust-components-swift - exactVersion: 1.0.45-alpha + exactVersion: 1.0.46-alpha # path: ../matrix-rust-sdk DesignKit: path: DesignKit