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

RESOLVED FIXED in Thunderbird 16.0

Status

Thunderbird
Search
--
minor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: florian, Assigned: florian)

Tracking

(Blocks: 1 bug)

Trunk
Thunderbird 16.0
Dependency tree / graph

Thunderbird Tracking Flags

(thunderbird15 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

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

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)
(Assignee)

Updated

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

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+
(Assignee)

Comment 3

5 years ago
http://hg.mozilla.org/comm-central/rev/912ceff1e029
Assignee: nobody → florian
Status: NEW → RESOLVED
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
(Assignee)

Comment 4

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

[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+
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/releases/comm-aurora/rev/2247ade5509b
status-thunderbird15: --- → fixed
You need to log in before you can comment on or make changes to this bug.