parse-community / parse-community/parse-server-push-adapter
Android device still receives push from old installationId after app re-installed
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 96
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Description
I'm seeing the same issue that @jiawenzhang had in https://github.com/ParsePlatform/parse-server/issues/1705
Here is the issue:
- Install app on Android phone, open app and register with parse-server (as user A), get installationId_1
- Uninstall app and re-install app on the same phone, open app and register with parse-server (as user B), get installationId_2.
Note that the app on this phone is now associated with installationId_2 (as user B). The installationId_1 should not be valid.
- Now send a push notification to the parse-server targeting installationId_1, the app still receives the push even when its installationId is not installationId_1.
The parse-server is showing the following in the log:
verb parse-server-push-adapter GCM sending to 1 devices
verb parse-server-push-adapter GCM GCM Response: {
verb parse-server-push-adapter GCM "multicast_id": 7047466558839750000,
verb parse-server-push-adapter GCM "success": 1,
verb parse-server-push-adapter GCM "failure": 0,
verb parse-server-push-adapter GCM "canonical_ids": 1,
verb parse-server-push-adapter GCM "results": [
verb parse-server-push-adapter GCM {
verb parse-server-push-adapter GCM "registration_id": "APA91bEB01Bmhz3g0ZMRqBJIwg-DbQzNnvYeZxJKoj0ixVYFBW9UN2zQIMiDV86FWDDqHlJInaA9h_Mb-xV3tfCUNk2mpUdAjeYi7AdM6ggImQbATHKEp24Xg7yyS76nNLH1UDXqiMxP",
verb parse-server-push-adapter GCM "message_id": "0:1475256512754990%d7f644cef9fd7ecd"
verb parse-server-push-adapter GCM }
verb parse-server-push-adapter GCM ]
verb parse-server-push-adapter GCM }
According to GCM, the app-server (parse-server) should be updated to use the registration_id that was returned:
https://developers.google.com/cloud-messaging/registration#how-uninstalled-client-app-unregistration-works
The problem is I don't want any notifications to be successfully sent with the installationId_1.
If I try to duplicate this same issue with the production api.parse.com and SDK, I can't duplicate it.
NOTE: GCM states "Eventually, the registration token (installationId_1) will be removed and the server will get a NotRegistered error" - Does anyone know how long this would take?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Android uninstall/reinstall sequence described in the issue and read the linked GCM registration-token documentation. Inspect the push adapter's handling of the GCM response, especially canonical_ids and the returned registration_id; done means pushes targeted at installationId_1 no longer reach the reinstalled app and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100