Repository navigation
fix(outreach): keep failed send occurrences out of due batches - #59
Merged
debpalash merged 1 commit intoOct 7, 2026
Conversation
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
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.
What & why
A transient failed send persists an at-most-once send ledger row but leaves the enrollment pending. The bounded due-enrollment query then repeatedly returns that blocked occurrence first; enqueue refuses its existing send record, so later valid leads can never reach the ticker when the candidate limit is filled by old failures.
Mark a newly failed sequence enrollment terminal with its error. Exclude already-recorded current-step occurrences before the due candidate limit, allowing existing deployments' pending enrollments with failed send rows to stop blocking later work. Correlation includes workspace, sequence, enrollment and current step, so a sent previous step does not hide the next due step. Existing at-most-once retry semantics remain intact: a failed send retains terminal send state, and queue replay makes no extra SMTP handoff.
Type
Verification
uv run --frozen pytest -q -m 'not live and not postgres'). Pristine baseline: 1,878 passed.Checklist
Security-sensitive?
Ordinary terminal enrollment state and queue candidate selection only. No transport, sender retry, charge, auth, secrets, tenancy policy, suppression or URL guard changes.
AI assistance was used for implementation and native tests. The exact signed source packet received independent review before publication.