[w3c/push-api] pushsubscriptionchange event doesn't have oldSubscription in it. (#325)

Hi... 

It's finally assumed that `pushsubscriptionchange` never fires in chrome.  and It's somehow understandable since their subscriptions never expire.  Before we decide to start discussing this, I must say that's what information I got here https://bugs.chromium.org/p/chromium/issues/detail?id=1078367&q=Pri%3D%223%22#makechanges.

**Question 1)** 

So I still decided to use this event for `mozilla` users.  and I want to use `event.oldSubscription` and `event.newSubscription` in there. The way I triggered this event is simply by `blocking` and `allowing` notifications from mozilla's preference's notification's settings. 

_Problem:_ oldSubscription and newSubscription are both undefined. Why? could this be because of the way I trigger it? and if mozilla itself triggers this, would they NOT be undefined at that stage?


**Question 2)** 

I have seen on the mozilla docs page, that the way it handles `pushsubscriptionchange` event is that in that event, it tries to subscribe again by using the `event.oldSubscription`.  https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/pushsubscriptionchange_event   .  Is this the standard approach or would the last lines of code on that website https://pushpad.xyz/service-worker.js be enough?  




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/issues/325

Received on Tuesday, 5 May 2020 18:04:42 UTC