Fix a bug where the room state wouldn't indicate when a call was in progress. (#3442)

* Fix breaking changes on decryption errors and sending failures.

* Update SDK and analytics events.

* Add extra UTD strings.

---------

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
This commit is contained in:
Doug
2024-10-24 12:54:52 +01:00
committed by GitHub
parent 665bdd191f
commit cb4d68a756
16 changed files with 108 additions and 81 deletions
@@ -83,18 +83,19 @@ class EventTimelineItemProxy {
}
switch localSendState {
case .sendingFailed(_, let isRecoverable):
return isRecoverable ? .sending : .sendingFailed(.unknown)
case .sendingFailed(let error, let isRecoverable):
switch error {
case .identityViolations(let users):
return .sendingFailed(.verifiedUser(.changedIdentity(users: users)))
case .insecureDevices(let userDeviceMap):
return .sendingFailed(.verifiedUser(.hasUnsignedDevice(devices: userDeviceMap)))
default:
return .sendingFailed(.unknown)
}
case .notSentYet:
return .sending
case .sent:
return .sent
case .verifiedUserHasUnsignedDevice(devices: let devices):
return .sendingFailed(.verifiedUser(.hasUnsignedDevice(devices: devices)))
case .verifiedUserChangedIdentity(users: let users):
return .sendingFailed(.verifiedUser(.changedIdentity(users: users)))
case .crossSigningNotSetup, .sendingFromUnverifiedDevice:
return .sendingFailed(.unknown)
}
}()
@@ -15,7 +15,9 @@ struct EncryptedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable {
}
enum UTDCause: Hashable {
case membership
case sentBeforeWeJoined
case verificationViolation
case insecureDevice
case unknown
}
@@ -157,8 +157,14 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
case .unknown:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .unknown)
errorLabel = L10n.commonWaitingForDecryptionKey
case .membership:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .membership)
case .verificationViolation:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .verificationViolation)
errorLabel = L10n.commonUnableToDecryptVerificationViolation
case .unsignedDevice, .unknownDevice:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .insecureDevice)
errorLabel = L10n.commonUnableToDecryptInsecureDevice
case .sentBeforeWeJoined:
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .sentBeforeWeJoined)
errorLabel = L10n.commonUnableToDecryptNoAccess
}
case .olmV1Curve25519AesSha2(let senderKey):