From eed5c215868cc103747571e831dd9cdd37259ee7 Mon Sep 17 00:00:00 2001 From: Trey t Date: Wed, 26 Nov 2025 23:31:00 -0600 Subject: [PATCH] Fix: completer gets email but not push notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Push notification: sent to all users EXCEPT completer - Email: sent to ALL users INCLUDING completer 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- internal/services/task_service.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/services/task_service.go b/internal/services/task_service.go index 2a7828b..b3b82bb 100644 --- a/internal/services/task_service.go +++ b/internal/services/task_service.go @@ -519,14 +519,12 @@ func (s *TaskService) sendTaskCompletedNotification(task *models.Task, completio "completion_id": completion.ID, } - // Notify all users except the one who completed the task + // Notify all users for _, user := range users { - if user.ID == completion.CompletedByID { - continue // Don't notify the person who completed it - } + isCompleter := user.ID == completion.CompletedByID - // Send push notification - if s.notificationService != nil { + // Send push notification (to everyone EXCEPT the person who completed it) + if !isCompleter && s.notificationService != nil { go func(userID uint) { ctx := context.Background() if err := s.notificationService.CreateAndSendNotification( @@ -542,7 +540,7 @@ func (s *TaskService) sendTaskCompletedNotification(task *models.Task, completio }(user.ID) } - // Send email notification + // Send email notification (to everyone INCLUDING the person who completed it) if s.emailService != nil && user.Email != "" { go func(u models.User) { if err := s.emailService.SendTaskCompletedEmail(