Last Comment Bug 727460 - getNumNewMessages() doesn't return 0 after OnItemBoolPropertyChanged NewMessages becomes false
: getNumNewMessages() doesn't return 0 after OnItemBoolPropertyChanged NewMessa...
Status: UNCONFIRMED
:
Product: Thunderbird
Classification: Client Software
Component: Folder and Message Lists (show other bugs)
: 10 Branch
: x86 Linux
: -- normal with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-15 08:02 PST by foudfou
Modified: 2012-04-10 12:11 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description foudfou 2012-02-15 08:02:05 PST
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.
Comment 1 foudfou 2012-02-15 08:14:23 PST
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)

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