Closed Bug 2036354 Opened 3 months ago Closed 1 month ago

IMAP biff fires repeated new-mail notifications after sleep/wake every ~10s, including e-mails already read on another device

Categories

(MailNews Core :: Networking: IMAP, defect)

Thunderbird 152
Desktop
Windows 11
defect

Tracking

(thunderbird152 fixed)

VERIFIED FIXED
152 Branch
Tracking Status
thunderbird152 --- fixed

People

(Reporter: maxe, Assigned: maxe)

References

Details

Attachments

(1 file)

Steps to reproduce:

  • Have an IMAP account configured on a Windows 11 machine with notifications enabled, IMAP IDLE supported by the server used
  • Let the machine go to sleep
  • Receive some new e-mails while asleep
  • Read some of them on a different device, e.g. Thunderbird for Android
  • Wake the machine

Expected results:

  • Only one notification bubble/sound gets fired if there are any still unread new e-mails.

Actual results:

  • Repeated notification bubbles/sounds every ~10s including e-mails that were already read on another device.
See Also: → 1937212
See Also: → 885220
See Also: → 1123617

We have a pretty minimal patch shape now, it does what I want it to do, but I can't fathom on how to test it.

Assignee: nobody → mozilla
See Also: → 2011619

(In reply to Magnus Melin [:mkmelin] from comment #3)

For testing, this might be of help: https://searchfox.org/comm-central/source/mailnews/base/test/unit/test_newMailNotification.js

Well, the existing Try run proves that the patch does not break any existing tests, but for properly testing it, there are quite a few missing puzzle pieces such as simulating IMAP idle with a reconnect and modifying the read-state in the meantime. Not even the NOOP is functional, just stubbed out and does not ever produce any EXISTS reply we need to hit the changed codepath.

I request a review as-is based on the code and Phabricator comments.

Attachment #9575909 - Attachment description: WIP: Bug 2036354 - Fix repeated IMAP new-mail notifications after wake from sleep. r=#thunderbird-back-end-reviewers → Bug 2036354 - Fix repeated IMAP new-mail notifications after wake from sleep. r=#thunderbird-back-end-reviewers

We could/should also gate the number of push notifications with sound per minute and set a maximum age of e-mails to i.e. one hour to avoid biff for old e-mails, but that is a design decision and not a logic bug per se.

Attachment #9575909 - Attachment description: Bug 2036354 - Fix repeated IMAP new-mail notifications after wake from sleep. r=#thunderbird-back-end-reviewers → Bug 2036354 - Skip IMAP biff without a fresh server UNSEEN count. r=#thunderbird-back-end-reviewers
Status: NEW → ASSIGNED

Pushed by toby@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/1944f6133817
Skip IMAP biff without a fresh server UNSEEN count. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED

I just observed the same symptom again on the latest Daily, but I am still confident that it is much rarer now.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Server logs show four IMAP sessions likely racing each other and the repeated biffs, partially about already read messages, were the result of not waiting till its finished.

I still believe in the correctness of the previous fix, but as we all know, improving IMAP without missing edge cases or even causing regressions is a huge undertaking.

May I suggest to close this ticked and file a follow-up? This landed in 152, so there won't be more landings here.

Status: REOPENED → RESOLVED
Closed: 3 months ago1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch

Sorry for verifying my own bug, new harness, new extensive repro work. Does what it is supposed to, overbiff without, correct amount of biff after, no regression.

Status: RESOLVED → VERIFIED
Blocks: 2055434

Thanks for the fix - this biff activity has been crazy.

If this is an issue older than v152, I'm guessing this will have had duplicate bug reports - has that been checked?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: