New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(service-worker): add info about recovering from degraded Driver state #32682
docs(service-worker): add info about recovering from degraded Driver state #32682
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editorial changes for standard doc style, and one question.
ServiceWorkers are stopped by the browser after a certain period of inactivity | ||
and a new instance is created as soon as the ServiceWorker needs to handle an | ||
event (such as a request from the page). | ||
Those new instances would start from the `NORMAL` mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new instance starts in the NORMAL
mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for working on this, @H--o-l 👍
I left a couple of comments/suggestions too.
697d8cc
to
bd00abb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for following up, @H--o-l ✨
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edited for active voice, which makes it clearer who is acting on the SW.
@@ -207,6 +207,9 @@ There are two possible degraded states: | |||
clean copy of the latest known version of the app. Older cached | |||
versions are safe to use, so existing tabs continue to run from | |||
cache, but new loads of the app will be served from the network. | |||
The service worker will try to recover from that state when a new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...recover from this state...
@@ -216,6 +219,11 @@ network, running as little service worker code as possible. | |||
In both cases, the parenthetical annotation provides the | |||
error that caused the service worker to enter the degraded state. | |||
|
|||
Both states are temporary; they are saved only for the lifetime of the [ServiceWorker | |||
instance](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope). | |||
A service worker can and will be terminated by a browser when idle to conserve memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The browser sometimes terminates an idle service worker to conserve memory and processor power, and creates a new service worker instance in response to network events. The new instance starts in the NORMAL
mode, regardless of the state of the previous instance."
You can preview af2b390 at https://pr32682-af2b390.ngbuilds.io/. |
bd00abb
to
ffedea4
Compare
Thanks @jbogarthyde for the help! --- a/aio/content/guide/service-worker-devops.md
+++ b/aio/content/guide/service-worker-devops.md
@@ -207,7 +207,7 @@ There are two possible degraded states:
clean copy of the latest known version of the app. Older cached
versions are safe to use, so existing tabs continue to run from
cache, but new loads of the app will be served from the network.
-The service worker will try to recover from that state when a new
+The service worker will try to recover from this state when a new
version of the application is detected and installed (that is,
when a new `ngsw.json` is available).
@@ -221,9 +221,10 @@ error that caused the service worker to enter the degraded state.
Both states are temporary; they are saved only for the lifetime of the [ServiceWorker
instance](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope).
-A service worker can and will be terminated by a browser when idle to conserve memory
-and processor power, and re-created on network events.
-A new instance starts in the `NORMAL` mode.
+The browser sometimes terminates an idle service worker to conserve memory and
+processor power, and creates a new service worker instance in response to
+network events. The new instance starts in the `NORMAL` mode, regardless of the
+state of the previous instance.
#### Latest manifest hash
|
You can preview ffedea4 at https://pr32682-ffedea4.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think you can mark this for merge :-)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
docs(service-worker): add info about recovering from degraded Driver state
Related to #31865
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
There is no documentation on how the service worker recover from degraded state.
What is the new behavior?
A few info on how it recover.
Does this PR introduce a breaking change?
Other information