Skip to content

Commit

Permalink
Update error code for withheld keys (#108)
Browse files Browse the repository at this point in the history
We only actually want a separate error when the error is "m.unverified"
  • Loading branch information
richvdh committed Jul 8, 2024
1 parent 27e74d7 commit 2aac92f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ data class Error(
OlmUnspecifiedError("OlmUnspecifiedError"),

/**
* E2EE domain error. The sender withheld the keys for this message.
* E2EE domain error. The sender withheld the keys for this message, due
* to the recipient device being unverified.
*/
RoomKeysWithheld("RoomKeysWithheld"),
RoomKeysWithheldForUnverifiedDevice("RoomKeysWithheldForUnverifiedDevice"),

/**
* TO_DEVICE domain error. The to-device message failed to decrypt.
Expand Down
2 changes: 1 addition & 1 deletion schemas/Error.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{"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": "ExpectedDueToMembership", "description": "E2EE domain error. Decryption failed for a message sent before you were in the room (shared history visibility and support for sharing past keys is not available/supported)."},
{"const": "RoomKeysWithheld", "description": "E2EE domain error. The sender withheld the keys for this message."},
{"const": "RoomKeysWithheldForUnverifiedDevice", "description": "E2EE domain error. The sender withheld the keys for this message, due to the recipient device being unverified."},
{"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."},
Expand Down
4 changes: 2 additions & 2 deletions types/swift/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ extension AnalyticsEvent {
case OlmKeysNotSentError = "OlmKeysNotSentError"
/// E2EE domain error. Any other decryption error (missing field, format errors...).
case OlmUnspecifiedError = "OlmUnspecifiedError"
/// E2EE domain error. The sender withheld the keys for this message.
case RoomKeysWithheld = "RoomKeysWithheld"
/// E2EE domain error. The sender withheld the keys for this message, due to the recipient device being unverified.
case RoomKeysWithheldForUnverifiedDevice = "RoomKeysWithheldForUnverifiedDevice"
/// TO_DEVICE domain error. The to-device message failed to decrypt.
case ToDeviceFailedToDecrypt = "ToDeviceFailedToDecrypt"
/// E2EE domain error. Decryption failed due to unknown error.
Expand Down

0 comments on commit 2aac92f

Please sign in to comment.