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

fix(notifications): remove device tokens when bad request response #3991

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

thevaibhav-dixit
Copy link
Contributor

No description provided.

let res = self.fcm.send(&device_token, &msg, event.deep_link()).await;
if let Err(e) = res {
match e {
FcmError::GoogleFcm1Error(google_fcm1::Error::BadRequest(_)) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure every BadRequest is due to the token?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel we should report the error in the span as an event to know what happened

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the errors so far indicate. the underlying library google_fcm1 does not have any explicit error for when registration tokens are unregistered. The error enum contains BadRequest(Value)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I've added tracing so we can investigate

@bodymindarts bodymindarts merged commit 1f330dc into main Feb 13, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants