-
Notifications
You must be signed in to change notification settings - Fork 40
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pushsubscriptionchange event doesn't have oldSubscription in it. #325
Comments
@linacambridge, not sure if you remember much fo the details about our implementation? Or @martinthomson, it almost sound like our implementation might not much the spec anymore? |
Yep, our implementation is super out of date 😭 There's a bug on file for |
@linacambridge Thanks for the heads up. So to sum up, I will ask a couple of questions.
Thanks. |
Hey @novaknole, thanks for following up!
I wish I had a more satisfying answer for you than "yes, but it's kinda broken now, and you have to use a super clunky workaround to make it work"...but that's the state of things today. Thank you for taking the time to write up all your questions, it's definitely appreciated! |
@linacambridge Wheeew !!! Thanks so much for these answers. Finally, someone out there who just shed all the lights about this fuss. This is hopefully the last question I am gonna ask ! So, you mention
|
@novaknole No problem, I'm really glad that was helpful, and thanks for being so understanding!
|
I have a question about that. If the user disables push notification after subscription and after allow I think user token change. But pushsubscriptionchange not executes is it normal? |
Leaving this open, as we need to verify if the following is clear:
|
There are two things going on here, so maybe we could do a little to extract them:
The original question was about the information in the event (2); but that question is about termination (1). I believe that the purpose of the event was to signal termination (with |
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 useevent.oldSubscription
andevent.newSubscription
in there. The way I triggered this event is simply byblocking
andallowing
notifications from mozilla's preference's notification's settings.Question: 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 theevent.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?
The text was updated successfully, but these errors were encountered: