GetMsgFolderFromUri broken in Nightly

Axel Grude axel.grude at gmail.com
Tue Sep 3 21:08:23 UTC 2013


50 seems like a lot, but in the light of having a year time, I think there should be 
some plublicity around this; as regards the imminent release of Tb 24 we should 
probably reach out to the addon authors about the changes around nsIArray.

http://mozilla.6506.n7.nabble.com/Bunch-of-API-changes-on-trunk-break-many-add-ons-td266896.html

nsIMsgAccountManager.accounts is a prominent example that will break when iterated if 
you're not on the ball as an Addon author and modernize your code. *If somebody from 
the mail dev team could create an official "breakage" page for Tb24 *I would be happy 
to contribute the necessary code snippets for staying back-and forward compatible.

Unfortunately there is still a mentality to hold on to old versions of Tb because 
users are afraid of their Addons breaking; best to reach out to the developers and 
showcase what might break, and then show how easy it is to fix:

   let acctMgr = Components.classes["@mozilla.org/messenger/account-manager;1"]
	                        .getService(Ci.nsIMsgAccountManager);
   let accounts = acctMgr.accounts;
   let iAccounts = (typeof accounts.Count === 'undefined') ? accounts.length : accounts.Count();
   for (var i = 0; i < iAccounts; i++) {
     let account = accounts.queryElementAt ?
       accounts.queryElementAt(i, Ci.nsIMsgAccount) :
       accounts.GetElementAt(i).QueryInterface(Ci.nsIMsgAccount);
       
   }
       


Axel


-- 
*Axel Grude <mailto:axel.grude at gmail.com>*
Software Developer
Thunderbird Add-ons Developer (QuickFolders, quickFilters, QuickPasswords, Zombie 
Keys, SmartTemplate4)
AMO Editor

*To:* tb-planning at mozilla.org - tb-planning
*From: *Mark Banner <mbanner at mozilla.com>
*Sent: *Tuesday, 03/09/2013 18:01:40 18:01 GMT ST +0100 [Week 36]
*Subject:* Re: GetMsgFolderFromUri broken in Nightly
--------------------------------------------------------------------------------------
> I think there's a balance to be had in keeping around many "wrapper" functions just 
> for compatibility versus tidying up and providing clean APIs. I think we've 
> generally paid quite a high price in having global functions and variables hanging 
> around for everyone to use, versus object based functionality.
>
> If there was a better obsolesence way for these functions, then maybe it would be 
> different.
>
> In this case personally I'm not too concerned. The change only affects from gecko 26 
> onwards, which gives add-on authors the best part of a year to update.
>
> If it had been going into 24, then maybe I'd be agreeing with keeping it a bit longer.
>
> Mark.
>
> On 03/09/2013 17:52, Kent James wrote:
>> A quick search showed 50 addons that use GetMsgFolderFromUri
>>
>> I really don't understand that value of code churn like this that breaks addons. 
>> Can't we add a simple utility function that implements GetMsgFolderFromUri, but 
>> references MailUtils?
>>
>> Kent James
>>
>> On 9/2/2013 3:05 PM, Axel Grude wrote:
>>> done & attached some bpoilerplate code for Addon authors. Can somebody who has the 
>>> link search dxr how many addons are affected?
>>>
>>> Axel
>>> -- 
>>> *Axel Grude <mailto:axel.grude at gmail.com>*
>>> Software Developer
>>> Thunderbird Add-ons Developer (QuickFolders, quickFilters, QuickPasswords, Zombie 
>>> Keys, SmartTemplate4)
>>> AMO Editor
>>>
>>> *To:* axel.grude at gmail.com - Axel
>>> *From: *ace <acelists at atlas.sk>
>>> *CC: *tb-planning at mozilla.org tb-planning at mozilla.org
>>> *Sent: *Montag, 02/09/2013 22:39:15 22:39 GMT ST +0100 [Week 36]
>>> *Subject:* Re: GetMsgFolderFromUri broken in Nightly
>>> --------------------------------------------------------------------------------------
>>>> -------- Original Message --------
>>>> Subject: GetMsgFolderFromUri broken in Nightly
>>>> From: Axel Grude (Axel)<axel.grude at gmail.com>
>>>> To:tb-planning at mozilla.org  <tb-planning at mozilla.org>
>>>> Date: Mon, 02 Sep 2013 11:04:47 +0100
>>>>
>>>>> Is there a plan to remove GetMsgFolderFromUri (or more other global
>>>>> macros like this) ?
>>>>>
>>>>> It breaks QuickFolders according to:
>>>>>
>>>>> https://www.mozdev.org/bugs/show_bug.cgi?id=25536
>>>>>
>>>>> just reproduced the error with the message:
>>>>>
>>>>> ReferenceError: GetMsgFolderFromUri is not defined
>>>>>
>>>>> hope this is not the caser, but if it is there should be an alternative
>>>>> method provided for this, as I can imagine it breaking quite a lot of
>>>>> Addons.
>>>> See Bug 889022 . Please mark the bug addon-compat.
>>>>
>>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> tb-planning mailing list
>>> tb-planning at mozilla.org
>>> https://mail.mozilla.org/listinfo/tb-planning
>>
>>
>>
>> _______________________________________________
>> tb-planning mailing list
>> tb-planning at mozilla.org
>> https://mail.mozilla.org/listinfo/tb-planning
>
>
>
> _______________________________________________
> tb-planning mailing list
> tb-planning at mozilla.org
> https://mail.mozilla.org/listinfo/tb-planning


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/tb-planning/attachments/20130903/3d98aee3/attachment.html>


More information about the tb-planning mailing list