You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not defined that a pushsubscriptionchange event will be fired when the browser has network connectivity, and of course it's also possible that any given network request may fail for a variety of reasons.
In a pushsubscriptionchange event handler, it may be a common requirement for the service worker to update new subscription details to some application server. It's not clear how to handle the case of a failure in the network upload.
As a suggestion; If the network Promise is included in event.waitUntil, and the Promise rejects, the event may be re-sent to allow the service worker code to retry.
Otherwise, the event handler code must flag that a retry is required, and wait for some opportunity to retry the upload. However, it's not clear what opportunity it will get. Since the spec says that any old subscription is unsubscribed on completion of the pushsubscriptionchange event, no further push events may be expected, and there is no guarantee that there will be any other event (such as install or activate) fired.
The text was updated successfully, but these errors were encountered:
When I say "the spec", I'm referring to https://w3c.github.io/push-api/#the-pushsubscriptionchange-event.
It's not defined that a
pushsubscriptionchange
event will be fired when the browser has network connectivity, and of course it's also possible that any given network request may fail for a variety of reasons.In a
pushsubscriptionchange
event handler, it may be a common requirement for the service worker to update new subscription details to some application server. It's not clear how to handle the case of a failure in the network upload.As a suggestion; If the network Promise is included in
event.waitUntil
, and the Promise rejects, the event may be re-sent to allow the service worker code to retry.Otherwise, the event handler code must flag that a retry is required, and wait for some opportunity to retry the upload. However, it's not clear what opportunity it will get. Since the spec says that any old subscription is unsubscribed on completion of the
pushsubscriptionchange
event, no furtherpush
events may be expected, and there is no guarantee that there will be any other event (such asinstall
oractivate
) fired.The text was updated successfully, but these errors were encountered: