thunderbird / thunderbird-android

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

[Regression] Crash on screen rotation when composing email #8606

Open xandro0777 opened 3 days ago

xandro0777 commented 3 days ago

Checklist

App

Thunderbird for Android

App version

8.1

Where did you get the app from?

F-Droid

Android version

13

Device model

Realme

Steps to reproduce

  1. In unified mailbox, start composing an email
  2. Enter a valid To address
  3. Rotate device 90° counterclockwise
  4. Rotate device back to normal position
  5. Crash, composed email is gone without trace

Sometimes, instead of crashing the draft disappears and the App returns to unified mailbox

Expected behavior

Don't crash

Actual behavior

Crash or composed email lost without trace

Logs

No response

xandro0777 commented 3 days ago

k9mail-logs.txt

xandro0777 commented 3 days ago

Did not happen on any previously installed versions

xandro0777 commented 3 days ago

No trace of the email in the drafts folder no matter how long I have been composing it.

kewisch commented 3 days ago

This looks like https://play.google.com/console/u/0/developers/8696262544613553264/app/4975953188383066626/vitals/crashes/2a699b05ac02e9bc21e271535ff9e2a7/details?days=28&versionCode=5&isUserPerceived=true , thank you for providing STR. @cketti could you take a look?

cketti commented 3 days ago

I'm not able to reproduce this crash with the given information.

@xandro0777: Can you provide more details? What email address do you enter in step 2? Where's the cursor when you rotate the device? Can you record a video of such a crash?

xandro0777 commented 3 days ago

On November 26, 2024 12:35:07 PM UTC, cketti @.***> wrote:

I'm not able to reproduce this crash with the given information.

@xandro0777: Can you provide more details? What email address do you enter in step 2?

Many Emails chosen from popup after entering two or more chars. However, this wont be the most important detail, the crash happened also after composing subject and a longer text, with or without images. I gave above description as a minimal description that caused trouble but in real life it always happened after a while when composing the body

Somewhere in the forums I read a similar report, also with stacktrace and it was also Android 13. Maybe something specific about Android 13 but it did work reliably for a very long time.

Where's the cursor when you rotate the device? Can you record a video of such a crash?

Probably irrelevant but mostly at the last line of the email body I was just composing.

xandro0777 commented 3 days ago

This could be related https://forum.k9mail.app/t/crash-when-rotating-device-while-composing/10666

cketti commented 3 days ago

From the data we have via Google Play this crash does not seem to be limited to Android 13. However, it isn't reported nearly enough for this to happen on every device rotation when composing a message (which explains my trouble reproducing the crash).

In order to fix the crash, we need to be able to reproduce it on one of our test devices or an emulator. So someone needs to provide instructions on how to reliably reproduce this crash. Please don't make any assumptions about what information is or isn't relevant. Include as much detail as possible. A video could be useful because it shows the user interaction as it happened without omitting any seemingly unimportant details.

xandro0777 commented 3 days ago

Just tried: reply to this GitHub message, rotate left 90°, rotate back 90°.

K9Mail didn't crash but the email to be composed disappeared.. so entering the address apparently isn't the culprit.

Description can't get simpler. Tried Gboard and OpenBoard both with similar results but maybe the keyboard used may be important?

Also there might be some underreporting because sometimes the App completely crashes, sometimes only the composed message disappears.

xandro0777 commented 3 days ago

Trying the previously mentioned reply and rotate a few times I got these results: once App crashed immediately after the device was rotated 90° counterclockwise - the screen was not rotated at all.

A few times the App didn't crash but after the device was rotated back and forth 90° (and screen and keyboard rotated) the draft was gone.

xandro0777 commented 3 days ago

To be more precise, sometimes I get a popup saying K9Mail has stopped .. wait or close but if that happens whatever I do the App disappears. It seems to be unresponsive for a while until this popup appears but once the popup appears the app disappears no matter what I do.

Tried to reproduce many more times. Sometimes it just works as expected a few times in a row, sometimes it crashes a few times in a row and sometimes the draft simply disappears.

Absolutely no idea which circumstances could trigger the difference

On November 26, 2024 1:04:11 PM UTC, cketti @.***> wrote:

From the data we have via Google Play this crash does not seem to be limited to Android 13. However, it isn't reported nearly enough for this to happen on every device rotation when composing a message (which explains my trouble reproducing the crash).

In order to fix the crash, we need to be able to reproduce it on one of our test devices or an emulator. So someone needs to provide instructions on how to reliably reproduce this crash. Please don't make any assumptions about what information is or isn't relevant. Include as much detail as possible. A video could be useful because it shows the user interaction as it happened without omitting any seemingly unimportant details.

-- Reply to this email directly or view it on GitHub: https://github.com/thunderbird/thunderbird-android/issues/8606#issuecomment-2500750434 You are receiving this because you were mentioned.

Message ID: @.***>

xandro0777 commented 2 days ago

Would sending more stack traces help?

cketti commented 2 days ago

More stack traces are unlikely to help. The stack trace we have shows that none of our code is directly involved in the crash. It's most likely a bug in Android that Thunderbird for Android is triggering. However, without knowing what triggers the bug we don't know how to work around it. Similarly, without knowing how to trigger the bug, Google will have a hard time fixing the bug in Android.

xandro0777 commented 2 days ago

Can I do anything with adb?

The forum entry I mentioned previously says something about v 8.0b3 iirc. What did change there on the k9 side? Or probably a little earlier..

It worked rock solid for several years.

xandro0777 commented 2 days ago

There has been more than a couple of Android bugs relating to screen rotation. The last one in Android 11 was triggered only in presence of keyboard interaction and I suspect keyboard interaction in this case too

xandro0777 commented 2 days ago

Previously mentioned keyboard interaction hypothesis checked:

  1. Go to Github message
  2. Tap reply
  3. Pop down keyboard
  4. Rotate
  5. Crash

I guess yet another nice theory proven wrong?

On November 27, 2024 2:31:39 PM UTC, cketti @.***> wrote:

More stack traces are unlikely to help. The stack trace we have shows that none of our code is directly involved in the crash. It's most likely a bug in Android that Thunderbird for Android is triggering. However, without knowing what triggers the bug we don't know how to work around it. Similarly, without knowing how to trigger the bug, Google will have a hard time fixing the bug in Android.

-- Reply to this email directly or view it on GitHub: https://github.com/thunderbird/thunderbird-android/issues/8606#issuecomment-2504027960 You are receiving this because you were mentioned.

Message ID: @.***>