notif: remove code migrated to tcef-notifications microservice

The push/email notification processing now lives in the tcef-notifications
service (fases 1a-1c). Removed from the web:
- imports/startup/server/notificationsObserver.js (observe Notifications -> processNotif)
- imports/modules/server/notificationsProcess.js (node-gcm push + notif emails)
- the 'Process pending notif' SyncedCron job in cron.js
- node-gcm dependency (dead Google API since jun-2024)

subsUnion.js is KEPT: it feeds the subs-public-union SiteSettings that the REST
API (status/subs-public-union) serves to the Flutter app; it is not part of the
notifications pipeline.

DEPLOY ORDERING (see UPGRADE.md): production must not run this build until the
tcef-notifications service is emitting in prod — otherwise notifications stop.
REST smoke test green (byte-identical).
This commit is contained in:
vjrj 2026-07-13 19:45:13 +02:00
parent 296dab4f38
commit dc8a05a0d4
5 changed files with 5 additions and 199 deletions

View file

@ -4,8 +4,6 @@
import { Meteor } from 'meteor/meteor';
import { tweetIberiaFires, tweetEuropeFires } from '/imports/api/ActiveFires/server/tweetFiresInZone';
import { isMailServerMaster, sendEmailsFromQueue } from '/imports/startup/server/email';
import Notifications from '/imports/api/Notifications/Notifications';
import processNotif from '/imports/modules/server/notificationsProcess.js';
// https://github.com/thesaucecode/meteor-synced-cron/
@ -55,29 +53,11 @@ Meteor.startup(() => {
job: () => sendEmailsFromQueue()
});
SyncedCron.add({
name: 'Process pending notif',
timezone: 'Europe/Madrid',
schedule: (parser) => {
// http://bunkat.github.io/later/
const sched = parser.text('every 15 min');
if (sched.error !== -1) {
console.error(`Mail cron 'when' field parsed with errors: ${sched.error}`);
}
return sched;
},
job: () => {
const mobileNotif = Notifications.find({ nofitied: null, type: 'mobile' });
mobileNotif.forEach((notif) => {
processNotif(notif);
});
const emailNotif = Notifications.find({ emailNofitied: null, type: 'web' });
emailNotif.forEach((notif) => {
processNotif(notif);
});
return { mobile: mobileNotif.count(), web: emailNotif.count() };
}
});
// NOTE: the "Process pending notif" job (push via node-gcm + notification
// emails) was removed here — that responsibility now lives in the
// tcef-notifications microservice (fases 1a-1c). See UPGRADE.md for the
// deploy-ordering dependency (the old code must not be shut off in
// production until the new service is emitting).
}
const esEn = Meteor.settings.private.twitter.es.enabled;

View file

@ -8,7 +8,6 @@ import './fixtures';
import './email';
import './IPGeocoder';
import './migrations';
import './notificationsObserver';
import './facts';
import './comments';
import './sitemaps';

View file

@ -1,19 +0,0 @@
/* eslint-disable import/no-absolute-path */
import { Meteor } from 'meteor/meteor';
import Notifications from '/imports/api/Notifications/Notifications';
import processNotif from '/imports/modules/server/notificationsProcess.js';
import { isMailServerMaster } from '/imports/startup/server/email';
Meteor.startup(() => {
if (isMailServerMaster) {
Notifications.find().observe({
added: function notifAdded(notif) {
processNotif(notif);
},
changed: function notifChanged(updatedNotif) { // , oldNotif) {
processNotif(updatedNotif);
}
});
}
});