thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)

Home Page:https://thunderbird.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ANR when using custom tabs in OAuth flow

LingEmberMaple opened this issue · comments

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 version

6.900

Where did you get the app from?

F-Droid

Android version

14

Device model

Redmi K40S

Steps to reproduce

  1. First open K-9 Mail
  2. Click “Start”
  3. Enter email and click “Next”
  4. Click “Next” or “Sign in”

Expected behavior

APP continue running

Actual behavior

ANR

Logs

15_05-23-41-18_676.zip
crash-com-fsck-k9-15_05-23-40-50_459.zip

ANR when:

  1. First open K-9 Mail
  2. Click “Start”
  3. Click “Back”
  4. Repeat 2 and 3 several times

16_05-08-24-51_813.zip
crash-com-fsck-k9-16_05-08-24-37_980.zip

This seems to be related to custom tabs that are used for the OAuth sign-in flow. It looks like communication with the custom tabs service takes longer than 5 seconds. Are you doing anything to deliberately slow down such communication?

The OAuth library seems to be using the recommended way of doing this.

This issue does occasionally show up in ANRs reported via Google Play. But it's not very common (9 affected users in the last 60 days). Given that, we can't really justify spending more time on this.

Of course, pull requests to fix the problem are welcome (although this probably needs to be fixed in AppAuth-Android).

Thank you for the response.

I am not doing anything to deliberately slow down such communication.

It is strange that it started to have issues after I updated to HyperOS based on Android 14, but there were no problems on MIUI based on Android 13 before the update.

I will try again after the next system update.

Found a temporary solution:
Set the battery saver setting for the browser that K-9 Mail use the custom tab feature to “No restrictions”.

When you have installed a browser that supports the custom tab feature, whether or not this browser is set as the default browser, K-9 Mail will use the custom tab feature of this browser when adding an email account. However, due to unknown system reasons, setting the battery saver setting of this type of browser to “Battery saver” can cause K-9 Mail to ANR.