Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TB15: updateFolder on POP3 Drafts folder no longer generating folder loaded events

34 views
Skip to first unread message

Jonathan Kamens

unread,
Aug 31, 2012, 1:52:10 PM8/31/12
to
In my add-on, I call updateFolder on a drafts folder, and I
have a listener wired to Ci.nsIFolderListener.event with
mailSession.AddFolderListener so that I can do bookkeeping
once the folder is done updating.

In TB14, this does the right thing with both IMAP and POP3
accounts. My event handler gets called shortly after I call
updateFolder on the folder, and I do the needful.

In TB15, my code works for IMAP accounts, but it no longer
works for POP3 accounts -- the event is apparently never
generated for POP3 accounts, so my event handler never gets
called.

Does anyone have any insight into what might have caused this
change in behavior, whether it is intentional or not, how to
work around it, etc.?

Thanks.

Jonathan Kamens

unread,
Aug 31, 2012, 2:38:39 PM8/31/12
to
Figured it out. This change is the culprit:

https://bugzilla.mozilla.org/show_bug.cgi?id=723248
("add support for closing inactive databases (folders)")

The problem is that folders that are unused for 3 seconds or
more are closed. (Really? Is it really necessary to close
folders so quickly? Do they take up that much memory? Doesn't
this impact performance in terms of forcing Thunderbird to
constantly reopen closed folders?)

The code in nsMsgLocalMailFolder::UpdateFolder doesn't
generate a FolderLoaded event if it has to open a closed
folder; it only generates a FolderLoaded event when updating
the database of a folder that was already open.

I think the logic in nsMsgLocalMailFolder::UpdateFolder is
probably wrong, and a FolderLoaded event should be generated
when a folder is opened, not just when it is updated.

In any case, I've figured out a workaround for my add-on
(calling my code directly periodically, rather than relying
on a FolderLoaded event to trigger my code), but of course
it's going to be several weeks before the fix makes its way
through the AMO review process, so I guess in the meantime I
need to go flag my add-on as incompatible with TB15. *sigh*

WBT

unread,
Aug 31, 2012, 3:40:36 PM8/31/12
to Jonathan Kamens, dev-apps-t...@lists.mozilla.org
I have noticed something similar on drafts folders specifically. When I
save a draft, it disappears and is not visible in my Drafts folder, often
for several days after. Account settings are checked and correct re: where
to save a draft, and when viewing the drafts folder I get the "working in
background" busy mouse, but don't often see my new drafts, until all the
new ones show up at once, much later. These are IMAP folders.

Ben
> _______________________________________________
> dev-apps-thunderbird mailing list
> dev-apps-t...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-apps-thunderbird
>

Jonathan Kamens

unread,
Aug 31, 2012, 5:07:19 PM8/31/12
to
WBT <firstpet...@gmail.com> writes:
>I have noticed something similar on drafts folders specifically. When I
>save a draft, it disappears and is not visible in my Drafts folder, often
>for several days after. Account settings are checked and correct re: where
>to save a draft, and when viewing the drafts folder I get the "working in
>background" busy mouse, but don't often see my new drafts, until all the
>new ones show up at once, much later. These are IMAP folders.

This probably means your Drafts folder index is corrupt. Open
its properties and click "Repair Folder".

Alas, there's nothing to say it won't be corrupted again.
There seem to be longstanding bugs lurking in the code which
cause such coruption. They are difficult to reproduce and
therefore difficult to fix.
0 new messages