From 45c893d0e13ac947c1c1684219965dde912d8b6c Mon Sep 17 00:00:00 2001 From: Hoel IRIS Date: Mon, 29 Jul 2019 16:42:25 +0200 Subject: [PATCH] docs(service-worker): add info about recovering from degraded Driver state (#32682) Related to #31865 PR Close #32682 --- aio/content/guide/service-worker-devops.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aio/content/guide/service-worker-devops.md b/aio/content/guide/service-worker-devops.md index 54db8d9855..9e0f28b857 100644 --- a/aio/content/guide/service-worker-devops.md +++ b/aio/content/guide/service-worker-devops.md @@ -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 this state when a new +version of the application is detected and installed (that is, +when a new `ngsw.json` is available). * `SAFE_MODE`: the service worker cannot guarantee the safety of using cached data. Either an unexpected error occurred or all @@ -216,6 +219,12 @@ 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). +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