Skip to content

Email Async Backend - #82

Open
isabellalam12 wants to merge 2 commits into
mainfrom
email-async-backend
Open

Email Async Backend#82
isabellalam12 wants to merge 2 commits into
mainfrom
email-async-backend

Conversation

@isabellalam12

Copy link
Copy Markdown
Member

Plan and implement asynchronous email backend and UI. Swap to database-backed templates.

Fix backend and frontent tests

Remove MatchingSendPage and dedupe sending

This was referenced Aug 17, 2026

isabellalam12 commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@isabellalam12 isabellalam12 changed the title create email async plans Email Async Backend Aug 17, 2026
@isabellalam12
isabellalam12 changed the base branch from email-async-frontend to graphite-base/82 August 17, 2026 21:03
@isabellalam12
isabellalam12 changed the base branch from graphite-base/82 to main August 17, 2026 21:04
Plan and implement asynchronous email backend and UI. Swap to database-backed templates.

Fix backend and frontent tests

Remove MatchingSendPage and dedupe sending
@sonarqubecloud

Copy link
Copy Markdown

@isabellalam12
isabellalam12 marked this pull request as ready for review August 19, 2026 16:11
@isabellalam12
isabellalam12 requested a review from a team August 19, 2026 16:11
Comment on lines +59 to +62
public int softDelete(final UUID id) {
return jdbc.sql("DELETE FROM email_templates WHERE id = :id")
.param("id", id)
.update();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Critical Bug: Hard delete instead of soft delete

The softDelete method performs a hard DELETE instead of a soft delete (setting a deleted_at timestamp). This contradicts:

  1. The method name and documentation in TemplateManagementService.java (line 80-82) which states it "soft-deletes a template"
  2. The decision in docs/email-async/05-template-management.md which recommends "block delete if any row references it (or add a deleted_at soft-delete flag)"
  3. The requirement to preserve audit history mentioned in the service layer

This will cause:

  • Loss of audit trail when templates are deleted
  • Potential FK constraint violations if emails reference the deleted template
  • Inconsistency between documented and actual behavior

Fix:

@Override
public int softDelete(final UUID id) {
    return jdbc.sql("UPDATE email_templates SET deleted_at = NOW() WHERE id = :id AND deleted_at IS NULL")
            .param("id", id)
            .update();
}

Also add deleted_at TIMESTAMPTZ column to the email_templates table schema and update findAll() to filter out soft-deleted templates with WHERE deleted_at IS NULL.

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@graphite-app

graphite-app Bot commented Aug 19, 2026

Copy link
Copy Markdown

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (08/19/26)

2 reviewers were added to this PR based on Henry Chen's automation.

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.

1 participant