Comment 18 for bug 556829

Revision history for this message
In , Bienvenu (bienvenu) wrote :

(In reply to comment #17)
> (From update of attachment 435225 [details])
> Although this obviously avoids removing the wrong folder, it doesn't actually
> stop multiple attempts to check for status, and in fact would make it harder to
> retrofit such a check.

It does, by preventing duplicates from getting added to the array of folders to stat.

>
> >+ // if we get an error running the url, it's better
> >+ // not to chain the next url.
> >+ if (NS_FAILED(exitCode))
> >+ break;
> What about the remaining folders?

An error at this point is generally something that's not recoverable, e.g., the server is down, or we're shutting down. The remaining folders will still be in the array, so if we do STAT again, we'll get them on the next biff round.

>
> >+ nsCOMPtr<nsIMsgImapMailFolder> folder = m_foldersToStat[folderCount - 1];
> >+ m_foldersToStat.RemoveObjectAt(folderCount - 1);
> >+ folder->UpdateStatus(this, nsnull);
> Is UpdateStatus not always async?

It is. I've changed m_foldersToStat to mean the folders still remaining to stat. Once we've started statting a folder, it is removed from the array.

>
> >- if (imapFolder && !isServer)
> >+ if (imapFolder && !isServer &&
> >+ m_foldersToStat.IndexOfObject(imapFolder) == -1)
> Nit: IndexOfObject is really slow because it QIs the argument and each member
> to nsISupports first. If you don't need that just use IndexOf instead.

OK, that's good to fix.