aFolder is undefined - in folderWidgets.xml

VERIFIED FIXED in Thunderbird 13.0

Status

Thunderbird
Folder and Message Lists
VERIFIED FIXED
6 years ago
5 years ago

People

(Reporter: Mitra Ardron, Assigned: aceman)

Tracking

({testcase})

8 Branch
Thunderbird 13.0
testcase

Thunderbird Tracking Flags

(thunderbird8-)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20100101 Firefox/5.0
Build ID: 20110615151330

Steps to reproduce:

No idea what I did, but I see multiple errors 

Error: aFolder is undefined
Source File: chrome://messenger/content/folderWidgets.xml
Line: 691

I'm not seeing broken functionality except with Spotlight searcing which seems unrelated -

I'm running nightlies of Miramar 5.0b2pre (this new bugzilla interface doesn't seem to allow that to be input anywhere :-(
(Reporter)

Updated

6 years ago
OS: Other → Mac OS X
Hardware: All → PowerPC
Do you also have it if you start in -safe-mode ? (And I'm assuming you aren't running powerpc, right ?)
Status: UNCONFIRMED → NEW
Component: General → Folder and Message Lists
Ever confirmed: true
QA Contact: general → folders-message-lists
Hardware: PowerPC → All
(Reporter)

Comment 2

6 years ago
Its intermitent anyway - for example I restarted about 15 mins ago, and don't see it in the Error Console currently. If/when I can figure out what is causing the Error I can restart in -safe-mode (presuming I can figure out how to do that :-) and try and repeat.

Comment 3

6 years ago
Hi,
I have also it undeder windows seven (thunderbird 6)

Erreur : aFolder is undefined
Fichier Source : chrome://messenger/content/folderWidgets.xml
Ligne : 691
I also have this error on Thunderbird 7.1 on XP.
I also have this error on Thunderbird 7.1 on XP.

Error: aFolder is undefined
Source File: chrome://messenger/content/folderWidgets.xml
Line: 691
Still confirmed on Thunderbird 8.0b1 and it looks kind of ugly for a release. Don't you want to fix this bug? :-)
Version: 5.0 → 8
Well getting a testcase or something would help.
tracking-thunderbird8: --- → ?
Keywords: testcase-wanted
Not tracking unless there's visible side effects of this.
tracking-thunderbird8: ? → -
(Assignee)

Comment 9

6 years ago
I can also see this on Linux, TB7/8. It happens for example when a filter is moving a message. I get the error message for each moved message (not each tested). The filter is simple "subject-contains-word,move_to_folder-X".
Mitra, isn't this a regression??
(Assignee)

Comment 11

6 years ago
But I must say I forgot to enable safe mode, will check that later.
(Assignee)

Comment 12

6 years ago
Reproduced in safe mode too. It happens only when going into Message filters and clicking Run Now (the filter from comment 9 pre-selected).
Can anybody confirm?
(Reporter)

Comment 13

6 years ago
A regression - not quite sure what you mean? Error console always has lots of errors so i don't track it, it may have gone away and come back, or it might always have been there.  The error message could be a LOT more descriptive of what causes it, but I guess its hard since its buried in a function and looks like its the caller that causes the error. 

? I just tried manually running a filter with a "Move" and had the same error show up.  

Good thing now, is that it was intermittent for me, but @aceman has found a repeatable case.

Comment 14

6 years ago
"Not tracking unless there's visible side effects of this."

I first started looking in the error console for problems, and found this error and related bug, because I was having cases where, after I clicked on a folder, an empty view came up, or nothing seemed to change. I would be curious if others have experienced this as well.
(Assignee)

Comment 15

6 years ago
I can still see it on the testcase from comment 9 on TB11, linux. However, the Error console seems to be temporarily broken, it doesn't show the filename, just line number (still the same as in TB8).
Keywords: testcase-wanted → testcase
OS: Mac OS X → All
(Assignee)

Comment 16

6 years ago
I have instrumented the callers of _setCssSelectors and have found something.
When copying messages in a filter, the error does not appear for every message, but only for some of them (on my test sample, it is always 3 times even when slightly changing filter condition). But when it happens I could track down the caller to this spot:
folderWidgets.xml:
        OnItemIntPropertyChanged: function(aItem, aProperty, aOld, aNew) {
          var child = this._getChildForItem(aItem);
          if (child) {
            this._menu._setCssSelectors(child._folder, child); }
        },

Here, child._folder is undefined. aItem.name contains the name of the folder into which the messages are copied.

When not running filters, the error comes up just when a folder is selected by mouse. Then, aItem.name contains the name of this folder.

I have not seen any other place calling the function with the first argument set to "undefined".

Can anybody continue from here?

Comment 17

6 years ago
I don't understand how those functions work, or ever worked. Note they were changed recently (4/2011) by bienvenu in bug 370324.

child = _getChildForItem claims it returns a menuitem, but actually returns aItem which is an nsIMsgFolder. So child._folder makes no sense. But surely I must be confused about something?
(Assignee)

Comment 18

6 years ago
May they be called when the number of unread messages in a folder increases?
We have a user new to thunderbird seeing this for both manual and automatic filter
 Error: aFolder is undefined
 Source File: chrome://messenger/content/folderWidgets.xml
 Line: 691 
for a filter of an imap inbox with filter condition
  from contains xxxx
and action
  move to yyy on same imap account

Is it worth testing whether it does not fail if the target folder is not imap?
I could see the error consistently by "copy of a mail via context menu".
(0) Create new profile by Tb 9.1.0,
    define a dummy POP3 account and a dummy IMAP account.
    ("Local Folders" only is perhaps sufficient) 
(1) Restart Tb 9.0.1, open Error Console.
Following error is always seen.
> Error: no element found
> Source File: https://testpilot.mozillalabs.com/testcases/index-tb.json
> Line: 1
(2) Select folder A of Local Folders, select a mail,
    at Context menu of the mail, Copy To, select folder B of Local Folders.
    => Two next error is shown in Error Console.
> Error: aFolder is undefined
> Source File: chrome://messenger/content/folderWidgets.xml
> Line: 691
(3) Once this error occurs, this error always occurs when "move mail by Drag&Drop"(3 errors), "copy mail by Ctrl+Drag&Drop"(2 errors), "copy/move mail via Context menu"(3 errors), "Delete mail in local mail folder"(2 errors), "Run Filters on Folder with action=MoveToFolder, action=Delete" and so on.
(Assignee)

Comment 21

6 years ago
WADA, were you able to see any problems caused by this? Any function not working after this error appears?
(In reply to :aceman from comment #21)
> WADA, were you able to see any problems caused by this? Any function not
> working after this error appears?

I didn't see "function not working after this error" in test. I only experienced annoyance of "once this error occurs, this error always occurs when specfic operations until restart of Tb".  

In bug 713380, a typo was found in msgHdrViewOverlay.js. See bug 713380 comment #13. This may be relevant.
> fix typo in msgHdrViewOverlay.js
> -      return this.mProperties[property];
> +      return this.mProperties[aProperty];
I did same test as comment #20 with same profile used in the test.
(1) trunk 20120114 build. patch of bug 713380 is not checked in yet.
> Mozilla/5.0 (Windows NT 5.1; rv:12.0a1) Gecko/20120114 Thunderbird/12.0a1
Problem was reproduced.
(2) trunk 20120119 build. patch of bug 713380 is checked in on 1/17.
> Mozilla/5.0 (Windows NT 5.1; rv:12.0a1) Gecko/20120119 Thunderbird/12.0a1
Problem was not reproduced.

The typo was perhaps one of main culprits.
(Assignee)

Comment 24

6 years ago
Pity there is no checking of existence of identifiers in JS (as in C). It will break only when the code is actually reached at runtime.
Test result in comment #23 was wrong. Test procedure was diffirent from original and I didn't check with "Copy To". Following error is still occurs when "Copy To" is executed. Sorry for wrong report.
> Mozilla/5.0 (Windows NT 5.1; rv:12.0a1) Gecko/20120119 Thunderbird/12.0a1
> Timestamp: 2012/01/21 17:36:53
> Error: aFolder is undefined
> Source File: chrome://messenger/content/folderWidgets.xml
> Line: 691
(Assignee)

Comment 26

6 years ago
I wonder why that <method name="_setCssSelectors"> in folderWidgets.xml doesn't use getSpecialFolderString(aFolder) from folderUtils.jsm. Looks like duplicated code.
(Assignee)

Comment 27

6 years ago
(Filed bug 727851 for that.)

I can also consistently reproduce this error on TB13 when copying a message from a normal folder to a special one (like Junk) in Local Folders.
(Assignee)

Comment 28

6 years ago
Created attachment 597951 [details] [diff] [review]
patch experiment

(In reply to Kent James (:rkent) from comment #17)
> child = _getChildForItem claims it returns a menuitem, but actually returns
> aItem which is an nsIMsgFolder. So child._folder makes no sense. But surely
> I must be confused about something?

Thanks for the hint! So I changed the _getChildForItem to really return the menuitem, so that ._folder can be called on it. Also 'child' was passed as the second argument to _setCssSelectors which should have been a menuitem, but wasn't (it was a aItem=nsIMsgFolder per comment in _getChildForItem). The error message is no more (on the STR I have described).
However if we haven't seen any problems caused by the error, we now can't see if the patch solves anything.

WADA, rkent, can you try the patch if it causes any problems?
Assignee: nobody → acelists
Status: NEW → ASSIGNED
Attachment #597951 - Flags: review?(dbienvenu)
Attachment #597951 - Flags: feedback?(sagarwal)
(Assignee)

Comment 29

6 years ago
I noticed when I alter _setCssSelectors to always set "SpecialFolder" to "none" then it causes special icons of folders (like the flame for Junk) to be lost in the right-click -> Copy To -> folder picker . So that is one place where this function comes into play.

Comment 30

6 years ago
Comment on attachment 597951 [details] [diff] [review]
patch experiment

thx, makes sense, and this also seems to get rid of the error, and things seem to basically still work.
Attachment #597951 - Flags: review?(dbienvenu) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
Attachment #597951 - Flags: feedback?(sagarwal)
Checked in: http://hg.mozilla.org/comm-central/rev/61302b689327
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 13.0
(Assignee)

Updated

6 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.