Skip to content

Feature request: Enhanced Control and Feedback for Service Worker Registration and Caching #57159

Closed as not planned

Description

@khanurooj5299

Command

build

Description

Currently, the Angular service worker does not provide adequate control and feedback mechanisms during the registration and caching process. This can lead to issues where developers are unable to detect if the service worker registration has failed or if the caching process has been successfully completed.
Example, right now I am unable to detect if the service worker registration failed. After inspection I found out that the navigator.serviceworker.register code is present in main.js file generated after production build. The catch handler attached to the returned promise just consoles the error.
Also, there is no feedback about the caching of assets. The service worker is installed even if any asset could not be cached but some use cases might things to be handled a little differently.

Describe the solution you'd like

The ServiceWorker module could provide some observables which emit such errors and feedback for registration failure, successful caching etc.,
Also more control over caching should be present because for some applications which are fully offline might require that all assets be cached before the Service worker installation is deemed successful.

Describe alternatives you've considered

Tried using the observables provided by SwUpdate service but realized that they don't work for the initial registration.
Tried using navigator.serviceworker.ready promise but this promise never rejects and will wait indefinitely to resolve until some SW is registered.

Activity

  1. changed the title [-]Feature request: Enhanced Control and Feedback for Service Worker Registration and Caching in Angular CLI[/-] [+]Feature request: Enhanced Control and Feedback for Service Worker Registration and Caching[/+] on Jul 27, 2024
  2. added this to the needsTriage milestone on Jul 28, 2024
  3. JeanMeche commented on Aug 29, 2025

    @JeanMeche
    Member

    With #63364 we've announced that the service-worker package in now in maintenance mode and will not receive feature PRs and feature requests.

    The message is also visible here: https://angular.dev/ecosystem/service-workers

  4. angular-automatic-lock-bot commented on Sep 29, 2025

    @angular-automatic-lock-bot

    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.

  5. locked and limited conversation to collaborators on Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: service-workerIssues related to the @angular/service-worker package

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions