thunderbird / thunderbird/thunderbird-android
Run a foreground service during mail checks initiated by the user
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 14k
- Forks
- 2.8k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 57
Description
When running periodic mail checks WorkManager makes sure the system knows K-9 Mail is currently doing work in the background and shouldn't be killed.
When the user triggers a folder/account sync in the UI and then closes the Activity the system currently has no way of knowing that K-9 Mail is still doing work in the background and shouldn't be killed. This could lead to the sync being interrupted but the sync notification remaining visible (and animated) until the next sync successfully completes and removes the notification (see #4747).
The easiest way to fix this is to always start a foreground service for user-initiated mail checks. This means always showing the sync notification even when not enabled by the user (we should probably get rid of the setting then).
Right now we show and hide the sync notification for each individual folder. We probably need to change this to start the foreground service once, perform all folder/account syncs currently queued up, and then stop the service.
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 by tracing user-triggered folder/account sync from the UI Activity and compare it with the existing WorkManager periodic mail checks. Inspect how the sync notification is shown and hidden for individual folders. Done means user-initiated checks keep running after the Activity closes, use one foreground service for queued syncs, and stop it when the work finishes.
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