thunderbird / thunderbird/thunderbird-android
Remote Search very slow against Mailfence
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 14k
- Forks
- 2.8k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 57
Description
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?
Google Play
Android version
14
Device model
Google Pixel 5
Steps to reproduce
I suspect this varies by provider. Search works fine against my Gmail account, for example. This is a specific issue with my account provided by Mailfence. (See: https://mailfence.com/)
I suspect it might also be influenced by the fact that the folder being searched, my Inbox, has 32,000 messages in it.
So:
- Using an account from Mailfence
- With a (very?) large number of messages in the Inbox
- Perform a remote search that should return some number of results.
- Wait for search to time out. (Note that no error message is displayed.)
(Some extra notes: the Mailfence account is IMAP-based, and uses Exchange internally.)
Expected behavior
Search does not time out, and returns results.
(As a minor band-aid, display an error message about what happened is displayed.)
Actual behavior
Search eventually times out with no error.
Some extra info:
I cloned the repository and ran it under a debugger to make sure what I was seeing was, in fact, a time-out. It was! When I bumped up SOCKET_READ_TIMEOUT in NetworkTimeouts.kt up to 600_000 (from 60_000), I was able to start getting results. In my testing, it took around 130 seconds to start seeing results.
In addition, rather than downloading the messages in chunks, it seemed to retrieve them one-by-one, visibly loading quite slowly.
While I'm not well-versed in how IMAP works, I can at least confirm that another Android mail client, AquaMail, has no issues remote-searching against my Mailfence account, and manages to download messages in chunks of 50 (still somewhat slowly, but not two minutes slowly), so I don't think this is only a provider issue.
Logs
I've attached a log of me running in the emulator with my slightly-hacked version that includes my increased timeout.
This is running off the main branch from commit 42f88165d.
I've included as much of the log as Android Studio's logcat preserved (which doesn't seem to be everything starting from boot).
You can see where I ran the remote search if you search for the line 2024-11-20 11:16:54.926 7798-7798 MessagingController net.thunderbird.android.debug I searchRemoteMessages (acct = f8ca14db-2db9-44a3-8dcf-27e8a8ee657a, folderId = 2, query = hsl).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at MessagingController.searchRemoteMessages and inspect the timeout path around NetworkTimeouts.kt, using the attached log to trace the Mailfence search. Reproduce with a Mailfence account and a large Inbox, then verify that remote search returns results or reports its timeout instead of failing silently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100