Skip to content
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

Closed

Conversation

H--o-l
Copy link
Contributor

@H--o-l H--o-l commented Sep 14, 2019

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?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

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?

  • Yes
  • No

Other information

@H--o-l H--o-l requested a review from a team as a code owner September 14, 2019 15:11
@H--o-l H--o-l changed the title docs(service-worker): add info about recovering from degraded Driver … docs(service-worker): add info about recovering from degraded Driver state Sep 14, 2019
@ngbot ngbot bot added this to the needsTriage milestone Sep 16, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Sep 17, 2019
@kapunahelewong kapunahelewong added this to In Review in docs Sep 17, 2019
Copy link
Contributor

@jbogarthyde jbogarthyde left a 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.

aio/content/guide/service-worker-devops.md Outdated Show resolved Hide resolved
aio/content/guide/service-worker-devops.md Outdated Show resolved Hide resolved
aio/content/guide/service-worker-devops.md Outdated Show resolved Hide resolved
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.
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

aio/content/guide/service-worker-devops.md Outdated Show resolved Hide resolved
Copy link
Member

@gkalpak gkalpak left a 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.

aio/content/guide/service-worker-devops.md Outdated Show resolved Hide resolved
aio/content/guide/service-worker-devops.md Outdated Show resolved Hide resolved
aio/content/guide/service-worker-devops.md Outdated Show resolved Hide resolved
aio/content/guide/service-worker-devops.md Outdated Show resolved Hide resolved
@H--o-l H--o-l force-pushed the docs/service-worker-driver-state-recover branch 2 times, most recently from 697d8cc to bd00abb Compare September 30, 2019 08:05
Copy link
Member

@gkalpak gkalpak left a 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 👍

Copy link
Contributor

@jbogarthyde jbogarthyde left a 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
Copy link
Contributor

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
Copy link
Contributor

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."

@jbogarthyde jbogarthyde added aio: preview area: service-worker Issues related to the @angular/service-worker package freq1: low target: patch This PR is targeted for the next patch release severity1: confusing labels Sep 30, 2019
@mary-poppins
Copy link

@H--o-l H--o-l force-pushed the docs/service-worker-driver-state-recover branch from bd00abb to ffedea4 Compare September 30, 2019 16:01
@H--o-l
Copy link
Contributor Author

H--o-l commented Sep 30, 2019

Thanks @jbogarthyde for the help!
I push your change request, see the following patch:

--- 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

@mary-poppins
Copy link

You can preview ffedea4 at https://pr32682-ffedea4.ngbuilds.io/.

Copy link
Contributor

@jbogarthyde jbogarthyde left a 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 :-)

@gkalpak gkalpak added the action: merge The PR is ready for merge by the caretaker label Sep 30, 2019
@atscott atscott closed this in 45c893d Sep 30, 2019
atscott pushed a commit that referenced this pull request Sep 30, 2019
@H--o-l H--o-l deleted the docs/service-worker-driver-state-recover branch October 1, 2019 13:13
@jbogarthyde jbogarthyde moved this from In Review to Done in docs Oct 1, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker aio: preview area: service-worker Issues related to the @angular/service-worker package cla: yes effort1: hours freq1: low risk: low target: patch This PR is targeted for the next patch release type: bug/fix
Projects
docs
Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants