-
Notifications
You must be signed in to change notification settings - Fork 41
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
Make PushSubscription.expirationTime mandatory #302
Comments
This is less a question of API design and more one of policy. I'd suggest taking this to the browsers. For Firefox, all I can say is that we don't have the resources to make any changes to the push code right now. |
@martinthomson as I'm new to the Push work, I don't know who the key implementation contacts are outside of Mozilla. Could you kindly suggest a couple of folks that we could cc here, just so they are aware? @collimarco, I've filed a bug for you on the Firefox side: Please cc yourself on the bug above - and we may have some follow up. But as Martin stated, we are focused on other things right now - so please be patient while we get to it (it could take up to a year). |
@martinthomson The point is that until the standard says that the expiration is optional, browser manufacturer are free to ignore this and they don't set any expiration... indeed no current browser sets the expirationTime. This issue is really a pain... valid subscriptions (that return successful status codes) have such low delivery rates due to this problem and it is difficult to explain that to normal people (still we don't want to do like other services that simply show the sending rate as if it was the delivery rate...). Also it doesn't really make sense that the number of inactive subscriptions (that belong to abandoned devices and browsers) grows constantly over time. Fixing this is also relevant for privacy, because it would allow us to delete unused subscriptions together with all the associated data. |
@collimarco, please understand that even if we were to put something into the spec today, without browsers first agreeing to follow the spec, it’s just empty words. Specs don’t magically make implementations happen: we, more often than not, fix implementations first and then update the spec to match. That’s why Martin suggests going through browsers first. Getting things implemented first will help us understand exactly what we should put in the spec. |
@collimarco Microsoft Edge sets |
Yeah, Chrome plans to match Edge in this regard. I don't have a timeline, but would expect this to pop up somewhere next year. I don't have strong feelings about whether we should mandate this in the spec or not. I'd like to have a better understanding on whether it's possible to implement this behaviour natively on various operating systems with various push services. Push services might also employ alternative mechanisms for keeping subscriptions current, invaliding subscriptions after a very short period of time without connections for example, in which case enforcing browser-side behaviour might be unnecessary. |
I agree that there are two strategies here:
However none of them is enforced by the standard at the moment. I think that at least one should be enforced by the standard in order to avoid future problems. Also, the two strategies can coexist: if a browser decides to implement both that would be great. |
That would indeed be ideal. Both are currently implemented by Microsoft Edge and the Windows Notification Service. |
I've asked this on Stackoverflow too, has any progress been made? Link to my question. How can apps with authentification limit the time a subscription is valid? So far, I think only browser can limit time, but field |
Any progress about this? how do I know which ones are active/inactive? still the only way to detect this is if request from my app server to push server returns 410? |
Unfortunately yes, that is the main method and requires a push to the subscription. |
@collimarco do you use
|
@novaknole Absolutely, you need to handle the If you need inspiration for handling Then on your server you simply replace the old subscription with the new one.
Yes, it will. But in the meantime, if you don't handle the subscription change, the user will stop receiving the notifications (until he visits your website again and subscribes again). |
@collimarco Thanks for your explanation. A couple of things I want to add here .
|
|
Thanks.
|
|
Question 1) I was thinking about checking What if in my service worker's Way 1) what we could do is use Way 2) What we could do is instead of using Way 3) don't use Question 2) https://stackoverflow.com/questions/61559039/how-to-get-jwt-token-in-service-worker What do you think, Marco ? |
@collimarco could you take a look at my latest questions if you got some free time... I'm struggling a little bit to find opinions from experienced people from this.. |
@novaknole |
Moving comment from #340 The purpose of PublicationSubscription's
|
Push subscriptions can last many years without expiring and there is a negative correlation between the age of a push subscription and its expected delivery rate, as described by this study (that I have published):
https://blog.pushpad.xyz/2018/09/web-push-subscription-age-affects-delivery-rates/
Enforcing the browser to set an
expirationTime
for all the push subscription generated, would be helpful. Basically that will ensure that an unused endpoint will always be removed after some time... otherwise the number of old, unused endpoints will increase steadily over time (and the average delivery rate will tend toward zero).The text was updated successfully, but these errors were encountered: