angular-cn/packages
George Kalpakas 094538c0ce feat(service-worker): recover from `EXISTING_CLIENTS_ONLY` mode when there is a valid update (#31865)
Previously, when the ServiceWorker entered a degraded mode
(`EXISTING_CLIENTS_ONLY` or `SAFE_MODE`) it would remain in that mode
for the rest of the lifetime of ServiceWorker instance. Note that
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.

The reason for this behavior is to err on the side of caution: If we
can't be sure why the ServiceWorker entered the degraded mode, it is
risky to try recovering on the same instance and might lead to
unexpected behavior.

However, it turns out that the `EXISTING_CLIENTS_ONLY` mode can only be
a result of some error happening with the latest version (e.g. a hash
mismatch in the manifest). Therefore, it is safe to recover from that
mode once a new, valid update is successfully installed and to start
accepting new clients.

This commit ensures that the mode is set back to `NORMAL`, when (a) an
update is successfully installed and (b) the current mode is
`EXISTING_CLIENTS_ONLY`.

Besides making the behavior more predictable (instead of relying on the
browser to decide when to terminate the current ServiceWorker instance
and create a new one), this change can also improve the developer
experience:
When people notice the error during debugging and fix it by deploying a
new version (either to production or locally), it is confusing that the
ServiceWorker will fetch and install the update (as seen by the requests
in the Network panel in DevTools) but not serve it to clients. With this
change, the update will be served to new clients as soon as it is
installed.

Fixes #31109

PR Close #31865
2019-09-04 15:41:04 -07:00
..
animations build: convert entry_point to label (#30627) 2019-06-11 00:03:11 +00:00
bazel feat(bazel): update to the latest `@microsoft/api-extractor` (#32185) 2019-08-30 13:55:32 -04:00
benchpress build: TypeScript 3.5 upgrade (#31615) 2019-07-25 17:05:23 -07:00
common refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
compiler fix(ivy): i18n - do not generate jsdoc comments for `$localize` (#32473) 2019-09-04 15:40:23 -07:00
compiler-cli fix(ivy): i18n - do not generate jsdoc comments for `$localize` (#32473) 2019-09-04 15:40:23 -07:00
core fix(ivy): ensure binding ordering doesn't mess up when a `NO_CHANGE` value is encountered (#32143) 2019-09-04 11:54:19 -07:00
docs
elements fix(elements): handle falsy initial value (#31604) 2019-07-18 14:26:37 -07:00
examples docs(service-worker): add example app for `SwPush` API docs (#32139) 2019-08-27 16:18:53 -07:00
forms refactor: Move `dom_adapter.ts` to `@angular/common` (#32154) 2019-08-29 21:51:56 -07:00
http refactor: Move `dom_adapter.ts` to `@angular/common` (#32154) 2019-08-29 21:51:56 -07:00
language-service fix(language-service): Use ts.CompletionEntry for completions (#32375) 2019-09-04 11:53:14 -07:00
localize feat(ivy): implement `$localize()` global function (#31609) 2019-08-30 12:53:25 -07:00
platform-browser refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
platform-browser-dynamic refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
platform-server refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
platform-webworker refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
platform-webworker-dynamic build: convert entry_point to label (#30627) 2019-06-11 00:03:11 +00:00
private/testing test(ivy): add onlyInIvy perf counter expectations (#30339) 2019-05-09 11:22:00 -07:00
router refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
service-worker feat(service-worker): recover from `EXISTING_CLIENTS_ONLY` mode when there is a valid update (#31865) 2019-09-04 15:41:04 -07:00
upgrade refactor(upgrade): avoid using static inherited method (#31986) 2019-08-05 10:01:33 -07:00
zone.js fix(zone.js): a path traversal attack in test (#32392) 2019-08-30 12:44:46 -07:00
BUILD.bazel refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
README.md
empty.ts
goog.d.ts fix(ivy): use goog.LOCALE for Closure Compiler to define default LOCALE_ID (#31519) 2019-07-16 13:02:10 -04:00
license-banner.txt
system.d.ts
tsconfig-build-no-strict.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-build.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-test.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
tsconfig.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
types.d.ts

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT