You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] 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
The text was updated successfully, but these errors were encountered:
I'm submitting a...
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
The text was updated successfully, but these errors were encountered: