Using Chrome we get a "The site has been updated in the background" when push notifications are send.

As per https://developers.google.com/web/fundamentals/push-notifications/handli...

Chrome will only show the "This site has been updated in the background." notification when a push message is received and the push event in the service worker does not show a notification after the promise passed to event.waitUntil() has finished.

The main reason developers get caught by this is that their code will often call self.registration.showNotification() but they aren't doing anything with the promise it returns. This intermittently results in the default notification being displayed. For example, we could remove the return for self.registration.showNotification() in the example above and we run the risk of seeing this notification.

You can see how it's an easy thing to miss.

Just remember - if you see that notification, check your promise chains and event.waitUntil().

We will have to find something in our promise chains.

Comments

ronaldtebrake created an issue. See original summary.

ronaldtebrake’s picture

Status: Active » Needs review

  • ronaldtebrake authored 292d6a6 on 8.x-1.x
    Merge pull request #3 from goalgorilla/feature/#3027335-fix-chrome-...
  • ronaldtebrake committed f6cf802 on 8.x-1.x
    #3027335 by ronaldtebrake: return the promise on send notification
    
ronaldtebrake’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.