-
-
Notifications
You must be signed in to change notification settings - Fork 585
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 decryption error codes to base.DecryptionError #663
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise looks fine
src/crypto/algorithms/megolm.js
Outdated
@@ -639,6 +642,7 @@ MegolmDecryption.prototype.decryptEvent = async function(event) { | |||
this._requestKeysForEvent(event); | |||
} | |||
throw new base.DecryptionError( | |||
"OLM_UNKNOWN_MESSAGE_INDEX", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is not necessarily OLM_UNKNOWN_MESSAGE_INDEX
here, or at least there is a conditional above that checks for it so I would assume not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IRL, me and @lampholder discussed. We don't especially care about all of the errors thrown by decryptGroupMessage
(all of which are plain old Error
) so I'll just rename this to OLM_GROUP_MESSAGE_ERROR
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I changed my mind, we can still emit OLM_UNKNOWN_MESSAGE_INDEX)
These should roughly follow https://github.com/matrix-org/matrix-ios-sdk/blob/9732cf593206a10d2b60cd01151a759c88c1e9a2/MatrixSDK/Crypto/Algorithms/MXDecryptionResult.h#L21-L39