From a462697b30d7d30ab6a3c717d90ca5f679056642 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 2 Sep 2024 23:34:45 +0200 Subject: [PATCH] fix(notifications): only add project subscription as task subscription when the user is not already subscribed to the task Before this fix, a project subscription object was added twice to the list of subscriptions for a task when the user did not subscribe to the task directly. This caused the user to receive a comment notification twice for a given task. This was probably a regression from efde364224. Resolves https://community.vikunja.io/t/e-mail-notification-twice/2740/18 (cherry picked from commit 2c9becec101c14dd744444fffe244510e8394323) --- pkg/models/subscription.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/models/subscription.go b/pkg/models/subscription.go index 109c580fe..4bd3761c1 100644 --- a/pkg/models/subscription.go +++ b/pkg/models/subscription.go @@ -259,7 +259,7 @@ func GetSubscriptions(s *xorm.Session, entityType SubscriptionEntityType, entity delete(subs, task.ID) } - if !hasTaskSub { + if !hasTaskSub && !hasProjectSub { subs[task.ID] = psub } }