thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/
Apache License 2.0
10.49k stars 2.49k forks source link

K9 UI error when sending encrypted email with attachment #2462

Open farson2003 opened 7 years ago

farson2003 commented 7 years ago

Expected behavior

  1. Create email in message compose screen, enter recipient, to which encrypted email is to be sent.
  2. Chose attachment of bigger file size, i.e. 5 MB, so that encryption takes some time on the device.
  3. Hit the "send" button.
  4. The message compose screen should close and K9 should work in the background sending the email (this is the actual and correct behaviour when an unencrypted email with a bigger attachment is sent.)

However, when encrypting an email with a bigger attachment, the Actual and incorrect behavior is the following:

Steps to reproduce

  1. Create email in message compose screen, enter recipient, to which encrypted email is to be sent.
  2. Chose attachment of bigger file size, i.e. 5 MB, so that encryption takes some time on the device.
  3. Hit the "send" button.
  4. "Wheel will turn" and K9 together whith Openkeycheyn will encrypt email. However, the message compose screen remains open, which is confusing for the user, because when sending an unencrypted email it ussually closes straight away after hitting send buttonc(see above). The user is therefore inclined to hit the "send button" multiple times to make sure K9 has acknowledged the sending command, which results in the same email to be sent out to the same recipient multiple times. This is confusing.

Solution:

The email compose screen should close immediately after hitting the send button of an encrypted email with a bigger attachment and K9 should process the email in the background, because this is the usual behaviour for unencrypted emails with attachments. Anyways the message compose screen should not allow any buttons to be still pressed to trigger multiple sending processes of the same email.

Environment

K-9 Mail version: 5.206 Openkeychain: 4.2.4 (42400)

Android version: 4.4.2 and others

Account type IMAP

cketti commented 7 years ago

The processing can't happen in the background because encryption might involve user interaction, i.e. they might need to enter their passphrase.

However, allowing multiple button clicks is a bug of course.

farson2003 commented 7 years ago

@cketti Agreed on the last point, however please note that even after all user interaction has finished (i.e. user has entered passphrase), the message compose window still remains open and the problem persists.

In principle once the user has entered correct passphrase the whole remaining encryption and sending process could and ideally should be moved to the background, so that the user can go on with other workflow.

srinivaas-ganesan commented 7 years ago

Hi - I would to work on this. I can think of the following solutions 1) Move the encryption to the background using an async task and return to the previous activity 2) Freeze the send button before beginning encryption 3) Display a message saying "encryption in progress, please wait" which closes only when encryption is complete

Please let me know your thoughts

philipwhiuk commented 7 years ago

Options two and three are reasonable​ and can be done together.

Option 1 is not possible because we can't know whether further user interaction will be required or not - that's up to OpenKeychain.

It would be nice to show a progress bar using feedback from OpenKeychain but we will need to coordinate that with them so they send progress updates.

For now an indeterminate progress spinner is probably fine.