Skip to content
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

[FEATURE] Remove invalid FCM tokens #116

Open
shurwit opened this issue Nov 30, 2022 · 1 comment
Open

[FEATURE] Remove invalid FCM tokens #116

shurwit opened this issue Nov 30, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@shurwit
Copy link
Collaborator

shurwit commented Nov 30, 2022

Is your feature request related to a problem? Please describe.
Currently we accumulate FCM tokens indefinitely which leads to significant unnecessary overhead when notifications are sent.

Describe the solution you'd like
We should remove tokens that are no longer valid to reduce the clutter. It looks like we may receive a specific error message from Firebase when we attempt to send to an invalid token:

http error status: 404; reason: app instance has been unregistered; code: registration-token-not-registered; details: Requested entity was not found.

There may be other cases in which we want to remove these tokens as well but we will need to be careful not to remove them based on errors that are due to a temporary state.

@shurwit
Copy link
Collaborator Author

shurwit commented Feb 14, 2024

Hi @martin-rokmetro, you can find the function call that sends the notification to a specific token that may return the error mentioned above here:

sendErr := q.firebase.SendNotificationToToken(queueItem.OrgID, queueItem.AppID, token, queueItem.Subject, queueItem.Body, queueItem.Data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants