Repository navigation
Fix/application email failure bug - #121
Open
sriya-veluri wants to merge 5 commits into
Open
sriya-veluri wants to merge 5 commits into
sriya-veluri wants to merge 5 commits into
Conversation
Collaborator
|
The status model and confirm-before-retry flow look good. Two bugs to fix in ATSController.ts before merge: Late send overwrites a newer result (~line 2110). The save() after the SMTP call lets a slow older attempt overwrite a newer one. I reproduced a 550 rejection turning into accepted. Fix: give each attempt an id and write the result with a conditional updateOne on that id and status: "pending". Please add a test for each. Also, master now has #81’s TanStack Query rewrite of the recruitment screen, so the UI part needs porting. I have a merged version if you want it. |
This branch has not been deployed
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.
Summary
Persist email delivery status and the original message request when an applicant is moved to Interview or Rejected.
Return delivery status and error details to the recruitment dashboard.
Add a retry action that resends the saved message without repeating the stage change.
Require confirmation before retrying an email whose delivery outcome is uncertain.
Behavior
Email delivery status is recorded as pending, accepted, failed, or uncertain. Clear SMTP acceptance/rejection and known pre-delivery failures are classified from the transport result; ambiguous send errors such as timeouts are marked uncertain to avoid implying the email definitely was not delivered.
The retry endpoint only accepts failed or uncertain deliveries. Uncertain retries require confirmation because the first message may already have reached the SMTP server. Retries reuse the saved email request and do not add another stage-history entry.
This change covers the existing Interview and Rejected stage emails. It does not modify the Hired flow, invite creation, or stage transitions.
Validation
./nx run pplserver:build --excludeTaskDependencies — passed
./nx run pplserver:test-integration --excludeTaskDependencies — passed (16 tests)
./nx run pplui:build --excludeTaskDependencies — passed; emitted existing warnings about a duplicate pk, a Lexical export, and bundle size
git diff --check — passed
Mailpit SMTP smoke test — passed; the portal EmailClient sent a synthetic .invalid recipient message and Mailpit confirmed it was captured
The integration tests cover persisted status, SMTP rejection, timeout/uncertain handling, confirmation, and retry without repeating the stage change.
Closes #101