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

ServiceWorker never installs if a timer is running #25402

Closed
CarstenLeue opened this issue Aug 9, 2018 · 2 comments
Closed

ServiceWorker never installs if a timer is running #25402

CarstenLeue opened this issue Aug 9, 2018 · 2 comments
Labels
area: service-worker Issues related to the @angular/service-worker package
Milestone

Comments

@CarstenLeue
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

When registering a service worker via ServiceWorkerModule.register('/ngsw-worker.js') it turns out that this worker will only be registered once the application is considered "stable".
This in turn is determined by checking if there are outstanding macro- or microtasks.

If the application e.g. uses a interval timer (e.g. to periodically refresh itself), then the service worker will never be registered, because the application never reaches its stable state.

Expected behavior

I would expect that it is supported to use timers and intervals in the application and that these do NOT cause a service worker from not being registered.

Minimal reproduction of the problem with instructions

Use an empty angular app, add service worker support via ng add @angular/pwd and start a timer in the constructor of your module. As a result the service worker will never be registered.

Environment


Angular version: 6.1.2
@benlesh benlesh added the area: service-worker Issues related to the @angular/service-worker package label Aug 9, 2018
@ngbot ngbot bot added this to the needsTriage milestone Aug 9, 2018
@gkalpak
Copy link
Member

gkalpak commented Aug 12, 2018

Duplicate of #20970.

@gkalpak gkalpak closed this as completed Aug 12, 2018
@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 Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: service-worker Issues related to the @angular/service-worker package
Projects
None yet
Development

No branches or pull requests

3 participants