From c587dd3d08221d01d5da0a1acab660cc42a6d26e Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Thu, 6 Nov 2025 02:14:52 +0900 Subject: [PATCH] appview/notify/db: set hard-limit to @-mention notification Change-Id: lnywuqvokvykloltqynnxvkutznntxwo Signed-off-by: Seongmin Lee --- appview/notify/db/db.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/appview/notify/db/db.go b/appview/notify/db/db.go index 16c67ca0..7ef9321a 100644 --- a/appview/notify/db/db.go +++ b/appview/notify/db/db.go @@ -13,6 +13,10 @@ import ( "tangled.org/core/idresolver" ) +const ( + maxMentions = 5 +) + type databaseNotifier struct { db *db.DB res *idresolver.Resolver @@ -421,6 +425,9 @@ func (n *databaseNotifier) notifyEvent( issueId *int64, pullId *int64, ) { + if eventType == models.NotificationTypeUserMentioned && len(recipients) > maxMentions { + recipients = recipients[:maxMentions] + } recipientSet := make(map[syntax.DID]struct{}) for _, did := range recipients { // everybody except actor themselves -- 2.43.0