tcef-notifications/test
vjrj 6d1ba439a2 fix(poller): stop infinite re-enqueue of unsendable notifications
In shadow/dry-run/kill-switch modes, when the target has no token/recipient/
chat, or when not in the canary cohort, the handlers returned without marking
the notification, so the poller (pendingFilter on notified:{$ne:true})
re-selected the same batch every cycle forever (observed: fcm:500 every 10s).

Add a service-owned per-channel marker processedBy.<channel>, set in every
terminal 'won't/can't send' branch, and exclude marked docs in pendingFilter.
Unlike the shared notified/emailNotified/telegramNotified flags, processedBy is
invisible to the old system, so it never suppresses a real send in prod shadow.

- types.ts: NotificationDoc.processedBy?: Partial<Record<Channel, Date>>
- poller.ts: pendingFilter excludes processedBy.<channel>
- handlers.ts: markProcessed() in no-token/no-recipient/no-chat, decideSend=false,
  dead-token and telegram-blocked branches
- fake-repo: dotted-path support in matching and $set/$unset
- tests: regression test + processedBy assertions (86 passing)
2026-07-23 23:47:13 +02:00
..
compare.test.ts Fase 1b: cableado del matcher (ingesta polling, runner shadow/full, comparador) 2026-07-13 18:07:06 +02:00
config.test.ts Fase 1a: microservicio tcef-notifications (workers FCM v1 + email) 2026-07-13 00:10:29 +02:00
fake-repo.ts fix(poller): stop infinite re-enqueue of unsendable notifications 2026-07-23 23:47:13 +02:00
handlers.test.ts fix(poller): stop infinite re-enqueue of unsendable notifications 2026-07-23 23:47:13 +02:00
helpers.ts Fase 1a: driver mongodb v3.7 (produccion es MongoDB 3.2) 2026-07-13 00:58:27 +02:00
mailer.test.ts Fase 1a: microservicio tcef-notifications (workers FCM v1 + email) 2026-07-13 00:10:29 +02:00
matcher-runner.test.ts Fase 1b: cableado del matcher (ingesta polling, runner shadow/full, comparador) 2026-07-13 18:07:06 +02:00
matcher.test.ts Fase 1b: nucleo del matcher geoespacial (caracterizado + testeado) 2026-07-13 17:58:43 +02:00
messages.test.ts Fase 1a: microservicio tcef-notifications (workers FCM v1 + email) 2026-07-13 00:10:29 +02:00
mode.test.ts Fase 1a: microservicio tcef-notifications (workers FCM v1 + email) 2026-07-13 00:10:29 +02:00
poller.test.ts fix(poller): stop infinite re-enqueue of unsendable notifications 2026-07-23 23:47:13 +02:00
queue.test.ts Fase 1a: fix jobId (BullMQ rechaza ':' en custom job id) 2026-07-13 08:40:38 +02:00
telegram.test.ts Fase 1c: canal Telegram (telegram-worker) — codigo migrado, inerte 2026-07-13 18:49:52 +02:00