From a124f1dc38f61fdf69f9b2039cc1ac2f16ad0693 Mon Sep 17 00:00:00 2001 From: Torsten Bronger Date: Thu, 11 Feb 2021 16:14:17 +0100 Subject: [PATCH] Changed default behaviour for BIGEVENTS that no activity matches it. Previously, all changes to due dates notified all board members. Now, you have to set the environment variable BIGEVENTS_PATTERN explicitly to "due" to restore this behaviour. By default, no activity is considered a "big event". Fixes . --- models/activities.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/models/activities.js b/models/activities.js index b5fcb7d8f..5bd4ae4f7 100644 --- a/models/activities.js +++ b/models/activities.js @@ -254,17 +254,19 @@ if (Meteor.isServer) { if (value) params[key] = value; }); if (board) { - const BIGEVENTS = process.env.BIGEVENTS_PATTERN || 'due'; // if environment BIGEVENTS_PATTERN is set or default, any activityType matching it is important - try { - const atype = activity.activityType; - if (new RegExp(BIGEVENTS).exec(atype)) { - watchers = _.union( - watchers, - board.activeMembers().map(member => member.userId), - ); // notify all active members for important events system defined or default to all activity related to due date + const BIGEVENTS = process.env.BIGEVENTS_PATTERN; // if environment BIGEVENTS_PATTERN is set, any activityType matching it is important + if (BIGEVENTS) { + try { + const atype = activity.activityType; + if (new RegExp(BIGEVENTS).exec(atype)) { + watchers = _.union( + watchers, + board.activeMembers().map(member => member.userId), + ); // notify all active members for important events + } + } catch (e) { + // passed env var BIGEVENTS_PATTERN is not a valid regex } - } catch (e) { - // passed env var BIGEVENTS_PATTERN is not a valid regex } const watchingUsers = _.pluck(