-
Notifications
You must be signed in to change notification settings - Fork 10
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
don't decrypt attachments before tapping + show modal on error #1233
Comments
Additionally, there is no need to decrypt all attachments when rendering. Decrypt when tapping attachment.
// todo - this is decrypting attachments too early
// there is no need to decrypt attachments when rendering message,
// since user may never tap them.
// Instead decrypt them when actually tapped.
let decrypted = try await core.decryptFile(
encrypted: meta.data,
keys: keys,
msgPwd: nil
)
if let decryptSuccess = decrypted.decryptSuccess {
attachment = MessageAttachment(
name: decryptSuccess.name,
data: decryptSuccess.data
)
} else if let decryptErr = decrypted.decryptErr {
// todo - once above todo is done and we are decrypting
// at the time of tapping an attachment, render error modal
// if user confirms the modal, they can download the original msg
// then can remove the warning
logger.logWarning("attachment could not be decrypted due to error: \(decryptErr.error.type) - \(decryptErr.error.message)")
attachment = MessageAttachment(
name: meta.name,
data: meta.data
)
} else {
throw AppErr.unexpected("decryptFile: expected one of decryptErr, decryptSuccess to be present")
} |
Since we're adding |
This will also need an appium test for the above message. Tapping the message should produce a modal:
Taping yes downloads the original (encrypted) file. Tapping no will hide the modal. |
also mostly fixed #1143. The error was that while the text could be decrypted, the attachments were throwing decrypt errors. I've made it recognize decrypt errors and download the original file, but it needs another issue to actually render the decrypt error before downloading, make sure that's what the user wanted.
Originally posted by @tomholub in #1219 (comment)
The text was updated successfully, but these errors were encountered: