Differentiate remove device error from push proxy (#27998)

* Differentiate remove device error from push proxy

* Fix variable name
Этот коммит содержится в:
Daniel Espino García
2024-08-23 17:43:47 +02:00
коммит произвёл GitHub
родитель 62adae14d1
Коммит e121bebba5
3 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@@ -47,11 +47,15 @@ func (a *App) NotifySessionsExpired() error {
errPush := a.sendToPushProxy(tmpMessage, session)
if errPush != nil {
a.CountNotificationReason(model.NotificationStatusError, model.NotificationTypePush, model.NotificationReasonPushProxySendError, tmpMessage.Platform)
reason := model.NotificationReasonPushProxySendError
if errPush.Error() == notificationErrorRemoveDevice {
reason = model.NotificationReasonPushProxyRemoveDevice
}
a.CountNotificationReason(model.NotificationStatusError, model.NotificationTypePush, reason, tmpMessage.Platform)
a.NotificationsLog().Error("Failed to send to push proxy",
mlog.String("type", model.NotificationTypePush),
mlog.String("status", model.NotificationStatusNotSent),
mlog.String("reason", model.NotificationReasonPushProxySendError),
mlog.String("reason", reason),
mlog.String("ack_id", tmpMessage.AckId),
mlog.String("push_type", tmpMessage.Type),
mlog.String("user_id", session.UserId),