New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 646721 link

Starred by 14 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature

Blocking:
issue 753163
issue 623062



Sign in to add a comment

Implement pushsubscriptionchange event

Reported by gaurava...@gmail.com, Sep 14 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Steps to reproduce the problem:
1. We have added the Onpushsubscriptionchange listener event on our service worker. 
2. We had observed a lot of cases where the GCM token of the user was getting changed. This has been mentioned here  Issue 642139  and also as mentioned here http://stackoverflow.com/questions/34601990/questions-about-keeping-service-worker-push-subscriptions-in-sync
3. We have over 1.5 million active users subscribed with permission granted current status. We added the onpushsubscriptionchange  a week back. And we have still not received any event on that from chrome.  And from firefox we are getting response. (Our 90% users are from chrome) 
Also in order to test it we also unsubscribed and resubscribed but still did not receive a response. 

What is the expected behavior?

What went wrong?
Onpushsubscriptionchange should send response when the GCM token of the user is getting changed. It is currently not sending response. 

Did this work before? N/A 

Chrome version: 52.0.2743.116  Channel: stable
OS Version: OS X 10.11.4
Flash Version:
 
Components: Blink>Messaging
Status: Untriaged (was: Unconfirmed)
Over to Blink>Messaging for further triage, since I think this is a GCM issue.
Components: -Blink>Messaging Blink>PushAPI

Comment 3 by awdf@chromium.org, Sep 15 2016

Labels: -Pri-2 Pri-3
Owner: peter@chromium.org
Status: Available (was: Untriaged)
Hi there,

Chrome doesn't support onpushsubscriptionchange yet. It is part of the Push API specification, but not yet implemented by all browsers - see https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onpushsubscriptionchange . We do plan to support onpushsubscriptionchange in future - you can continue to track this issue for updates.

Thanks
Cool. When is the expected time when this would be rolled out ? 

Comment 5 by benl...@mobify.me, Oct 17 2016

When it is rolled out, can there *please* be a documented way to trigger it, to allow devs to test their event-handler code?

Comment 6 by joh...@chromium.org, Oct 17 2016

Yes, we'll make sure there's an easy way to test this.
Labels: -Type-Bug -OS-Mac OS-All Type-Feature
Summary: Implement pushsubscriptionchange event (was: Onpushsubscriptionchange not triggering any response )
Spec proposal: https://github.com/w3c/push-api/issues/228

Comment 8 by peter@chromium.org, Dec 5 2016

Status: Started (was: Available)
Blocking: 623062
Any plans to have this event and resolve 623062?
Yes, we will implement the `pushsubscriptionchange` event and enable subscription expiration, but not with the semantics that you're hoping for (subscribing whilst offline). An alternative that you could consider is trying to subscribe from a Background Sync event.

https://github.com/WICG/BackgroundSync/blob/master/explainer.md

Comment 12 by benl...@mobify.me, May 12 2017

@peter is it going to be possible to subscribe from a background sync? I note that in Chrome 58.0.3029.110 a subscribe() call invoked from the console prompts the message "[Violation] Only request notification permission in response to a user gesture", suggesting that programmatic subscription may be blocked at some point.
Cc: eostroukhov@chromium.org
Blocking: 753163
In the comment 11 Peter says: "An alternative that you could consider is trying to subscribe from a Background Sync event."

The question is how? I think it's not possible because it can't detect when the browser is offline or closed to register a background sync event. This only solves the problem if the user keeps the app opened, but,in that case, it can use a online/offline event to renew the subscription.

So, what event should I trigger to register a sync tag?

Sign in to add a comment