From 1b3d1520a2b7daf8e2d0331b0aba1919c833f1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Tue, 10 Sep 2024 10:57:30 +0200 Subject: [PATCH] Remove sender ID and log unavailable (#127) --- server/android_notification_server.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/android_notification_server.go b/server/android_notification_server.go index 02bd063..d96f951 100644 --- a/server/android_notification_server.go +++ b/server/android_notification_server.go @@ -26,7 +26,6 @@ const ( thirdPartyAuthError = "THIRD_PARTY_AUTH_ERROR" invalidArgument = "INVALID_ARGUMENT" quotaExceeded = "QUOTA_EXCEEDED" - senderIDMismatch = "SENDER_ID_MISMATCH" unregistered = "UNREGISTERED" unavailable = "UNAVAILABLE" tokenSourceError = "TOKEN_SOURCE_ERROR" @@ -193,7 +192,7 @@ func (me *AndroidNotificationServer) SendNotification(msg *PushNotification) Pus errorCode, ) - if messaging.IsUnregistered(err) { + if messaging.IsUnregistered(err) || messaging.IsSenderIDMismatch(err) { me.logger.Infof("Android response failure sending remove code: type=%v", me.AndroidPushSettings.Type) if me.metrics != nil { me.metrics.incrementRemoval(PushNotifyAndroid, pushType, unregistered) @@ -209,10 +208,10 @@ func (me *AndroidNotificationServer) SendNotification(msg *PushNotification) Pus reason = invalidArgument case messaging.IsQuotaExceeded(err): reason = quotaExceeded - case messaging.IsSenderIDMismatch(err): - reason = senderIDMismatch case messaging.IsThirdPartyAuthError(err): reason = thirdPartyAuthError + case messaging.IsUnavailable(err): + reason = unavailable default: reason = "unknown transport error"