From 82f24bedc266e8817ff9930678fe60fcc7bd71a4 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 3 May 2022 02:28:12 +0000 Subject: [PATCH] Fix sending empty notifications (#19589) (#19590) - 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 30357ebd3f..936647e12b 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)