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

Issue 611079 link

Starred by 5 users

Issue metadata

Status: WontFix
Owner:
no longer working on chrome
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

What happens to push subscriptions when clearing Chrome's data?

Project Member Reported by peter@chromium.org, May 11 2016

Issue description

Suppose I have installed Chrome for Android and have subscribed for push for a number of websites.

I then go to the App Settings on Android and clear data for Chrome as a whole.

What happens to the push subscription in this case? I suspect that we delete the data within Chrome, but does the subscription with Play Services continue to live? If so, we should unsubscribe automatically on next message; if not, does it tell the server about the unsubscription, so that it can return a 400 code when pushing for that user?
 
Status: WontFix (was: Assigned)
I can confirm that messages continue to be delivered to Chrome after app data is cleared, and they show up in chrome://gcm-internals (see screenshot). Of course, they don't then show a notification or anything since the subscription (PushMessagingAppIdentifier) and Service Worker no longer exist.

Oddly, these incoming messages do not trigger automatic unsubscription (there are no entries for PUSH_UNREGISTRATION_REASON_DELIVERY_UNKNOWN_APP_ID in chrome://histograms, indeed the only push/GCM histogram that gets logged at all is GCM.Crypto.DecryptMessageResult), hence the subscription remains valid as far as the GCM server is concerned.

That's because push messaging has not yet registered a GCMAppHandler, since it is not aware that there are any subscriptions. Subscribing for push on any website causes the GCMAppHandler to be added, and then the next time a message is sent to the old subscription is triggers PUSH_UNREGISTRATION_REASON_DELIVERY_UNKNOWN_APP_ID as expected, and hence the next time a message is sent after that (assuming the device was online) the GCM server responds {"error":"NotRegistered"} as expected, indicating to the push sender that this subscription is no longer valid.

Possible ways to avoid the edge case:
- Unconditionally register the GCMAppHandler on Android (not on desktop, since it's expensive there).
- Convince Google Play Services to auto-unsubscribe registrations when data is cleared for an app. But this probably doesn't make sense for most Android apps which only have a single GCM subscription.

It's not clear that either of these is worthwhile though, since the existing automatic unsubscription will eventually clean things up as long as the user subscribes to push on any website.
Screenshot_20170207-180027.png
184 KB View Download

Sign in to add a comment