Bugfix/job application email identifier bugs - #89
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
Fix Application Status Lifecycle and History Audit Trail
Overview
This PR standardizes system statuses, fixes background polling bugs that incorrectly matched emails to terminal applications, and bulletproofs the application history audit trail. Previously, automated email polling was silently updating application statuses directly in the database without logging history, leading to desynchronized activity logs and incorrect "Last Updated" dates.
Changes Made
1. Status Standardization
follow_upstatus. It is now functionally treated asApplied.Applied,Screening,Assessment,Interviewing,Offer,Rejected) to match the exact strings expected by the UI.2. Bulletproofed History Logging
mail-poller.service.jsto callapplicationsService.updateApplicationinstead of performing direct database updates (applicationRepo.update). This ensures that status changes triggered by incoming emails properly insert newapplication_historyevents.applications.service.jsto explicitly registerApplication Addedevents viaapplicationHistoryService.logChangewhen applications are created (single or bulk imports).3. Fixed Email Matching for Terminal Applications
mail-poller.service.jsto filter out terminal applications (Rejected,Offer,Hired,Withdrawn,Ignored) before classifying emails. This resolves a bug where a new rejection email would incorrectly match an older, already-rejected application for the same company, overwriting itsevent_date.4. Database Migrations & Resync Scripts
fix_follow_up_status.jsto migrate existingfollow_upstatuses toAppliedin the DB.sync_applications_history.jsto fix corrupted database state by fetching the latestapplication_historyevent for each application and resyncing thestatus,stage, anddatefields in theapplicationstable.5. Testing Infrastructure Updates
email-pipeline.integration.test.js,application-lifecycle.integration.test.js) and unit tests to adhere strictly to the Title Case constraint.setup.integration.jsto support chained, sequential.select().single()mock responses to handle complex repository queries during testing.Verification
npm testlocally).application_historytable correctly.