The default bug view has changed. See this FAQ.

JS error when closing the Thunderbird main window in a removeObserver call in search.xml

RESOLVED FIXED in Thunderbird 16.0


5 years ago
5 years ago


(Reporter: florian, Assigned: florian)


(Blocks: 1 bug)

Thunderbird 16.0
Dependency tree / graph

Thunderbird Tracking Flags

(thunderbird15 fixed)



(1 attachment)



5 years ago
Created attachment 630504 [details] [diff] [review]

JavaScript error: , line 0: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIObserverService.removeObserver]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://messenger/content/search.xml ::  :: line 156"  data: no]

We currently have more than one search field in the UI (there's one on the 3 pane mail tab, one on the chat tab, and an additional one per open search tab), we have this error when closing the window once for each search field that wasn't the one of the 3 pane mail tab.

It seems the code causing this error was added in bug 515803 to workaround bug 83635 which is now fixed.

Reverting the changes from bug 515803 lets each search box have its own observer, so that removing it doesn't fail when the destructor is called (as it now seems to be called reliably! :)).

However, when selecting a proposed completion from the autocomplete popup, each observer receives the notification and opens a gloda search tab, which is undesirable. I've added a check on the value of aSubject in the observe method to prevent this.

(CC'ing davida who fixed bug 515803, so that he can tell me if I misunderstood the situation.)
Attachment #630504 - Flags: review?(mconley)


5 years ago
Duplicate of this bug: 740495
Comment on attachment 630504 [details] [diff] [review]

Review of attachment 630504 [details] [diff] [review]:

This looks good to me, fixes the issue, and doesn't appear to re-open bug 515803.
Attachment #630504 - Flags: review?(mconley) → review+

Comment 3

5 years ago
Assignee: nobody → florian
Last Resolved: 5 years ago
Resolution: --- → FIXED
Summary: JS error when closing the Thunderbird main window in a removeObserver in search.xml → JS error when closing the Thunderbird main window in a removeObserver call in search.xml
Target Milestone: --- → Thunderbird 16.0

Comment 4

5 years ago
Comment on attachment 630504 [details] [diff] [review]

[Approval Request Comment]
I would like us to take this on aurora, but it's mostly a cleanup patch, I don't think anything was visibly broken.
Attachment #630504 - Flags: approval-comm-aurora?
Attachment #630504 - Flags: approval-comm-aurora? → approval-comm-aurora+

Comment 5

5 years ago
status-thunderbird15: --- → fixed
You need to log in before you can comment on or make changes to this bug.