pushsubscriptionchange event doesn't have oldSubscription/newSubscription
Categories
(Core :: DOM: Service Workers, defect, P3)
Tracking
()
People
(Reporter: glagh14, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4132.0 Safari/537.36
Steps to reproduce:
Question 1) I want to use event.oldSubscription and event.newSubscription in pushsubscriptionchange event. At least this is what w3c specs say and people about this. The way I triggered this event is simply by blocking and allowing notifications from mozilla's preference's notification's settings. i consoled.log event.oldSubscription and event.newSubscription
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 .
Question: Is this the standard approach or would the last lines of code on the following website https://pushpad.xyz/service-worker.js be enough?
Actual results:
Question 1) 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'd appreciate the answer to the above I put in what did you do
section
Expected results:
Question 1) oldSubscription and newSubscription shouldn't be undefined.
Question 2) I'd appreciate the answer to the above I put in what did you do
section
(In reply to glagh14 from comment #0)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4132.0 Safari/537.36
Steps to reproduce:
Question 1) I want to use
event.oldSubscription
and event.newSubscription inpushsubscriptionchange
event. At least this is what w3c specs say and people about this. The way I triggered this event is simply by blocking and allowing notifications from mozilla's preference's notification's settings. i consoled.logevent.oldSubscription
andevent.newSubscription
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 .Question: Is this the standard approach or would the last lines of code on the following website https://pushpad.xyz/service-worker.js be enough?
Actual results:
Question 1) 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'd appreciate the answer to the above I put in
what did you do
sectionExpected results:
Question 1) oldSubscription and newSubscription shouldn't be undefined.
Question 2) I'd appreciate the answer to the above I put in
what did you do
section
Comment 2•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•4 years ago
|
Updated•4 years ago
|
Description
•