-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FEAT] Delete user token and associated notifications on DEVICE UNREGISTER event #246
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We have received similar messages, with response message: {
"error": {
"message": "The registration token is not a valid FCM registration token",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
"errorCode": "INVALID_ARGUMENT"
}
]
}
} I'm wondering if whenever an app gets updated / reinstalled, also the FCM token gets updated or that we will send messages to the old app and those will not arrive. It would help to add the project ID and user ID to the log messages, to be able to debug which messages failed to deliver. |
I think in your case this could be due to an invalid token (like an empty string)? Are you getting this very frequently and what version of appserver are you on? The issue mentioned here was fixed already in #263 and now we delete all the notifications/data messages for the user and remove the fcm token whenever a DEVICE UNREGISTER error is received (code is here). |
We're not getting it frequently, but we're missing some notifications for a particular user, and we get this error message is at the same time that the notification should have arrived. So either the questionnaire app did not correctly update the FCM token or the Appserver didn't. In particular, I'm not sure about this code:
|
This function just updates the FCM token to an invalid value when a DEVICE UNREGISTER error is received. This adds a timestamp as the token so it can be investigated. All the notifications are deleted before the token is invalidated. |
Is your feature request related to a problem? Please describe.
There are several errors when sending notifications because the devices could be unregistered and there is no handling of this error code.
Describe the solution you'd like
When a notification is sent to a device that is unregistered, FCM SDK reports its error code. This can be used to delete the FCM token for the user and also delete any scheduled notifications for them
The change can be added here
RADAR-Appserver/src/main/java/org/radarbase/appserver/service/scheduler/MessageSchedulerService.java
Line 237 in f4201d4
will also require adding a parameter of type
Message
tohandleFCMErrorCode
so can get details on the user fromRADAR-Appserver/src/main/java/org/radarbase/appserver/service/scheduler/NotificationSchedulerService.java
Line 102 in f4201d4
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Priority
2
Difficulty
3
Additional context
Relevant Logs-
The text was updated successfully, but these errors were encountered: