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): handle unrecognized device token in FcmError #3993

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

thevaibhav-dixit
Copy link
Contributor

No description provided.

fn from(err: google_fcm1::Error) -> Self {
match err {
google_fcm1::Error::BadRequest(ref value) => {
if value["error"]["status"].as_str() == Some("NOT_FOUND")
Copy link
Member

Choose a reason for hiding this comment

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

What happens if they keys don’t exist? Can we make this safer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean if we only want to check for the case where device_tokens are unregistered, then this should just suffice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can match against the error_codes that field should always be present. as specified here fcm v1 error codes

@thevaibhav-dixit thevaibhav-dixit merged commit f285a37 into main Feb 14, 2024
10 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