Simplify WebConsoleConnectionProxy connect/disconnect function
Categories
(DevTools :: Console, task, P1)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
Details
Attachments
(2 files)
The connect
function is quite hard to follow, with other methods responsible to resolve or reject the connection Promise created in connect
.
Furthermore, both function use defer
, which we could probably get rid of
Assignee | ||
Comment 1•5 years ago
|
||
cc Alex as he's doing work around destroy in the console, which might be related to this (or maybe not)
Assignee | ||
Comment 2•5 years ago
|
||
Comment 3•5 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)
cc Alex as he's doing work around destroy in the console, which might be related to this (or maybe not)
Yes, nothing bad, but I'm conflicting on the change made to disconnect
, I'm removing the _disconnected defer object, as well as the await on isAttached:
https://phabricator.services.mozilla.com/D38310#change-OBZPMd324VF1
Comment 4•5 years ago
|
||
It doesn't look like you are actually modifying anything in term of what we are waiting for in disconnect
, but if you do, you may hit the same test failure I'm currently investigating. So be aware that I already fixed a bunch.
Assignee | ||
Comment 5•5 years ago
|
||
let's make this bug depend on Bug 1566421 so we don't conflict each other
Assignee | ||
Comment 6•5 years ago
|
||
Assignee | ||
Comment 7•5 years ago
|
||
Both function were using defer. We replace it with plain
Promises.
The connect function was very hard to follow, with other methods
responsible to resolve the connection Promise.
We modify this to only deal with the connection Promise inside
the connect function so it's easier to follow.
The connection timeout was handled in a similar fashion, with
the callback to a setTimeout responsible to reject the connection
promise.
We modify this behavior in favor of a Promise.race which brings
us the same benefit while being easier to understand.
Depends on D39470
Updated•5 years ago
|
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1a8f06f91829 Switch WebConsoleConnectionProxy to a class. r=ochameau. https://hg.mozilla.org/integration/autoland/rev/4fb51afb9b47 Simplify WebConsoleConnection connect function. r=ochameau.
Comment 10•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1a8f06f91829
https://hg.mozilla.org/mozilla-central/rev/4fb51afb9b47
Description
•