The Worker name should be reflected in the threads pane
Categories
(DevTools :: Debugger, enhancement, P3)
Tracking
(firefox135 fixed)
| Tracking | Status | |
|---|---|---|
| firefox135 | --- | fixed |
People
(Reporter: jlast, Assigned: ochameau)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
It'd be great if the threads pane took advantage of the worker's name field when determining the name to show.
Aside from DevTools, the name is also accessible from within the Worker itself via global name (or http://self.name), which can help with logging or identifying which thread ID you're in.
| Reporter | ||
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Ha, thanks for filing. I think I brought this up in slack many moons ago but didn't file an issue.
Comment 3•6 years ago
|
||
Hi, I'd love to work on this bug but I'd like some pointers -
First I looked at how the worker thread being rendered in the <Thread/> secondary pane was represented in the redux store and I found the threads reducer.
I searched for functions that would dispatch an action with type INSERT_THREADS and I found fetchThreads.
It seems like fetchThreads returns a list of Thread plain objects created by createThread. I was thinking that here is the place where I would check whether the thread is a worker and set the name accordingly.
The second argument to createThread however is of type WorkerTargetFront. Turns out the current name is the last path of the URL, which in the case of a web worker constructed from a blob would be its UUID.
I don't yet understand how to use WorkerTargetFront and this is my first time delving into actors/fronts. I was wondering whether it's possible to call self.name on the DedicatedWorkerGlobalScope of the worker in the same manner as the toolbox spawned by about:debugging#workers does.
Updated•6 years ago
|
| Reporter | ||
Comment 4•6 years ago
|
||
Thanks Bryan for looking into this. I think you're on the right path.
I'd start by looking in the worker actor
https://searchfox.org/mozilla-central/source/devtools/server/actors/targets/worker.js#45-71
which has access to the underlying worker
and then see if you can pass down the name field in the form.
once the worker front has the name, it will be a lot easier to decide what to do
Worker --> Worker Actor --> Worker Front --> redux store --> threads pane --> worker component
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:transfusion, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•6 years ago
|
Comment 7•6 years ago
|
||
Brian, can we review/land the attached patch?
Honza
Updated•6 years ago
|
Comment 10•6 years ago
|
||
Backed out for dt failures on browser_dbg-toolbox-workers.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/28f9b839e5406a3c0f4e9accd32f5ce5d327b45a
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=282153400&repo=autoland&lineNumber=21981
| Reporter | ||
Comment 11•6 years ago
|
||
I looked into this briefly and the test passed for me locally....
Comment 13•6 years ago
|
||
(In reply to Jason Laster [:jlast] from comment #12)
Could you look into this?
The problem here is that the evaluateJS call is returning {"type":"undefined"} object, which gets coerced to an [object Object] string that is shown in the debugger and breaking the test (which looks for specific worker names). I don't know why this only fails in some cases. The best fix here is probably to only use the evaluateJS result if it is a string.
Comment 14•5 years ago
|
||
Hey Jason, do you mind taking another look at the phabricator revision please? It looks like work was done after the initial review and backout and it seems like a final review is needed in order to land again.
Comment 15•5 years ago
|
||
Jason, is there anything we could do?
Honza
Comment 17•3 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Updated•3 years ago
|
Comment 18•1 year ago
|
||
It's still an issue in Firefox Nightly 133.0a1 (2024-10-04).
This makes debugging really annoying. If you spawn several workers from the same Javascript file you just don't know which worker to pick in the Firefox debugger. So you've got to try though all of them.
Chromium shows the workers name instead of the Javascript filename. And Chromium even sticks to that worker when you reload the page. So Chromium switches back to the worker with the same name, as soon as it appears after the reload. Really convenient!
Updated•1 year ago
|
Comment 19•1 year ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
| Assignee | ||
Comment 20•1 year ago
|
||
| Assignee | ||
Comment 21•1 year ago
|
||
This patch affects both the console context selector and debugger source tree / thread panels.
The URL should still be displayed in tooltips.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 22•1 year ago
|
||
Comment 23•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/b272f8689188
https://hg.mozilla.org/mozilla-central/rev/4243ea261413
Description
•