Background
BackEnd/src/modules/notifications/notifications.service.ts persists and dispatches every event, so bursts of identical events (e.g. repeated status changes for the same entity) create duplicate rows and redundant sends, adding database and provider load.
Implementation Plan
- Compute a dedupe key (
recipient+type+entityId) and guard inserts/dispatches with a short-window in-memory or Redis marker in notifications.service.ts
- Collapse duplicates that arrive within the window into a single notification
- Add benchmarks/metrics capturing before/after impact
- Add regression tests where applicable
- Document the change
Acceptance Criteria
Background
BackEnd/src/modules/notifications/notifications.service.tspersists and dispatches every event, so bursts of identical events (e.g. repeated status changes for the same entity) create duplicate rows and redundant sends, adding database and provider load.Implementation Plan
recipient+type+entityId) and guard inserts/dispatches with a short-window in-memory or Redis marker innotifications.service.tsAcceptance Criteria