Closed Bug 833292 Opened 11 years ago Closed 11 years ago

TypeError: this.chatbar.removeAll is not a function

Categories

(Firefox Graveyard :: SocialAPI, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: ttaubert, Assigned: markh)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

When running the sessionstore test suite I see a lot of these:

> [Exception... "'TypeError: this.chatbar.removeAll is not a function' when calling method: [nsIRunnable::run]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0"  data: no]
That probably occurs when windows are being opened/close rapidly. One of the SocialChatBar.update callers may be running when not expected.
There were a couple of new errors in combination with PBU.isWindowPrivate() calls to a closed window which are caused by this issue as well. No more errors when running sessionstore tests for me.
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Attachment #715149 - Flags: review?(jAwS)
I don't want to tread on any toes, but I'm attaching an alternative patch that, while bigger, actually cleans up some of the social code.

Currently social uses a callback to Social.init(), and as a result of this, has some complexity to avoid sending observer notifications as part of the init process.  This is the root cause of the problem here - that the callback still fires even after window unloads.

This patch cleans that up.  It removes the Social.init() callback and relies purely on the observer notifications.  This means the hacks to not notify during Social.init() are removed, and seeing all observers are removed during unload, it's impossible for the failing code to run after unload (ie, it also solves the underlying problem here).

It might make sense to split this out into a new bug, but this change has been in the back of my mind for a while and this bug/attachment prompted me to do it as it solves this problem without an explicit "_initialized" member.

Over-requesting feedback as usual :)  Tim:  The originally reported message doesn't appear when running all tests in browser/base/content/test, which looks like where the sessionstore tests are - please correct me if I'm wrong.
Attachment #715269 - Flags: feedback?(mixedpuppy)
Attachment #715269 - Flags: feedback?(jAwS)
Attachment #715269 - Flags: feedback?(gavin.sharp)
(In reply to Mark Hammond (:markh) from comment #3)
> I don't want to tread on any toes, but I'm attaching an alternative patch
> that, while bigger, actually cleans up some of the social code.

Awesome, thanks for stepping in. I don't mind if we throw away my patch, I just want to see this fixed :)

> Over-requesting feedback as usual :)  Tim:  The originally reported message
> doesn't appear when running all tests in browser/base/content/test, which
> looks like where the sessionstore tests are - please correct me if I'm wrong.

The tests are located in browser/components/sessionstore/test/. I'll apply your patch and report back.
Looks good, no errors here.
Comment on attachment 715269 [details] [diff] [review]
Alternative which also cleans up more social code

I like this, especially finally cleaning up the init.  Is this all necessary to fix this bug, or should it be done separately?
Attachment #715269 - Flags: feedback?(mixedpuppy) → feedback+
Attachment #715269 - Flags: feedback?(jAwS) → feedback+
(In reply to Shane Caraveo (:mixedpuppy) from comment #6)

> I like this, especially finally cleaning up the init.  Is this all necessary
> to fix this bug, or should it be done separately?

I'm not sure what you are asking here, but the original patch fixes the bug, so it could be argued this is not strictly necessary to fix it.  However, this is a cleaner way of fixing the bug and the only practical way of doing it without introducing a new "_initialized" state variable.
Assignee: ttaubert → mhammond
OS: Linux → All
Hardware: x86_64 → All
Attachment #715269 - Flags: feedback?(gavin.sharp) → review?(jAwS)
Attachment #715149 - Attachment is obsolete: true
Attachment #715269 - Flags: review?(jAwS) → review+
https://hg.mozilla.org/mozilla-central/rev/3892ce628367
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Depends on: 846075
(In reply to Ryan VanderMeulen [:RyanVM] from comment #9)
> https://hg.mozilla.org/mozilla-central/rev/3892ce628367

This has caused a regression, see bug 847825.
Whiteboard: [qa-]
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: