Skip to content
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

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

Open
2 tasks done
xandro0777 opened this issue Nov 26, 2024 · 24 comments
Open
2 tasks done

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

xandro0777 opened this issue Nov 26, 2024 · 24 comments
Labels
type: bug Something is causing incorrect behavior or errors type: crash Issues that involve fixing a crash or ANR

Comments

@xandro0777
Copy link

Checklist

  • I have used the search function to see if someone else has already submitted the same bug report.
  • I will describe the problem with as much detail as possible.

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 xandro0777 added type: bug Something is causing incorrect behavior or errors unconfirmed Newly reported issues awaiting triage or confirmation labels Nov 26, 2024
@xandro0777
Copy link
Author

k9mail-logs.txt

@xandro0777 xandro0777 changed the title Crash on screen rotation when composing email [Regression] Crash on screen rotation when composing email Nov 26, 2024
@xandro0777
Copy link
Author

Did not happen on any previously installed versions

@xandro0777
Copy link
Author

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

@kewisch kewisch added type: crash Issues that involve fixing a crash or ANR and removed unconfirmed Newly reported issues awaiting triage or confirmation labels Nov 26, 2024
@kewisch
Copy link
Member

kewisch commented Nov 26, 2024

@kewisch kewisch added this to the Thunderbird 9.0 milestone Nov 26, 2024
@cketti
Copy link
Member

cketti commented Nov 26, 2024

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?

@cketti cketti added the status: needs information Needs more information to proceed label Nov 26, 2024
@xandro0777
Copy link
Author

xandro0777 commented Nov 26, 2024 via email

@github-actions github-actions bot added status: answered The issue was answered and is waiting for maintainer review. and removed status: needs information Needs more information to proceed labels Nov 26, 2024
@xandro0777
Copy link
Author

xandro0777 commented Nov 26, 2024 via email

@cketti
Copy link
Member

cketti commented Nov 26, 2024

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.

@cketti cketti added status: needs information Needs more information to proceed and removed status: answered The issue was answered and is waiting for maintainer review. labels Nov 26, 2024
@xandro0777
Copy link
Author

xandro0777 commented Nov 26, 2024 via email

@github-actions github-actions bot added status: answered The issue was answered and is waiting for maintainer review. and removed status: needs information Needs more information to proceed labels Nov 26, 2024
@xandro0777
Copy link
Author

xandro0777 commented Nov 26, 2024 via email

@xandro0777
Copy link
Author

xandro0777 commented Nov 26, 2024 via email

@xandro0777
Copy link
Author

xandro0777 commented Nov 27, 2024 via email

@cketti
Copy link
Member

cketti commented Nov 27, 2024

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
Copy link
Author

xandro0777 commented Nov 27, 2024 via email

@xandro0777
Copy link
Author

xandro0777 commented Nov 27, 2024 via email

@xandro0777
Copy link
Author

xandro0777 commented Nov 27, 2024 via email

@cketti
Copy link
Member

cketti commented Dec 3, 2024

I'm finally able to reproduce this error. It depends on the length of the email address and the available display space.

Steps to reproduce:

  1. Open message compose screen while device is in landscape orientation.
  2. Enter an email address in the "To" field that takes up almost all of the available horizontal space.
  3. Make sure the entered email address is converted into a "chip", e.g. by focusing another input field.
  4. Rotate the device.

I haven't figured out yet what exactly is causing the crash. It might be a combination of us doing uncommon things to render the email address views and a bug in Android.

@cketti cketti removed the status: answered The issue was answered and is waiting for maintainer review. label Dec 3, 2024
@xandro0777
Copy link
Author

xandro0777 commented Dec 3, 2024 via email

@gitrickm
Copy link

I came to report this same bug. I'm running on a Galaxy S23 Ultra, Android 14. The same bug exists in K-9 Mail, but now I've upgraded to Thunderbird.

It fails on all compose actions: new mail, Reply All, edit a Draft. It either goes back to the Inbox, or crashes completely, when you rotate from portrait to landscape and back.

However, this only happens if your recipient list has more than 1 address. This is likely why the bug has existed for so long and doesn't seem to be repeatable. Now you have the missing piece of info! (Oh, I see someone says it also fails if a single recipient address is long.)

@asklc
Copy link

asklc commented Dec 30, 2024

I can confirm this issue on my device:

  • Samsung Galaxy S22 (SM-S901B)
  • Android 14 (Android patch level: Nov. 1, 2024)
  • Thunderbird 8.2
  • Kernel 5.10.223
  • Side note: I am using Hackers Keyboard

TL;DR

Message draft is discarded when going to landscape and back to portrait, but currently only for one specific mail in inbox.

Description

Noticed this behaviour just now and I'm pretty sure not having seen this just months prior. Why I'm sure about this? Since I'm rather pedantic about newlines in emails, when I write on my phone, I tilt it into landscape mode to break all lines to near equal lengths and then send it.

Today I had to answer a mail (just one recipient) and this issue happened to me twice. The first time I believed I had accidentally pressed the back button and discarded my draft. Second time I was extra cautious and after polishing my text I tilted my phone back to portrait mode and was immediatelly brought back to the email I was about to answer to. It seemed as if the intent (not sure if that's the right term, not a mobile dev) for answering to the message was simply closed, no toast message about a discarded message draft as normally. No saved draft in the drafts folder.

I'm using Thunderbird for roughly half a year now and noticed this just now. I'm definetely sure not having noticed this behaviour with K9Mail before, but I'm unable to narrow it down to a specific update or change of Thunderbird in the past (if it's at all a regression in Thunderbird), as I can't recall when was the last time that I typed a somewhat longer text on my phone.

However, it only happens with one specific email in my inbox. I have multiple accounts configured in Thunderbird and it doesn't matter whether I open it from that account's inbox or from within the combined inbox. Drafting always breaks on that particular mail when going to landscape and back to portrait. Plus, it doesn't matter if the cursor is in the message or address/subject fields, end result remains.

Have yet to figure out what's so special about that one email.

@asklc
Copy link

asklc commented Dec 30, 2024

While searching for other emails which trigger the aforementioned behaviour (of which I found two more), I noticed another inconsistency, which might be related to this – or not 🤷🏻‍♂️

Normally, while replying to an email and clicking the back button, you get a toast message saying "message discarded". Then, with some emails (I haven't figured out yet what's special about them), I get an extra modal dialog asking whether I am sure to discard my draft. And then again, yet on some other mails, I get a toast message when hitting back while in portrait mode but get the extra modal when going to landscape and then back into portrait. It's as if some internal state change is triggered when transitioning between screen orientations that causes this erratic notification/confirmation behaviour.

Perhaps on that special set of emails, Thunderbird tries to show the user a modal confirmation dialog when rotating the screen for whatever reason, but it can't, and so it instead bails out with closing the whole intent? Just a wild guess…

@xandro0777
Copy link
Author

xandro0777 commented Jan 1, 2025 via email

@gitrickm
Copy link

gitrickm commented Jan 2, 2025

My previous comment was wrong. It definitely seems to be triggered by the length of the email address. My testing shows 22 characters is OK, 23 or more fail. This is including the entire address: recipient name, "@" symbol, and full domain name.

I'm using a Galaxy S23 Ultra with Android 14.

I definitely had this error using the latest version of K9 before I switched to TB a week or so ago.

@kewisch kewisch marked this as a duplicate of #8699 Jan 2, 2025
@cketti
Copy link
Member

cketti commented Jan 2, 2025

We already have reliable steps to reproduce this crash (see #8606 (comment)).

Please don't add more comments trying to speculate what is causing this. It's not helping, but only adding noise.

However, if you're a developer and know how to track down what exactly is causing the crash and can figure out how it can be avoided, please feel free to investigate this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something is causing incorrect behavior or errors type: crash Issues that involve fixing a crash or ANR
Projects
None yet
Development

No branches or pull requests

5 participants