Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new E2E error for expected UTD #93

Merged
merged 4 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this going to break any existing code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kotlin is not used, the apps are using kotlin2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so can we get rid of kotlin altogether? Maybe a followup task.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#94

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
Loading