From d75c3483389ff06a4e5bb8f4b40156ce858d1735 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 3 May 2022 03:12:25 +0200 Subject: [PATCH] Fix sending empty notifications (#19589) - Backport #19589 - Don't send empty notifications on read notifications API. --- routers/api/v1/notify/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/notify/repo.go b/routers/api/v1/notify/repo.go index 30357ebd3f88d..936647e12b7eb 100644 --- a/routers/api/v1/notify/repo.go +++ b/routers/api/v1/notify/repo.go @@ -214,7 +214,7 @@ func ReadRepoNotifications(ctx *context.APIContext) { targetStatus = models.NotificationStatusRead } - changed := make([]*structs.NotificationThread, len(nl)) + changed := make([]*structs.NotificationThread, 0, len(nl)) for _, n := range nl { notif, err := models.SetNotificationStatus(n.ID, ctx.User, targetStatus)