Skip to content

Deduplicate identical notifications within a short window before persistence #2148

Description

@RUKAYAT-CODER

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

  • Measurable performance/efficiency improvement demonstrated with before/after numbers
  • No regression in existing functionality
  • Tests pass and code follows project standards
  • Change is documented

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions