thunderbird / thunderbird/thunderbird-android

Set the new unread email system notifications timestamps to match the email metadata's date and time from the IMAP server, instead of the time of notification emission

Open
#7,200 0 comments 3 reactions 0 assignees View on GitHub

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 version

6.602

Where did you get the app from?

F-Droid

Android version

LineageOS 16.0 (Android 9)

Device model

Any

Steps to reproduce
  1. Configure IMAP folder "A" (ex: the inbox) and folder "B" to be 1st class / to emit notifications on new messages
  2. In K-9 mail, go to folder "A", swipe the sidebar open to see the list of folders
  3. In another email client elsewhere (i.e. a desktop email client, or webmail interface), mark one old email from folder A as unread, and move that email to folder B
  4. In K-9, pull down the folders list to force a refresh (or wait for it to eventually periodically poll all folders by itself, but that would take longer)

Note: While this scenario might seem uncommon, this is actually also pretty close to how things might happen with email filters sometimes, depending on timing (for instance, I have some email filters that cannot be handled server-side, so they are handled client-side by my desktop email client, so there is some delay).

Alternate scenario / alternate way to reproduce:

  1. Leave your phone disconnected, powered off or in "Airplane mode" for a while
  2. Arrange for some new emails to come in to your email account
  3. Reconnect your phone, and see K-9's notifications come in... probably with the wrong timestamps
Expected behavior

Notify about the "new" unread mail, but set the notification's timestamp to the email's "received" timestamp, not the time at which the notification is emitted. This will keep them in chronological order and will help me go through them by priority.

Actual behavior

New/unread email notifications are emitted to Android system notifications "with the current timestamp at the time at which the notification was created / when the check was done", instead of using the email's "date/time received" timestamp from the server.

So in practice, I might get 30 email notifications timestamped as "Now", in disorder, most of which do not actually require my attention, instead of the notifications reflecting the time at which the emails were received by the IMAP server.

Logs

Here are some screenshots showing the mismatched notification timestamp using the 2nd method (airplane mode while an email gets received by the server, then reconnecting K-9).

First, notice the timestamp of the received mail (12h52) vs the current time (12h56):

Screenshot_20230926-125659_K-9_Mail notification timestamp mismatch (crop pix)

...then, notice the timestamp of the notification ("Now", i.e. 12h56):

Screenshot_20230926-125643_K-9_Mail notification timestamp mismatch (crop pix)


Is this actually possible?

It would seem so; in comparison, some other Android mail clients (like FairEmail) are able to correctly set the notification timestamp in the past.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Android system notification emission path and how the IMAP message's received date is exposed when folders are refreshed. Reproduce the airplane-mode or moved-message scenario, then verify that notifications use the email metadata timestamp and remain chronologically ordered.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.