angular-cn/packages/service-worker/test
Sonu Kapoor 29e8a64cf0 fix(service-worker): by default register the SW after 30s even the app never stabilizes (#35870)
Previously, when using the default ServiceWorker registration strategy
Angular would wait indefinitely for the [app to stabilize][1], before
registering the ServiceWorker script. This could lead to a situation
where the ServiceWorker would never be registered when there was a
long-running task (such as an interval or recurring timeout).

Such tasks can often be started by a 3rd-party dependency (beyond the
developer's control or even without them realizing). In addition, this
situation is particularly hard to detect, because the ServiceWorker is
typically not used during development and on production builds a
previous ServiceWorker instance might be already active.

This commit fixes this by changing the default registration strategy
from `registerWhenStable` to `registerWhenStable:30000`, which will
ensure that the ServiceWorker will be registered after 30s at the
latest, even if the app has not stabilized by then.

Fixes #34464

PR Close #35870
2020-03-27 10:47:44 -07:00
..
BUILD.bazel test: disable broken saucelabs tests with “fixme-saucelabs-ivy” & “fixme-saucelabs-ve” tags (#35516) 2020-02-24 17:27:21 -08:00
comm_spec.ts refactor(core): Migrate TestBed.get to TestBed.inject (#32382) 2019-09-09 19:10:54 -04:00
integration_spec.ts build: TypeScript 3.5 upgrade (#31615) 2019-07-25 17:05:23 -07:00
module_spec.ts fix(service-worker): by default register the SW after 30s even the app never stabilizes (#35870) 2020-03-27 10:47:44 -07:00