From b982944e8513d928189c7fa12183129d845c2ee9 Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Mon, 20 Jan 2025 22:49:26 -0800 Subject: [PATCH] Restore treating all 5xx codes as temporary problems --- internal/webpush/realsender.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/webpush/realsender.go b/internal/webpush/realsender.go index 156078261..27641be04 100644 --- a/internal/webpush/realsender.go +++ b/internal/webpush/realsender.go @@ -208,7 +208,7 @@ func (r *realSender) sendToSubscription( case resp.StatusCode == http.StatusRequestTimeout || resp.StatusCode == http.StatusRequestEntityTooLarge || resp.StatusCode == http.StatusTooManyRequests || - resp.StatusCode == http.StatusServiceUnavailable: + (resp.StatusCode >= 500 && resp.StatusCode <= 599): // Try to get the response body. bodyBytes, err := io.ReadAll(io.LimitReader(resp.Body, responseBodyMaxLen)) @@ -223,7 +223,7 @@ func (r *realSender) sendToSubscription( string(bodyBytes), ) - // Some serious error that indicates auth problems. + // Some serious error that indicates auth problems, not a Web Push server, etc. // We should not send any more notifications to this subscription. Try to delete it. default: err := r.state.DB.DeleteWebPushSubscriptionByTokenID(ctx, subscription.TokenID)