Skip to content

Commit

Permalink
Merge pull request #93 from matrix-org/valere/utd_historical_reason
Browse files Browse the repository at this point in the history
Add new E2E error for expected UTD
  • Loading branch information
BillCarsonFr authored Mar 26, 2024
2 parents 446c42e + 9e1c84b commit 77b059c
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 25 deletions.
23 changes: 12 additions & 11 deletions schemas/Error.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
},
"name": {
"type": "string",
"enum": [
"UnknownError",
"OlmIndexError",
"OlmKeysNotSentError",
"OlmUnspecifiedError",
"VoipUserHangup",
"VoipIceFailed",
"VoipInviteTimeout",
"VoipIceTimeout",
"VoipUserMediaFailed",
"ToDeviceFailedToDecrypt"
"oneOf": [
{"const": "OlmIndexError", "description": "E2EE domain error. The room key is known but is ratcheted (index > 0)."},
{"const": "OlmKeysNotSentError", "description": "E2EE domain error. Generic unknown inbound group session error."},
{"const": "OlmUnspecifiedError", "description": "E2EE domain error. Any other decryption error (missing field, format errors...)."},
{"const": "UnknownError", "description": "E2EE domain error. Decryption failed due to unknown error."},
{"const": "HistoricalMessage", "description": "E2EE domain error. Decryption failed for a message sent before the device logged in, and key backup is not enabled."},
{"const": "VoipUserHangup", "description": "VOIP domain error. The user hung up the call."},
{"const": "VoipIceFailed", "description": "VOIP domain error. ICE negotiation failed."},
{"const": "VoipInviteTimeout", "description": "VOIP domain error. The call invite timed out."},
{"const": "VoipIceTimeout", "description": "VOIP domain error. ICE negotiation timed out."},
{"const": "VoipUserMediaFailed", "description": "VOIP domain error. The user's media failed to start."},
{"const": "ToDeviceFailedToDecrypt", "description": "TO_DEVICE domain error. The to-device message failed to decrypt."}
]
},
"context": {
Expand Down
15 changes: 1 addition & 14 deletions types/kotlin/Error.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data class Error (

val domain: Domain,
val eventName: EventName,
val name: Name,
val name: String,

/**
* UTDs can be permanent or temporary. If temporary, this field will contain the time it
Expand All @@ -39,16 +39,3 @@ enum class Domain {
enum class EventName {
Error
}

enum class Name {
OlmIndexError,
OlmKeysNotSentError,
OlmUnspecifiedError,
ToDeviceFailedToDecrypt,
UnknownError,
VoipIceFailed,
VoipIceTimeout,
VoipInviteTimeout,
VoipUserHangup,
VoipUserMediaFailed
}
48 changes: 48 additions & 0 deletions types/kotlin2/Error.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,63 @@ data class Error(
}

enum class Name {

/**
* E2EE domain error. Decryption failed for a message sent before the
* device logged in, and key backup is not enabled.
*/
HistoricalMessage,

/**
* E2EE domain error. The room key is known but is ratcheted (index >
* 0).
*/
OlmIndexError,

/**
* E2EE domain error. Generic unknown inbound group session error.
*/
OlmKeysNotSentError,

/**
* E2EE domain error. Any other decryption error (missing field, format
* errors...).
*/
OlmUnspecifiedError,

/**
* TO_DEVICE domain error. The to-device message failed to decrypt.
*/
ToDeviceFailedToDecrypt,

/**
* E2EE domain error. Decryption failed due to unknown error.
*/
UnknownError,

/**
* VOIP domain error. ICE negotiation failed.
*/
VoipIceFailed,

/**
* VOIP domain error. ICE negotiation timed out.
*/
VoipIceTimeout,

/**
* VOIP domain error. The call invite timed out.
*/
VoipInviteTimeout,

/**
* VOIP domain error. The user hung up the call.
*/
VoipUserHangup,

/**
* VOIP domain error. The user's media failed to start.
*/
VoipUserMediaFailed,
}

Expand Down
12 changes: 12 additions & 0 deletions types/swift/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,27 @@ extension AnalyticsEvent {
}

public enum Name: String {
/// E2EE domain error. Decryption failed for a message sent before the device logged in, and key backup is not enabled.
case HistoricalMessage
/// E2EE domain error. The room key is known but is ratcheted (index > 0).
case OlmIndexError
/// E2EE domain error. Generic unknown inbound group session error.
case OlmKeysNotSentError
/// E2EE domain error. Any other decryption error (missing field, format errors...).
case OlmUnspecifiedError
/// TO_DEVICE domain error. The to-device message failed to decrypt.
case ToDeviceFailedToDecrypt
/// E2EE domain error. Decryption failed due to unknown error.
case UnknownError
/// VOIP domain error. ICE negotiation failed.
case VoipIceFailed
/// VOIP domain error. ICE negotiation timed out.
case VoipIceTimeout
/// VOIP domain error. The call invite timed out.
case VoipInviteTimeout
/// VOIP domain error. The user hung up the call.
case VoipUserHangup
/// VOIP domain error. The user's media failed to start.
case VoipUserMediaFailed
}

Expand Down

0 comments on commit 77b059c

Please sign in to comment.