Closed Bug 1126350 Opened 9 years ago Closed 9 years ago

Keep destroying the toolbox even if a panel fails

Categories

(DevTools :: Framework, defect)

defect
Not set
normal

Tracking

(firefox38 fixed)

RESOLVED FIXED
Firefox 38
Tracking Status
firefox38 --- fixed

People

(Reporter: jryans, Assigned: jryans)

Details

Attachments

(1 file, 1 obsolete file)

While investigating bug 1118974, I noticed that the toolbox destruction path will abort early if any one of the panels fails.

We should rewrite this to continue destruction of all panels and the toolbox, even if one part fails, and should just log a message when there is an error.
Assignee: nobody → jryans
Status: NEW → ASSIGNED
Attached file MozReview Request: bz://1126350/jryans (obsolete) —
/r/3177 - Bug 1126350 - Settle all toolbox destruction before final cleanup. r=pbrosset

Pull down this commit:

hg pull review -r c1d921d17fb59f805ff179f26eac7e7a4e20839d
Attachment #8557255 - Flags: review?(pbrosset)
Comment on attachment 8557255 [details]
MozReview Request: bz://1126350/jryans

https://reviewboard.mozilla.org/r/3175/#review2657

Ship It!

::: toolkit/devtools/DevToolsUtils.js
(Diff revision 1)
> + * This differs from Promise.all, which will reject immediately after the first

I was surprised this was the case, but yeah, it does look like we need a helper to wait for all promises to resolve or reject.

::: toolkit/devtools/DevToolsUtils.js
(Diff revision 1)
> +  return new Promise((resolve, reject) => {

I'm all for using DOM promises, but have only seen promise.jsm promises in our code so far (also there's a require("promise") in this file).
What's our approach here? Slowly start to insert DOM promises step by step, or use promise.jsm only and then do a big-bang migration?
Attachment #8557255 - Flags: review?(pbrosset) → review+
Comment on attachment 8557255 [details]
MozReview Request: bz://1126350/jryans

https://reviewboard.mozilla.org/r/3175/#review2659

Ship It!
Attachment #8557255 - Flags: review+
https://reviewboard.mozilla.org/r/3175/#review2675

> I'm all for using DOM promises, but have only seen promise.jsm promises in our code so far (also there's a require("promise") in this file).
> What's our approach here? Slowly start to insert DOM promises step by step, or use promise.jsm only and then do a big-bang migration?

There are a few [usages][1] already, but mostly in tests.

Personally, it seems fine to me to make use of them piecemeal, but it's mostly a style point I would think.  I'll email the list to ask the team about it.

In this case, it appeared because I copied Promise.jsm's implemtation of |all| as a starting point, which itself uses this DOM promise.

[1]: https://dxr.mozilla.org/mozilla-central/search?q=%22new%20Promise%22%20path%3Adevtools&case=true&=mozilla-central
(In reply to J. Ryan Stinnett [:jryans] from comment #5)
> Personally, it seems fine to me to make use of them piecemeal, but it's
> mostly a style point I would think.  I'll email the list to ask the team
> about it.

Consensus was the team prefers Promise.jsm for now because of the extra debugging features.  I'll switch to that.
https://hg.mozilla.org/mozilla-central/rev/c70ba1f08a7f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 38
Attachment #8557255 - Attachment is obsolete: true
Attachment #8619226 - Flags: review+
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: