Closed Bug 943681 Opened 11 years ago Closed 10 years ago

Convert to Promise.jsm in the webconsole

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 29

People

(Reporter: bbenvie, Assigned: bbenvie)

References

Details

Attachments

(1 file, 6 obsolete files)

      No description provided.
Attached patch promise-webconsole.patch (obsolete) — Splinter Review
Converts everything devtools/webconsole to use Promise.jsm. https://tbpl.mozilla.org/?tree=Try&rev=86f6daf585c0
Assignee: nobody → bbenvie
Status: NEW → ASSIGNED
Priority: -- → P2
Attached patch promise-webconsole.patch (obsolete) — Splinter Review
Change the lazy getters to lazy importers.
Attachment #8338944 - Attachment is obsolete: true
Attached patch promise-webconsole.patch (obsolete) — Splinter Review
Woops, I forgot that you can't use lazyImporter here (because of the "Promise" -> "promise" rename). This should work. https://tbpl.mozilla.org/?tree=Try&rev=10bd75c2f9d5
Attachment #8338948 - Attachment is obsolete: true
The lazyImporter() can take a fourth argument which solves the problem you had with it. See XPCU_defineLazyModuleGetter() in js/xpconnect/loader/XPCOMUtils.jsm.

(you can leave it as-is with the lazyGetter, just mentioning that nicety of XPCOMUtils)
I'm fairly sure this is ready to land (and not stirring up some crazy intermittents). I'll get this landed ASAP (with Mihai's feedback).
Is this patch waiting on me for landing? I hope not. Feel free to land it - I don't expect rebase issues with my patches for bug 843004.
I think that bc failure might be permaorange because of this patch. https://tbpl.mozilla.org/?tree=Try&rev=0862711cee75
Attached patch promise-webconsole.patch (obsolete) — Splinter Review
I think this will fix it. https://tbpl.mozilla.org/?tree=Try&rev=3ff4324b4872
Attachment #8339394 - Attachment is obsolete: true
Attachment #8346841 - Flags: review?(mihai.sucan)
Comment on attachment 8346841 [details] [diff] [review]
promise-webconsole.patch

Looks good. Thanks!
Attachment #8346841 - Flags: review?(mihai.sucan) → review+
Sorry, I backed this out:
https://hg.mozilla.org/integration/fx-team/rev/6639771d3626

because of timeouts in browser_toolbox_raise.js:
https://tbpl.mozilla.org/php/getParsedLog.php?id=31950694&tree=Fx-Team

(This was previously an intermittent failure, but it became perma-orange on OS X after this patch.)
Whiteboard: [fixed-in-fx-team]
Sorry for bothering. Brandon, any progress with this patch? Can I help with anything?
Flags: needinfo?(bbenvie)
Thanks Mihai. I don't think there's a problem with the webconsole at all actually. The test (framework/test/browser_toolbox_raise.js) has an intermittent which this patch turns permanently orange on OS X. The test has some fiddly bits relating to window focus which seems to be sensitive to the timing changes. 

Do you have any idea on how to fix the test to not be sensitive to window focus/timing interaction? I think fixing this bug just hinges on that, and not any more changes to the webconsole or anything else.
Flags: needinfo?(bbenvie)
Brandon, maybe try to remove executeSoon() when it is not needed. There are two calls to the function, see if they can be replaced with event listeners (tabselected).

TBPL shows that these failures happen only with Mac OSX. Can you reproduce? According to tbpl, the timeouts occur after the test finished (!). See:

https://tbpl.mozilla.org/php/getParsedLog.php?id=31948868&tree=Fx-Team#error0

12:18:15     INFO -  ###!!! [Child][DispatchAsyncMessage] Error: Route error: message sent to unknown actor ID

This error seems to suggest that cleanup() and finish() are called before the toolbox finishes executing its own code. Try to get out of the execution loop with the infamous executeSoon(cleanup). Also, after you call toolbox.destroy(), maybe executeSoon(finish) would help.

I hope this helps.

(I pinged about this patch simply because exceptions continue to not show in our devtools. Promise.jsm is very useful for development. Thank you!)
Blocks: 962258
Attached patch promise-webconsole.patch (obsolete) — Splinter Review
This patch is also now disabling the test browser_devtools_raise.js. That test is blocking a couple of bugs and already has intermittent issues, so it needs to be fixed (bug 962258). With the test disabled this patch should be good to go.
Attachment #8346841 - Attachment is obsolete: true
Attached patch promise-webconsole.patch (obsolete) — Splinter Review
Attachment #8363236 - Attachment is obsolete: true
Comment on attachment 8363237 [details] [diff] [review]
promise-webconsole.patch

Verbal r+ from dcamp on disabling the test.
Attachment #8363237 - Flags: review+
Depends on: 962357
Disabling test was moved to its own bug and landed. Seems something changed to introduced another intermittent and I've added an attempt to fix it.
Attachment #8363237 - Attachment is obsolete: true
No longer blocks: 962258
Comment on attachment 8363800 [details] [diff] [review]
promise-webconsole.patch

It's looking good. Mihai, could you just take another look at the change I made to browser_console_dead_objects.js?
Attachment #8363800 - Flags: feedback?(mihai.sucan)
Attachment #8363800 - Flags: feedback?(mihai.sucan) → review+
https://hg.mozilla.org/mozilla-central/rev/f63078a8ce74
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 29
(This is not fixed. It's backed-out.)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Wes Kocher (:KWierso) from comment #24)
> https://hg.mozilla.org/mozilla-central/rev/f63078a8ce74

note that this happened because a merge cset with this fix included landed on central and so this got set fixed. Merged now a cset with the backout, so this also backed out from m-c and all the other branches (tl;dr msucan is right this is not fixed :)
Bug 963869 is about browser_console_dead_objects.js. It came up shortly after this landed and is one of the two failures that caused the backout. The intermittent persisted after this patch was backed out which makes me think it wasn't related to this patch. The test was recently disabled due to too many failures.
Brandon, given the test is disabled, can you please push this patch to try server, then to fx-team if it's fine? I'll check what's the issue with that test...
I wanted to pick up this patch to get it landed. However, I see the patch *is* landed.

Also, hg blame points to the changeset 165092:3cf6fcb75118 ("Merge mozilla-central to mozilla-inbound"). When did this land?
Flags: needinfo?(bbenvie)
It was originally landed January 24. I thought it was backed out shortly after but apparently not? I haven't attempted to re-land it.
Flags: needinfo?(bbenvie)
(In reply to Brandon Benvie [:benvie] from comment #30)
> It was originally landed January 24. I thought it was backed out shortly
> after but apparently not? I haven't attempted to re-land it.

This is weird. Carsten confirmed in comment #26 this patch was backedout, however, I now see it's not. Please confirm and we can mark the bug as fixed. I am glad the patch is in. :)
I can confirm that the changes are indeed actually there (e.g. Promise.jsm is imported at the top of webconsole.js). I guess since it's been in for a month and we've handled any fallout from it, we might as well keep it in.
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Blocks: 996671
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: