Trying to `start` a service worker seems broken
Categories
(DevTools :: about:debugging, defect, P2)
Tracking
(Not tracked)
People
(Reporter: jryans, Unassigned)
References
(Blocks 2 open bugs)
Details
Reporter | ||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•5 years ago
|
Comment 5•5 years ago
|
||
:bhackett looked at the exception in scope of https://phabricator.services.mozilla.com/D47543
It seems to only occur when calling getRegistrationByPrincipal from the content process (only happens when parent_intercept is false), but not all the time. More precisely it seems to happen when the actual worker is being stopped/destroyed/removed...
I looked a bit more into the role of the exception in our current workflow:
This works around the swm.getRegistrationByPrincipal(this._dbg.principal, this._dbg.url) call throwing NS_ERROR_FAILURE when running in a content process.
It's not consistently throwing in that case, otherwise we could simply avoid calling this from the content process.
Normally the API works from the content process.This change makes aboutdebugging serviceworker tests take a lot longer (some of them are even timing out on my machine).
It's interesting because we see the same kind of timeout issues when the serviceworker parent_intercept refactor is enabled.We seem to rely on this error to detect that the worker has been destroyed. If you look at root.js, we have a try catch around calls to listWorker.
When the API throws, we get registrations but no worker. This means the service worker is stopped in our logic.
Without the exception, the serviceworker will stay as "registering" (which is wrong) for a while before finally disappearing.
The exception itself might not be crucial to fix since it should be gone when parent_intercept is set to true, but this highlights that we don't properly handle the end of the serviceworker lifecycle, and just rely on the exception happening to transition from running to stopped.
Comment 6•5 years ago
|
||
This seems not to happen anymore, after the refactor. Closing the bug.
Description
•