Skip to content

Make email deduplication more robust #13457

Description

@joebon

Email deduplication (used to avoid sending the same email multiple times when for instance sending reminder emails) is currently brittle and unoptimized:

  • Uses non-indexed metadata on email_logs table to figure out if email has already been sent

Should reasonably be fixed in a 3-step rollout:

  1. Add a nullable deduplication key column to email_logs, along with code that populates it for new emails and with a backfill script. Nullable should be kept because not all emails require a deduplication key
  2. Add a partial unique index
  3. Switch from the current checking to checking the new key

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions