r.registrationFront error causes Debugger's sources to fail loading
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(firefox-esr68 unaffected, firefox71 unaffected, firefox72 fixed)
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox71 | --- | unaffected |
firefox72 | --- | fixed |
People
(Reporter: Harald, Assigned: jdescottes)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
Happens twice when opening Debugger on https://firefox-dev.tools/debugger-examples/examples/todomvc/ . Couldn't reproduce after restart.
Debugger sources didn't load.
Console links to Debugger didn't work.
Assignee | ||
Comment 1•5 years ago
|
||
I think what happens is that we process two workers of type "service", where one doesn't have a matching registration. This means we create a "fake" service worker at :
worker.fetch = front.fetch;
// If a service worker registration could not be found, this means we are in
// e10s, and registrations are not forwarded to other processes until they
// reach the activated state. Augment the worker as a registration worker to
// display it in aboutdebugging.
worker.scope = front.scope;
worker.active = false;
result.service.push(worker);
this worker has no registrationFront, so the next time we get a worker of type service and loop on all existing "service workers", we will crash.
The code that throws is
const { isParentInterceptEnabled } = r.registrationFront.traits;
if (!r.newestWorkerId || !isParentInterceptEnabled) {
return r.scope === front.scope;
}
I think we should have made isParentInterceptEnabled
a root actor trait instead of a service-worker-registration trait, but here since r.newestWorkerId
should also be false in this situation, checking isParentInterceptEnabled is not needed.
Changing this code to:
// r.registrationFront might be undefined if the service worker was just created from a worker without
// any associated registration
const isParentInterceptEnabled = r.registrationFront ? r.registrationFront.traits.isParentInterceptEnabled : false;
if (!r.newestWorkerId || !isParentInterceptEnabled) {
return r.scope === front.scope;
}
should be enough. Might be hard to write a test for it though.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/82f59a83b7df Fix js error when calling listAllWorkers with service workers missing their registration r=ladybenko
Comment 4•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Updated•2 years ago
|
Description
•