Repository navigation
feat: an email is on record the moment its job is queued, and a failed or bounced one can be resent - #2425
Merged
Conversation
…d or bounced one is made again for the person's current address Queuing an email job writes its Queued record in the queuing transaction, so the board sees an email that will go and not only one that went. The send then fills that record in, and a job that breaks before it has anything to send marks the record failed. A job that sends one email says so through `EmailJob`, which is what lets the record be written before the job runs. A failed or bounced email can be made again for the address the person has now. The new email names the one it was made from. The api decides which emails that holds for and says so on each one: - only one that failed or bounced, so nobody gets a second copy of an email that went; - not while its own job will still try again, so the two cannot both send; - not one that holds a one-time link, such as a recovery email: its payload carries the link, which would go out again to whatever address the account has by then; - only one a job sends by itself, since a job that sends many would send them all again. Making an email again is one transaction, so a refusal after the job was queued takes the job back with it.
36 of 52 tasks
Contributor
Changes
1.28 test lines per prod line. Coverage
Patch coverage: 100.0%, 204 of 204 changed lines covered. |
The rule was a list of what may not be resent, and it named recovery alone. A security notice carries the link that locks an account and is meant for the address the account had, and a sign-up confirmation carries a guest's own link. Neither was on the list. A job now has to say that its email may be made again, and only the five whose payload holds no link or token do: role change, contribution reminder, incasso notice, joining contribution and sign-up removed.
Contributor
The SQL
|
This was referenced Oct 14, 2026
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.
Part of #2385 (step 5, first of seven). Brings back #1969 from the archive tag.
What this is
The old page (Sent, at
/management/emails) shows the Queued state and a Resend button. The new pages come with the next slice.How it works
EmailJoband says what it sends incompose. Nine jobs do: recovery, role change, security notice, contribution reminder, incasso notice, joining contribution, and the three event sign-up emails.JobQueued.QueuedEmailshears it and writes the Queued record in the queuing transaction. The send fills that record in. A job that breaks before it has anything to send marks the record failed.emails.resent_from_idand an index onemails.job_execution_id.What differs from the archive, and why
The archive's first cut is taken as it was (old #2043, applied onto the branch). Resend is reworked, because a review and the commit security check both found it unsafe:
resendable, and the page shows the button from that.EventSignUpAddedEmailJobis newer than the archive and now extendsEmailJobtoo.EmailServicethat nothing called are gone, as in the archive's later state.Known, not changed
How it was checked
services/api/src/mainandservices/frontend/srcis hit by a unit test, measured against jacoco and lcov.