From ae9a4fb850a0e19e6e613ff88a87722a2069aa10 Mon Sep 17 00:00:00 2001
From: Carina Antunes <carina.oliveira.antunes@cern.ch>
Date: Mon, 21 Mar 2022 14:43:12 +0100
Subject: [PATCH] [hotfix] send-notification: subscribe groups from targets

---
 src/services/impl/notifications/send-notification.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/services/impl/notifications/send-notification.ts b/src/services/impl/notifications/send-notification.ts
index a2ccbaff..993d73a8 100644
--- a/src/services/impl/notifications/send-notification.ts
+++ b/src/services/impl/notifications/send-notification.ts
@@ -278,13 +278,13 @@ export class SendNotification implements Command {
         targetGroups.push(group);
 
         if (intersection) return;
-        if (group && channel.groups.some(group => group.groupIdentifier === group.groupIdentifier)) return;
+        if (group && channel.groups.some(g => g.groupIdentifier === group.groupIdentifier)) return;
 
         groupsToSubscribe.push(group);
       }),
     );
 
-    if (intersection) {
+    if (intersection || !groupsToSubscribe) {
       return targetGroups;
     }
 
-- 
GitLab