From 7cf88a16bd8a3a8f94fd79ec9b4c10b0ee84977e Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:55:49 +0100 Subject: [PATCH] Update sdk to 1.0.78 (#3586) * updated sdk * added cases * correct error tracking * right error label --- ElementX.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- .../FlowCoordinators/UserSessionFlowCoordinator.swift | 4 ++++ .../View/TimelineItemViews/EncryptedRoomTimelineView.swift | 4 +++- .../Items/Other/EncryptedRoomTimelineItem.swift | 2 ++ .../Timeline/TimelineItems/RoomTimelineItemFactory.swift | 6 ++++++ project.yml | 2 +- 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index d947f07296..5aca45881f 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -8239,7 +8239,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 1.0.77; + version = 1.0.78; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6b6570ef8c..a71d510964 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" : "4e01a9482cfefae4f06c6f3a5a33d21a2bf73d84", - "version" : "1.0.77" + "revision" : "b4705d95bd049f1c7d93cff38e2c2ac2d892f23d", + "version" : "1.0.78" } }, { diff --git a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift index d73e0b3467..acd4cc44e0 100644 --- a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift @@ -395,6 +395,10 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol { analytics.trackError(context: nil, domain: .E2EE, name: .ExpectedDueToMembership, timeToDecryptMillis: timeToDecryptMs) case .historicalMessage: analytics.trackError(context: nil, domain: .E2EE, name: .HistoricalMessage, timeToDecryptMillis: timeToDecryptMs) + case .withheldForUnverifiedOrInsecureDevice: + analytics.trackError(context: nil, domain: .E2EE, name: .RoomKeysWithheldForUnverifiedDevice, timeToDecryptMillis: timeToDecryptMs) + case .withheldBySender: + analytics.trackError(context: nil, domain: .E2EE, name: .OlmKeysNotSentError, timeToDecryptMillis: timeToDecryptMs) } } .store(in: &cancellables) diff --git a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/EncryptedRoomTimelineView.swift b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/EncryptedRoomTimelineView.swift index ff43aedda4..11b33132e9 100644 --- a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/EncryptedRoomTimelineView.swift +++ b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/EncryptedRoomTimelineView.swift @@ -20,7 +20,9 @@ struct EncryptedRoomTimelineView: View { case .sentBeforeWeJoined, .historicalMessage, .verificationViolation, - .insecureDevice: + .insecureDevice, + .witheldBySender, + .withheldForUnverifiedOrInsecureDevice: return \.block } default: diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/EncryptedRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/EncryptedRoomTimelineItem.swift index f6d5e7e0d5..6f417c903a 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/EncryptedRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Other/EncryptedRoomTimelineItem.swift @@ -20,6 +20,8 @@ struct EncryptedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable { case insecureDevice case unknown case historicalMessage + case witheldBySender + case withheldForUnverifiedOrInsecureDevice } let id: TimelineItemIdentifier diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift index a101af8781..2008de03a9 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift @@ -156,6 +156,12 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol { case .historicalMessage: encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .historicalMessage) errorLabel = L10n.timelineDecryptionFailureHistoricalEventNoKeyBackup + case .withheldForUnverifiedOrInsecureDevice: + encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .withheldForUnverifiedOrInsecureDevice) + errorLabel = L10n.timelineDecryptionFailureWithheldUnverified + case .withheldBySender: + encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .witheldBySender) + errorLabel = L10n.timelineDecryptionFailureUnableToDecrypt } case .olmV1Curve25519AesSha2(let senderKey): encryptionType = .olmV1Curve25519AesSha2(senderKey: senderKey) diff --git a/project.yml b/project.yml index 8db73a0c50..ee51c241d0 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: 1.0.77 + exactVersion: 1.0.78 # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios