Skip to content

Conversation

@amandazhuyilan
Copy link
Contributor

@amandazhuyilan amandazhuyilan commented Nov 20, 2025

Description

AAI-461: Remove unused send_email flag and set up email queue in DB

Changes

  • removes the Settings.send_email flag so there’s no configuration gate keeping emails from being dispatched (we will do this through AWS IAM)
  • Removed previously added EmailService background task
  • Added a durable email queue:
    • introduced EmailStatusEnum, the EmailNotification model with queue helpers
    • a scheduler task and job wiring. Pending emails are persisted, retried with backoff, and emitted periodically by APScheduler.
    • Email resend in 300 seconds if unsuccessful
  • updated tests to validate queued emails and the new worker

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit / integration tests that prove my fix is effective or that my feature works
  • I have run all tests locally and they pass
  • I have updated the documentation (if applicable)
  • For any new secrets, I have updated the shared spreadsheet and the GitHub Secrets.

How to Test Manually (if necessary)

All updated and existing unit tests shall pass in CI!

marius-mather
marius-mather previously approved these changes Nov 20, 2025
Copy link
Collaborator

@marius-mather marius-mather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine for what it is (removing the config flag). Not sure if we want to work on a more robust email send service now, or leave that for later.

@amandazhuyilan amandazhuyilan force-pushed the fix-remove-send-email-var branch from 71e698a to b8cdd70 Compare November 20, 2025 03:30
@amandazhuyilan amandazhuyilan changed the title fix: remove send_email flag everywhere fix: remove send_email flag and set up email queue in DB Nov 20, 2025
marius-mather
marius-mather previously approved these changes Nov 20, 2025
Copy link
Collaborator

@marius-mather marius-mather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks pretty good to me - I've flagged a few things you could consider changing but otherwise approved.

Copy link
Collaborator

@marius-mather marius-mather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@amandazhuyilan amandazhuyilan merged commit 447872b into main Nov 20, 2025
4 checks passed
@amandazhuyilan amandazhuyilan deleted the fix-remove-send-email-var branch November 24, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants