Email Async Backend - #82
Open
isabellalam12 wants to merge 2 commits into
Open
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
isabellalam12
changed the base branch from
email-async-frontend
to
graphite-base/82
August 17, 2026 21:03
isabellalam12
force-pushed
the
email-async-backend
branch
from
August 17, 2026 21:03
114d7ce to
ce53f24
Compare
isabellalam12
force-pushed
the
graphite-base/82
branch
from
August 17, 2026 21:03
75f0444 to
6e2e2a1
Compare
isabellalam12
force-pushed
the
email-async-backend
branch
from
August 17, 2026 21:06
ce53f24 to
56fc6a4
Compare
Plan and implement asynchronous email backend and UI. Swap to database-backed templates. Fix backend and frontent tests Remove MatchingSendPage and dedupe sending
isabellalam12
force-pushed
the
email-async-backend
branch
from
August 17, 2026 21:09
56fc6a4 to
4fce3f3
Compare
isabellalam12
force-pushed
the
email-async-backend
branch
from
August 19, 2026 15:32
d14ca7a to
ebd603a
Compare
|
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(); |
There was a problem hiding this comment.
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:
- The method name and documentation in
TemplateManagementService.java(line 80-82) which states it "soft-deletes a template" - The decision in
docs/email-async/05-template-management.mdwhich recommends "block delete if any row references it (or add adeleted_atsoft-delete flag)" - 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
Is this helpful? React 👍 or 👎 to let us know.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Plan and implement asynchronous email backend and UI. Swap to database-backed templates.
Fix backend and frontent tests
Remove MatchingSendPage and dedupe sending