Closed Bug 1720947 Opened 4 years ago Closed 3 years ago

NewMailNotification is not seeing new mails sometimes.

Categories

(Thunderbird :: General, defect)

Thunderbird 91
defect

Tracking

(thunderbird_esr78 wontfix, thunderbird_esr91+ fixed, thunderbird92 fixed)

RESOLVED FIXED
93 Branch
Tracking Status
thunderbird_esr78 --- wontfix
thunderbird_esr91 + fixed
thunderbird92 --- fixed

People

(Reporter: TbSync, Assigned: TbSync)

Details

Attachments

(1 file)

While working on bug 1716051, I found this:

https://searchfox.org/comm-central/rev/c2dae586a341861ce8b97e8de35e5444f747aad0/mailnews/base/src/MailNotificationManager.jsm#210-213

    let folders = changedFolder.descendants;
    if (folders.length == 0) {
      folders = [changedFolder];
    }

This causes changedFolder itself to be ignored, if it has descendants. The effect is, that if I get a OnItemIntPropertyChanged notification for the BiffState or NewMailReceived property for my actual INBOX folder (which happen to have subfolders) -> I get no new mail notification.

I do not know what defines which folder is triggering this (sometimes the root folder, sometimes the INBOX folder), but in the second case, I get no notifications.

For the WebExt API I use

    let folders = changedFolder.descendants;
    folders.unshift(changedFolder);

Should we fix that here as well?

(If this doesn't affect v78 please change fields)

Severity: -- → S3
Version: unspecified → 78

The file "MailNotificationManager.jsm" does not exist in TB78, so a fix for TB91/92 cannot be backported, so lets make this just about TB91/Tb92.

Version: 78 → Thunderbird 91

I guess the triage owner has to confirm this, before I can send the patch for review?

The patch looks good to me. Problem only happens when Inbox has sub-folders, right?

Yes, and never on first received mail, but on second or third. I have not understood, why sometimes the root folder is triggering the event, and sometimes the inbox folder. If it is the inbox folder, no notification.

The backend code is https://searchfox.org/comm-central/rev/564bad8f71edcd07e7f2493d4317e752f78de9a9/mailnews/base/src/nsMsgDBFolder.cpp#4135-4136

When the biff state of a folder changes, the event is emitted from the root folder. For the second/third new messages, biff state doesn't change, so the event is from the real folder itself. I don't know why it's designed like this though.

Perfect, that completely explains the behavior I see and everybody should be able to reproduce this bug.

(In reply to John Bieling (:TbSync) from comment #4)

I guess the triage owner has to confirm this, before I can send the patch for review?

You can always submit a patch independent of the bug status.

Assignee: nobody → john
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9231655 - Attachment description: WIP: Bug 1720947 - Fix new mail notification. → WIP: Bug 1720947 - Fix new mail notification. r=mkmelin
Attachment #9231655 - Attachment description: WIP: Bug 1720947 - Fix new mail notification. r=mkmelin → Bug 1720947 - Fix new mail notification. r=mkmelin

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/5529ef349700
Fix new mail notification. r=mkmelin

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

Time for uplift requests?

Flags: needinfo?(john)

Comment on attachment 9231655 [details]
Bug 1720947 - Fix new mail notification. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Missing email notifications in some edge cases.

Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky):
None.

Flags: needinfo?(john)
Attachment #9231655 - Flags: approval-comm-beta?

Comment on attachment 9231655 [details]
Bug 1720947 - Fix new mail notification. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9231655 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9231655 [details]
Bug 1720947 - Fix new mail notification. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Missing email notifications in some edge cases.

Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky):
None.

Attachment #9231655 - Flags: approval-comm-esr91?

Comment on attachment 9231655 [details]
Bug 1720947 - Fix new mail notification. r=mkmelin

[Triage Comment]
Approved for esr91

Attachment #9231655 - Flags: approval-comm-esr91? → approval-comm-esr91+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: