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:
- 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
- Add a partial unique index
- Switch from the current checking to checking the new key
Email deduplication (used to avoid sending the same email multiple times when for instance sending reminder emails) is currently brittle and unoptimized:
email_logstable to figure out if email has already been sentShould reasonably be fixed in a 3-step rollout:
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