Closed
Bug 949297
Opened 11 years ago
Closed 11 years ago
Errors when unloading registered widgets that reside in toolbars
Categories
(Firefox :: Toolbars and Customization, defect)
Firefox
Toolbars and Customization
Tracking
()
VERIFIED
FIXED
Firefox 30
People
(Reporter: irakli, Assigned: Gijs)
References
(Blocks 1 open bug)
Details
(Whiteboard: [Australis:P3])
Attachments
(1 file)
|
1.96 KB,
patch
|
jaws
:
review+
Sylvestre
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Here is the simplified test case that can be run in the scratchpad with browser
context: https://gist.github.com/Gozala/7923065
Running it causes error to be logged in browser console:
[CustomizableUI]" "Widget not found, unable to remove" CustomizableUI.jsm:149
Calling `load()` again seems to work fine in this case, but I'm afraid it does not
in an actual code which is more complicated one, don't actually know why.
| Reporter | ||
Comment 1•11 years ago
|
||
I figured out why my widget was not placed back to the toolbar, that's because widget ID in my case
is generated each time which I guess confuses CUI. Here is an adjusted test case that illustrates that
https://gist.github.com/Gozala/7923403
First load is fine, unload logs error reported earlier, load again no longer places widget in the toolbar
but rather into pallet, which I don't think is an expected behavior.
| Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Irakli Gozalishvili [:irakli] [:gozala] [@gozala] from comment #1)
> I figured out why my widget was not placed back to the toolbar, that's
> because widget ID in my case
> is generated each time which I guess confuses CUI. Here is an adjusted test
> case that illustrates that
> https://gist.github.com/Gozala/7923403
>
> First load is fine, unload logs error reported earlier, load again no longer
> places widget in the toolbar
> but rather into pallet, which I don't think is an expected behavior.
IDs are basically like DOM IDs but global across multiple Firefox windows and even sessions. They should not change.
I suspect this is a dupe of bug 948985, which seems to also have been mentioned on IRC.
OS: Mac OS X → All
Hardware: x86 → All
Version: 26 Branch → Trunk
| Assignee | ||
Updated•11 years ago
|
Blocks: australis-cust, australis-addons
| Assignee | ||
Comment 3•11 years ago
|
||
Can you still reproduce this now that bug 948985 is fixed?
Flags: needinfo?(rFobic)
| Reporter | ||
Comment 4•11 years ago
|
||
Yes issues is still reproducible with a code snippet attached on the latest nightly. I would also
encourage incorporating that snippet into CUI tests.
Flags: needinfo?(rFobic)
| Assignee | ||
Updated•11 years ago
|
Whiteboard: [Australis:P3]
Updated•11 years ago
|
Summary: Errors when unloading registered widgets that leave in toolbars → Errors when unloading registered widgets that reside in toolbars
| Assignee | ||
Comment 5•11 years ago
|
||
(In reply to Irakli Gozalishvili [:irakli] [:gozala] [@gozala] from comment #0)
> Here is the simplified test case that can be run in the scratchpad with
> browser
> context: https://gist.github.com/Gozala/7923065
>
> Running it causes error to be logged in browser console:
> [CustomizableUI]" "Widget not found, unable to remove" CustomizableUI.jsm:149
So I looked at the testcase. I don't understand what the issue is here? The error is Cu.reported, there's no actual exception involved, and no code breaks because of this - it's meant to be an informative message: you tried to remove something, and that something no longer existed. It happens because you destroyWidget'd the widget and then the area is destroyed and so its items are removed. The physical items can't be removed because you destroyWidget'd them first, so they're gone. We could try and catch this case and not log a message, but that seems like a waste of effort that might hide legitimate problematic cases.
Flags: needinfo?(rFobic)
| Reporter | ||
Comment 6•11 years ago
|
||
I believe it's logged as error and AMO reviewers have pretty strict policies in regards to errors logged
in the console. Maybe changing phrasing and loglevel of the message would be good enough fix for this.
Please note that problem is there's no other way to destroy both widget and toolbar right now without
causing this error to be logged, which makes it makes it pretty unpleasant API to use.
Another option would be to allow `CUI.unregisterArea(id, {ignoreMissing: true})` that would swallow those
warnings (which won't be a default).
Flags: needinfo?(rFobic)
| Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Irakli Gozalishvili [:irakli] [:gozala] [@gozala] from comment #6)
> I believe it's logged as error and AMO reviewers have pretty strict policies
> in regards to errors logged
> in the console. Maybe changing phrasing and loglevel of the message would be
> good enough fix for this.
>
> Please note that problem is there's no other way to destroy both widget and
> toolbar right now without
> causing this error to be logged
CUI.removeWidgetFromArea(widgetId);
CUI.destroyWidget(widgetId);
CUI.unregisterArea(toolbarId);
Note that then the placement of the widget isn't saved. Does that matter for your usecase?
| Assignee | ||
Comment 8•11 years ago
|
||
(In reply to :Gijs Kruitbosch from comment #7)
> (In reply to Irakli Gozalishvili [:irakli] [:gozala] [@gozala] from comment
> #6)
> > I believe it's logged as error and AMO reviewers have pretty strict policies
> > in regards to errors logged
> > in the console. Maybe changing phrasing and loglevel of the message would be
> > good enough fix for this.
> >
> > Please note that problem is there's no other way to destroy both widget and
> > toolbar right now without
> > causing this error to be logged
>
> CUI.removeWidgetFromArea(widgetId);
> CUI.destroyWidget(widgetId);
> CUI.unregisterArea(toolbarId);
>
> Note that then the placement of the widget isn't saved. Does that matter for
> your usecase?
Flags: needinfo?(rFobic)
| Reporter | ||
Comment 9•11 years ago
|
||
(In reply to :Gijs Kruitbosch from comment #7)
> (In reply to Irakli Gozalishvili [:irakli] [:gozala] [@gozala] from comment
> #6)
> > I believe it's logged as error and AMO reviewers have pretty strict policies
> > in regards to errors logged
> > in the console. Maybe changing phrasing and loglevel of the message would be
> > good enough fix for this.
> >
> > Please note that problem is there's no other way to destroy both widget and
> > toolbar right now without
> > causing this error to be logged
>
> CUI.removeWidgetFromArea(widgetId);
> CUI.destroyWidget(widgetId);
> CUI.unregisterArea(toolbarId);
>
> Note that then the placement of the widget isn't saved. Does that matter for
> your usecase?
That is exactly why we don't `CUI.removeWidgetFromArea(widgetId)`
Flags: needinfo?(rFobic)
| Assignee | ||
Comment 10•11 years ago
|
||
Attachment #8376206 -
Flags: review?(jaws)
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Updated•11 years ago
|
Attachment #8376206 -
Flags: review?(jaws) → review+
| Assignee | ||
Comment 11•11 years ago
|
||
Whiteboard: [Australis:P3] → [Australis:P3][fixed-in-fx-team]
| Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 8376206 [details] [diff] [review]
adjust warning message severity for Australis customizableUI widget removals,
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Australis
User impact if declined: none, but add-on author/AMO reviewer impact of spurious log messages in some cases
Testing completed (on m-c, etc.): local
Risk to taking this patch (and alternatives if risky): none
String or IDL/UUID changes made by this patch: none
Attachment #8376206 -
Flags: approval-mozilla-aurora?
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [Australis:P3][fixed-in-fx-team] → [Australis:P3]
Target Milestone: --- → Firefox 30
Updated•11 years ago
|
Attachment #8376206 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
| Assignee | ||
Comment 14•11 years ago
|
||
status-firefox29:
--- → fixed
status-firefox30:
--- → fixed
Updated•11 years ago
|
Updated•11 years ago
|
QA Contact: cornel.ionce
Comment 15•11 years ago
|
||
I was able to confirm the fix for this issue on the latest Nightly (Build ID: 20140310030201) and latest Aurora (Build ID: 20140310004003), using reporter's testcase under:
- Windows 7 64-bit [1],
- Mac OS X 10.9.1 [2],
- Ubuntu 13.10 64-bit [3].
1. Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
2. Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0
3. Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0
You need to log in
before you can comment on or make changes to this bug.
Description
•