getNumNewMessages() doesn't return 0 after OnItemBoolPropertyChanged NewMessages becomes false

UNCONFIRMED
Unassigned

Status

Thunderbird
Folder and Message Lists
UNCONFIRMED
5 years ago
10 months ago

People

(Reporter: foudfou, Unassigned)

Tracking

10 Branch
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0
Build ID: 20120131115129

Steps to reproduce:

Components.utils.import("resource:///modules/mailServices.js");

var MyExt = {
  init: function() {
    let that = this;
    MailServices.mailSession.AddFolderListener(that.mailSessionListener,
                                               that.mailSessionListener.notificationFlags);
  },

  mailSessionListener: {
    notificationFlags:
      Ci.nsIFolderListener.intPropertyChanged |
      Ci.nsIFolderListener.boolPropertyChanged,

    OnItemIntPropertyChanged: function(item, property, oldValue, newValue) { // TotalUnreadMessages, BiffState (per server)
      LOG("OnItemIntPropertyChanged "+property+" for folder "+item.prettyName+" was "+oldValue+" became "+newValue+" NEW MESSAGES="+item.getNumNewMessages(true));
    },

    OnItemBoolPropertyChanged: function(item, property, oldValue, newValue) { // NewMessages (per folder)
      LOG("OnItemBoolPropertyChanged "+property+" for folder "+item.prettyName+" was "+oldValue+" became "+newValue+" NEW MESSAGES="+item.getNumNewMessages(true));
    },
  }

}

1. Send yourself a message to a Gmail account
2. select the Inbox folder (remains marked as including new messages - yellow flash ball on the icon). This produces:
"OnItemBoolPropertyChanged NewMessages for folder Inbox was false became true NEW MESSAGES=1" (OK)
3. leave the Inbox folder by selecting another folder. This produces:
"OnItemBoolPropertyChanged NewMessages for folder Inbox was true became false NEW MESSAGES=1" (NOT OK)

This is on a Linux Fedora 16.


Actual results:

item.getNumNewMessages(true) returns 1 (or more) after "NewMessages" has become false.


Expected results:

item.getNumNewMessages(true) should return 0.
(Reporter)

Comment 1

5 years ago
On a Zimbra Imap server (6.0), getNumNewMessages() gives unpredictable results:

OnItemBoolPropertyChanged NewMessages for folder Inbox was false became true NEW MESSAGES=0 (although there was only 1 new message displayed in the UI)
OnItemBoolPropertyChanged NewMessages for folder Inbox was false became true NEW MESSAGES=14
(although there was only 1 new message displayed in the UI)
You need to log in before you can comment on or make changes to this bug.