Open Bug 1248522 Opened 9 years ago Updated 3 years ago

TypeError: gCurrentFolder is null chrome://messenger/content/SearchDialog.js in Error Console.

Categories

(Thunderbird :: Search, defect)

x86
Linux
defect

Tracking

(Not tracked)

People

(Reporter: ishikawa, Unassigned)

Details

Attachments

(4 files)

(Probably on all platforms since the symptom does not seem to very linux-specific) 38.5.1 (and for the last few months: maybe since last October or earlier). I occasionally get the following error in error console of TB under linux. TypeError: gCurrentFolder is null chrome://messenger/content/SearchDialog.js And when this happens, something strange occurs. Acutally, something strange happened a few times and when I looked in the error console each time, I finally figured that there may be co-relation with this error and the strange thing. Strange thing is this: (I thought I filed a bugzilla on this, but could not find it.) The search dialog window for search messages shows something like this. +-----------------+ +------------+ +-------+ |object for search| | predicate | | value | +-----------------+ +------------+ +-------+ in multiple rows as we enter the search conditions. (Object for search is like "Subject", "From", etc. Predicate is such as Includes, etc.) Sometimes (and often enough to irritate me when it happens in the past dozen months or so), the pull down menus to select object for search is vertically collapsed (literally) and cannot be read! Like this: +-----------------+ +------------+ +-------+ +-----------------+ +------------+ +-------+ Very often, the border for value entry is not shown. Like this. +-----------------+ +------------+ +-----------------+ +------------+ Sometimes resetting the search condition restores the normal display. But often it does not. So last fall, I was perplexed by this display issue when I noticed the gCurrentFolder null error in the error console. I had many tabs then, and I did notice that there was no tab which was highlighted. What surprised me then was that as soon as I select, say, the main tab [the first one on the left, the usual tab. I use ordinary three windows layout.], the search window strangeness disappeared. I have no idea how these can be related. But in October, I think, the strange collapse of search dialog pull down menu display was quite well related to this gCurrentFolder null superficially. Every time the strange display happened, and I noticed no tab is highlighted, I select a tab and the strange display issue disappeared. However, before I decided to file a bugzilla, I notice a case where selecting a tab no longer resolves the strange display issue. So probably there is an underlying issue behind this gCurrentFolder null and the strange display issue. Anyway, the gCurrentFolder null error seems to happen rather often to my taste and I am reporting it. TIA
linux 32-bit TB 45.0 The problem still persists with TB45.0 and I just noticed it today after using 45.0 for several days. That somehow gCurrentFolder becomes null is the problem. TIA
In which folder are you located when you start the Search Messages dialog? When I am in a folder, the Search dialog opens with that folder preselected in the "search for messages in..." menu and everything is fine.
(In reply to :aceman from comment #2) > In which folder are you located when you start the Search Messages dialog? > When I am in a folder, the Search dialog opens with that folder preselected > in the "search for messages in..." menu and everything is fine. This is a great question to ask. To be honest, I have no idea. Usually, I notice the issue when I hit search button to search for a particular message and the search menu is messed up as noted above. It seems that "search" code assumes that a folder is preselected always, but this selection gets turned off sometimes (due to cause unknown.)
Which "search button" ?
(In reply to :aceman from comment #4) > Which "search button" ? Sorry, I was not clear enough. It is the menu selection. Edit (in menu bar) -> Find -> Search for message when I select the menu item, I think gCurrentFolder is already nil/null or during the process of opening up the search dialog, it becomes null (?). I have no idea. If our quest for where the gCurrnetFolder becomes null fails, I think TB can arbitrarily selects Inbox folder or something as the search targetand set gCurrentFolder accordingly.
This happened again. I don't think I was doing anything fancy ( IMHO). I just began searching for a message when someone asks me about a document. Then it occurred. The error console DID have the error message at 15:45:17 As a matter of fact, the symptom could not be remedied even if I select a folder (tab) explicitly UNTIL I close the search window and did "edit -> find -> search for message" again. TIA
Why do you have the "aDocumentNode is undefined" in msgHdrViewOverlay.js. Is it a cause or a result of the bug here? Or unrelated?
(In reply to :aceman from comment #7) > Why do you have the "aDocumentNode is undefined" in msgHdrViewOverlay.js. Is > it a cause or a result of the bug here? Or unrelated? I have absolutely no idea. With 45.x series, I see more error messages in error console than in the earlier versions and it is hard to see why they are caused. If there is a single error message of the same type which recurs often, then I am tempted to insert a probe here and there, but right now, there seem to be simply too many of them. One such error is bad enough, but a few of them really make debugging difficult, don't they? TIA
I do not see such errors. Have you tried disabling addons?
Actually, one of the addons or something seems to generate a very awkward security-related messages, and I am trying to debug that at this moment. Once that is over, I can disable all the addons and see if that clears up the problem. *BUT*, I am afraid that I was seeing the issues even when only the standard/suggested addon were installed. TIA
Which are standard/suggested addons? We only ship Lightning bundled, and can watch it that it does not cause problems. We (the core TB devs) do not endorse/recommend any other addons and do not guarantee they are working in TB45.

I am using TB 91.11.0 (64-bit) under Windows 10.

The problem still persists.
I have no repeatable procedure at this moment.

In this particular case, what I was doing was this.
I was searching for a bunch of e-mails based on the originating e-mail address for a year.
Store the condition as search folder.
Repeated this for four years.
Then from the stored search folder, I copied the found messages to an ordinary folder for that year.
(Well, if I can immediately copy all the found messages to a folder from the search dialog, I can skip this process, but I digress.)
Then I found that I needed the same procedure for another year and opened the search box, and then
voila. The search dialog missed the rows where I can type in the search conditions (and add by hitting more/+).
There was nothing I could do.

I am posting the copy of error console in the next message and again, the dubious error message suggests that gCurrentFolder is undefined.

I am using one add-on called RemoveDuplicate. Turning it on and off does not have any issues at this moment. Disabling it and opening the search dialog again does not improve the situation.

Oh wait. if |gCurrentFolder| is not set, maybe I can explicitly open a folder by selecting it and presumably it would set |gCurrentFolder|.
I did so.
OK, now when I go from [EDIT]->[Search]-> [Search for messages]
NOW I GET the proper rows for input. (!!!)

I think we probably want to do something about setting gCurrentFolder forcibly to Inbox or something when the error condition is detected
Otherwise, I think someone who got hit by this symptom probably has to shutdown TB for the day, or even reboot Windows (I see many people do this...)
Probably TB will be OK again as far as this occasional erratic behavior is concerned, but we should avoid such waste of peope's time.

Again I have no idea why }gCurrentFolder| is undefined.
(Maybe someone ought to go through the searchfox to figure out where |gCurrentFolder| is destroyed (or the module that defines it unloaded, etc.)

BTW, I am using Japanese-locale TB under Windows10, but as the previous error (original) report showed it can happen using en_US locale and under linux, too.

The cause seems to be the undefined |gCurrentFolder|.

|gCurrentFolder| is declared and set in searchDialog.js.
https://searchfox.org/comm-central/search?q=gCurrentFolder&path=

Definitions (gCurrentFolder)
	mail/base/content/SearchDialog.js
22	var gCurrentFolder;

...
	
Assignments (gCurrentFolder)
	mail/base/content/SearchDialog.js
330	gCurrentFolder = folder; // found in updateSearchFolderPicker 

So there probably is an execution path that skips the invocation of |updateSearchFolderPicker()|.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: