Skip to content

[Feature Request] [Service Worker] Background Sync #22145

Closed as not planned
Closed as not planned

Description

@jintoppy

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x ] 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

Current behavior

Right now, Service Worker package do not have sync feature. Since Angular follows a plugin mechanism to add service worker apis, I feel this is a major feature which is required.

Background Sync

Expected behavior

Should be able to register a background sync easily using @angular/service-worker package.

Minimal reproduction of the problem with instructions

N/A

What is the motivation / use case for changing the behavior?

This is required to make sure that user is able to do actions even on unstable internet connections.

Activity

  1. added
    featureLabel used to distinguish feature request from other issues
    on Feb 15, 2018
  2. added this to the Backlog milestone on Feb 15, 2018
  3. SimonKunz commented on Mar 13, 2018

    @SimonKunz

    I think this feature is crucial for real offline capable applications.
    Is there already some kind of roadmap for this?

  4. niveditaece commented on Jun 15, 2018

    @niveditaece

    is there an alternative way to achieve background sync in angular?

  5. DaSchTour commented on Jun 15, 2018

    @DaSchTour

    Just don't use angulars serviceworker but workbox
    And I think angular should do the same, but that's another story

  6. yonexbat commented on Jul 21, 2018

    @yonexbat

    It would be nice if custom code can be added to the generated service worker file. Or is it already possible?

  7. deryfebriantara commented on Jul 31, 2018

    @deryfebriantara

    I already use angular service worker and trying to add background sync functionality, I considered try to use workbox for a while.

  8. ajaynavgale commented on Sep 25, 2018

    @ajaynavgale

    Can someone point me to any guidance/best practice on how to implement background sync in Angular App? Thank you. @mhevery

  9. siegenthalerroger commented on Sep 30, 2018

    @siegenthalerroger

    Without allowing customisation of the service worker angular is falling behind to Vue (yes I know, vue uses workbox). I don't want to use workbox with angular, I'll use what the framework I'm using says I should.

  10. jvitor83 commented on Nov 6, 2018

    @jvitor83

    @alxhub Do we have any ETA for that? Even in some alpha release?

  11. kdesimini commented on Nov 13, 2018

    @kdesimini

    Yeah workbox is a nightmare. Is this even being considered?

  12. SimonKunz commented on Nov 16, 2018

    @SimonKunz

    With Google pushing PWAs everywhere it's very sad that there's still no proper serviceworker support in Angular.
    Even registering a click handler on a web push notification is not possible right now.

    I switched to using workbox in all of my Angular projects...

  13. royanon commented on Jan 9, 2019

    @royanon

    This is sad. It is useless if background sync is not working.

    This genius has save the world. Check it out.
    https://golb.hplar.ch/2018/12/background-sync-ng.html

  14. kdesimini commented on Jan 9, 2019

    @kdesimini

    This is sad. It is useless if background sync is not working.

    It appears Google workbox background sync with Angular doesn't work on mobile devices either which sucks.

  15. 5 remaining items

  16. ozzabozza commented on Sep 20, 2020

    @ozzabozza

    Hi Maxim, I have seen some of your presentations about ngsw en workbox. Would it be possible to combine basic ngsw with workbox background sync?

  17. webmaxru commented on Sep 20, 2020

    @webmaxru
    Member

    Hello Oscar! Both NGSW and Workbox have listeners of fetch event which might make the combination quite challenging. But in theory, this is possible - read "multiple fetch handlers" section of this answer: https://stackoverflow.com/a/45285119/1310228

    It seems like you have to create your own SW and importScripts() NGSW and parts of Workbox there.

    Please keep us posted about your progress!

  18. ozzabozza commented on Sep 20, 2020

    @ozzabozza

    Thanks, Ill give it a try!

  19. added
    feature: under considerationFeature request for which voting has completed and the request is now under consideration
    on Jun 4, 2021
  20. GlauberF commented on Jun 21, 2021

    @GlauberF

    any official position of the Angular team about this feature?

    Note: I believe that instead of inventing the wheel, the time could be spent to majestically integrate with Google's workbox(https://developers.google.com/web/tools/workbox) library.
    Where it already has many features and it would not need to be developed from scratch.

  21. gkalpak commented on Jun 21, 2021

    @gkalpak
    Member

    There are currently no specific plans/timeline for implementing this. Keep in mind that this feature is still unstandardized and not supported by some browsers (such as Firefox and Safari) afaict.

    The Angular SW aims to be super easy to set up and configure and cover the most common needs for a PWA. That unfortunately comes at the cost of being flexible and extensible. For more advanced usecases you can always either "extend" the Angular SW as described in #22145 (comment) or use another library, such as Workbox.

    (Of course, we will revisit this in the future is the status of the feature changes (e.g. it gets standardized, gains more widespread adoption by browsers, etc.).)

  22. GlauberF commented on Jun 21, 2021

    @GlauberF

    @gkalpak Thanks for the feedback.
    I hope one day to be able to work with more features like background sync, in an easy way as it is done today using angular pwa.

  23. naveedahmed1 commented on May 15, 2022

    @naveedahmed1
    Contributor

    Any update on this?

  24. irapopova commented on May 10, 2023

    @irapopova

    Any update on this?

  25. wadlieb commented on Oct 8, 2023

    @wadlieb

    Any update on this?

  26. leherv commented on Jan 14, 2025

    @leherv

    Any update on this?

  27. JeanMeche commented on Aug 27, 2025

    @JeanMeche
    Member

    Per #63364, we won't be addressing this issue.

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

  28. angular-automatic-lock-bot commented on Sep 27, 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.

  29. locked and limited conversation to collaborators on Sep 27, 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 packagefeatureLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under consideration

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions