Closed Bug 1523257 Opened 6 years ago Closed 5 years ago

WebConsoleConnectionProxy.isAttached is redundant with WebConsoleConnectionProxy._connectDefer

Categories

(DevTools :: Console, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1566879

People

(Reporter: ochameau, Unassigned)

References

Details

While I rebased on top of bug 1518777, I realized that the new field "isAttached"
https://searchfox.org/mozilla-central/rev/4faab2f1b697827b93e16cb798b22b197e5235c9/devtools/client/webconsole/webconsole-connection-proxy.js#137
Was redundant with "_connectDefer"
https://searchfox.org/mozilla-central/rev/4faab2f1b697827b93e16cb798b22b197e5235c9/devtools/client/webconsole/webconsole-connection-proxy.js#262

While _connectDefer is more powerful as it includes a timesout.
Also, isAttached isn't a very explicit name. We are using "attach" for historical reasons. We use to have an attach sequence for all actors but that was only for the oldest actors: console and thread. There is still an attachConsole method on DebuggerClient:
https://searchfox.org/mozilla-central/source/devtools/shared/client/debugger-client.js#393-400
Which calls startListener like here, but the naming feels now outdated.
This method should be ultimately replaced by target.getFront("webconsole") as we typically do not pass any listener and only want to retrieve the console client:
https://searchfox.org/mozilla-central/rev/4faab2f1b697827b93e16cb798b22b197e5235c9/devtools/client/framework/target.js#562-563

So both fields feel redudant and "_connectDefer" is more complete and may have a better naming. We may revisit the usages of "attach" in our codebase.

Will be removed in Bug 1566879

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.