Skip to content

Commit

Permalink
fix(notifications): validate status code for UnrecognizedDeviceToken …
Browse files Browse the repository at this point in the history
…error
  • Loading branch information
thevaibhav-dixit committed Feb 13, 2024
1 parent 7611bb4 commit a186dae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/notifications/src/executor/fcm/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ impl From<google_fcm1::Error> for FcmError {
fn from(err: google_fcm1::Error) -> Self {
match err {
google_fcm1::Error::BadRequest(ref value) => {
if value["error"]["status"].as_str() == Some("NOT_FOUND")
if value["error"]["code"].as_u64() == Some(404)
&& value["error"]["status"].as_str() == Some("NOT_FOUND")
&& value["error"]["details"]
.as_array()
.map_or(false, |details| {
Expand Down

0 comments on commit a186dae

Please sign in to comment.