From 39415808bfd2d5839d1ab682deb589387e760221 Mon Sep 17 00:00:00 2001 From: vjrj Date: Mon, 13 Jul 2026 00:10:39 +0200 Subject: [PATCH] Fase 1a: flag de cutover notifDisabledChannels en processNotif Guard reversible al inicio de processNotif: los canales listados en settings.private.notifDisabledChannels (p.ej. ['mobile','web']) los gestiona el microservicio tcef-notifications, y el observer/cron viejos los ignoran. Exclusion mutua por canal sin desplegar codigo (solo editar settings). ES5-compatible (Meteor 1.6 / Node 8). --- imports/modules/server/notificationsProcess.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/imports/modules/server/notificationsProcess.js b/imports/modules/server/notificationsProcess.js index e78f426..657aa2a 100644 --- a/imports/modules/server/notificationsProcess.js +++ b/imports/modules/server/notificationsProcess.js @@ -43,7 +43,18 @@ function imgUrl(lat, lng) { return ``; } */ +// Cutover flag (fase 1a): channels listed in +// Meteor.settings.private.notifDisabledChannels (e.g. ['mobile','web']) are +// handled by the tcef-notifications microservice, so the old observer/cron must +// NOT send them. Mutual exclusion per channel — reversible by editing settings, +// no code deploy needed. ES5-compatible on purpose (Meteor 1.6 / Node 8). +const notifDisabledChannels = (Meteor.settings.private && Meteor.settings.private.notifDisabledChannels) || []; + const processNotif = (notif) => { + if (notifDisabledChannels.indexOf(notif.type) !== -1) { + // This channel was migrated to tcef-notifications; do nothing here. + return; + } if (isMailServerMaster && validFcmSender && notif.type === 'mobile' && notif.notified !== true) { const fcmSender = new gcm.Sender(Meteor.settings.private.fcmApiToken); const user = Meteor.users.findOne({ _id: notif.userId });