Skip to content

Commit 9d55881

Browse files
committed
add logging for notifications processing
1 parent 8c86aaa commit 9d55881

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

connect/connectNotificationServer.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,12 @@ const handler = (topic, message, logger, callback) => {
339339
getNotificationsForMentionedUser(eventConfig, message.postContent),
340340
getProjectMembersNotifications(eventConfig, project),
341341
getTopCoderMembersNotifications(eventConfig),
342-
]).then((notificationsPerSource) => (
342+
]).then((notificationsPerSource) => {
343343
// first found notification for one user will be send, the rest ignored
344344
// NOTE all userId has to be string
345-
_.uniqBy(_.flatten(notificationsPerSource), 'userId')
346-
)).then((notifications) => (
345+
logger.debug('all notifications: ', notificationsPerSource);
346+
return _.uniqBy(_.flatten(notificationsPerSource), 'userId')
347+
}).then((notifications) => (
347348
excludeNotifications(notifications, eventConfig, message, {
348349
project,
349350
})
@@ -353,7 +354,7 @@ const handler = (topic, message, logger, callback) => {
353354
if (eventConfig.includeUsers && message[eventConfig.includeUsers] && message[eventConfig.includeUsers].length > 0) {
354355
allNotifications = _.filter(allNotifications, notification => message[eventConfig.includeUsers].includes(notification.userId));
355356
}
356-
357+
logger.debug('filtered notifications: ', allNotifications);
357358
// now let's retrieve some additional data
358359

359360
// if message has userId such messages will likely need userHandle and user full name

0 commit comments

Comments
 (0)