From c8ec2261a99590f15699e9147a28e4b61c1c2ea5 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 3 May 2022 02:27:42 +0000 Subject: [PATCH] Fix sending empty notifications (#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 a36bbc6b42..0f6b90b05d 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.Doer, targetStatus)