@@ -272,8 +272,9 @@ notificationServer.setConfig({ LOG_LEVEL: 'debug' });
272
272
// it is defined as: function(topic, message, callback),
273
273
// the topic is topic name,
274
274
// the message is JSON event message,
275
+ // logger object used to log in parent thread
275
276
// the callback is function(error, userIds), where userIds is an array of user ids to receive notifications
276
- const handler = ( topic , message , callback ) => {
277
+ const handler = ( topic , message , logger , callback ) => {
277
278
const projectId = message . projectId ;
278
279
if ( ! projectId ) {
279
280
return callback ( new Error ( 'Missing projectId in the event message.' ) ) ;
@@ -286,7 +287,9 @@ const handler = (topic, message, callback) => {
286
287
287
288
// filter out `notifications.connect.project.topic.created` events send by bot
288
289
// because they create too much clutter and duplicate info
289
- if ( topic === BUS_API_EVENT . CONNECT . TOPIC . CREATED && message . userId . toString ( ) === config . TCWEBSERVICE_ID ) {
290
+ const botIds = [ config . TCWEBSERVICE_ID , config . CODERBOT_USER_ID ] ;
291
+ if ( topic === BUS_API_EVENT . CONNECT . TOPIC . CREATED && botIds . contains ( message . userId . toString ( ) ) ) {
292
+ logger . info ( `Ignoring, to avoid noise, Bot topic ${ topic } ` ) ;
290
293
return callback ( null , [ ] ) ;
291
294
}
292
295
0 commit comments