Automatically renew the push notifications subscription

AI-generated summary

Falco discusses the implementation of the pushsubscriptionchange event in Chrome, which will help automatically renew push notifications subscriptions — a feature already supported by other modern browsers. This aims to resolve cases where push notifications suddenly stop working. The solution involves handling the event in service workers and renewing subscriptions with minimal or no user effort, potentially requiring stored subscription metadata for accurate replacement. A related pull request was submitted and has now been merged. Users are encouraged to report any post-merge bugs regarding push notification failures.

Continuing the discussion from Android push notifications stop working:

Looks like Chrome will finally implement the pushsubscriptionchange event which is already supported by all other browsers who implement the modern web specs.

We have plenty of cases where the notifications cease to work all of sudden, and this may be one of the reasons why.

Implementing this means handling the event at the service works, plus handling the subscription renewal with minimal (0 if possible) effort from the user. It may be needed to save a few bits of information during subscriptions to make it possible, so you know which subscription you gotta replace.

14 likes

4 posts were split to a new topic: Don’t remove all push subscriptions on logoff

https://github.com/discourse/discourse/pull/11994/files

5 likes

This is now merged. If push notifications stop working after a while from now on please report a Contribute > Bug.

1 like