From d5fb72c16cef8317cecc5d69958cec11bd2b2894 Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Fri, 31 Jan 2025 12:23:38 +0100 Subject: [PATCH] Do not handle offline mode yet (#3715) * do not handle offline mode yet * fix brew * updated sdk --- ElementX.xcodeproj/project.pbxproj | 7 ++++++- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- .../Sources/Mocks/Generated/SDKGeneratedMocks.swift | 10 +++------- ElementX/Sources/Services/Client/ClientProxy.swift | 3 +++ project.yml | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index f2a7da2e4..f38f0b595 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -1896,6 +1896,7 @@ 752A0EB49BF5BCEA37EDF7A3 /* Signposter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Signposter.swift; sourceTree = ""; }; 753B4C6C0EDDCBF0708DC384 /* TimelineItemSendInfoLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineItemSendInfoLabel.swift; sourceTree = ""; }; 76310030C831D4610A705603 /* URLComponentsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLComponentsTests.swift; sourceTree = ""; }; + 7720ACAC6155AB7F9C70B546 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = nb; path = nb.lproj/Localizable.stringsdict; sourceTree = ""; }; 7773CBFDBD458E0B7E270507 /* PillView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PillView.swift; sourceTree = ""; }; 780258F1B9D15E30549FF4BE /* NotificationSettingsEditScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSettingsEditScreenViewModel.swift; sourceTree = ""; }; 78910787F967CBC6042A101E /* StartChatScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartChatScreenViewModelProtocol.swift; sourceTree = ""; }; @@ -2501,6 +2502,7 @@ F4469F6AE311BDC439B3A5EC /* UserSessionMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSessionMock.swift; sourceTree = ""; }; F4548A9BDE5CB3AB864BCA9F /* EffectsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EffectsView.swift; sourceTree = ""; }; F506C6ADB1E1DA6638078E11 /* UITests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + F51D674A5B5F1FE1B878E20F /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Localizable.strings; sourceTree = ""; }; F5311C989EC15B4C2D699025 /* StaticLocationScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StaticLocationScreenViewModel.swift; sourceTree = ""; }; F57C8022B8A871A1DCD1750A /* UserIndicatorToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIndicatorToastView.swift; sourceTree = ""; }; F5D1BAA90F3A073D91B4F16B /* RoomNotificationSettingsProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomNotificationSettingsProxyMock.swift; sourceTree = ""; }; @@ -6273,6 +6275,7 @@ id, it, ka, + nb, nl, pl, pt, @@ -7804,6 +7807,7 @@ 475D47D0BFE961B02BAC5D49 /* id */, 6FC5015B9634698BDB8701AF /* it */, D1896F6288D80E1F3EFB3DF8 /* ka */, + 7720ACAC6155AB7F9C70B546 /* nb */, 2AE83A3DD63BCFBB956FE5CB /* nl */, 4C8D988E82A8DFA13BE46F7C /* pl */, 8166F121C79C7B62BF01D508 /* pt */, @@ -7839,6 +7843,7 @@ EF98A02DED04075F7CF0C721 /* id */, 7B04BD3874D736127A8156B8 /* it */, 4629710C0337ADD9C8909542 /* ka */, + F51D674A5B5F1FE1B878E20F /* nb */, CDE3F3911FF7CC639BDE5844 /* nl */, 8140010A796DB2C7977B6643 /* pl */, 0CB569EAA5017B5B23970655 /* pt */, @@ -8500,7 +8505,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 25.01.27; + version = 25.01.31; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 00efa6ad1..0fca1e893 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -149,8 +149,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/element-hq/matrix-rust-components-swift", "state" : { - "revision" : "58ce51362ec8b01279a5090f9d7d8c1de4b5b0f3", - "version" : "25.1.27" + "revision" : "13f08bafc7a48e5a30c1e1df624229f58643bedc", + "version" : "25.1.31" } }, { diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index b5908100d..7e5613da3 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -19242,7 +19242,6 @@ open class SyncServiceSDKMock: MatrixRustSDK.SyncService, @unchecked Sendable { //MARK: - stop - open var stopThrowableError: Error? var stopUnderlyingCallsCount = 0 open var stopCallsCount: Int { get { @@ -19270,14 +19269,11 @@ open class SyncServiceSDKMock: MatrixRustSDK.SyncService, @unchecked Sendable { open var stopCalled: Bool { return stopCallsCount > 0 } - open var stopClosure: (() async throws -> Void)? + open var stopClosure: (() async -> Void)? - open override func stop() async throws { - if let error = stopThrowableError { - throw error - } + open override func stop() async { stopCallsCount += 1 - try await stopClosure?() + await stopClosure?() } } open class SyncServiceBuilderSDKMock: MatrixRustSDK.SyncServiceBuilder, @unchecked Sendable { diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index 276f41309..e31e0bdfc 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -861,6 +861,9 @@ class ClientProxy: ClientProxyProtocol { break case .error: restartSync() + case .offline: + // This needs to be enabled in the client builder first to be actually used + break } }) } diff --git a/project.yml b/project.yml index 87d061907..318e49139 100644 --- a/project.yml +++ b/project.yml @@ -61,7 +61,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/element-hq/matrix-rust-components-swift - exactVersion: 25.01.27 + exactVersion: 25.01.31 # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios