Harden job-application tracker: backend fixes, tests, UI rework
Deploy with Docker Compose / deploy (push) Successful in 1m8s
Deploy with Docker Compose / deploy (push) Successful in 1m8s
Backend (email sync + resolvers): - Sync window anchored on latest received_at with slack + rewind age-out - Skip ctx-cancelled per-email side effects - Soft-deleted applications no longer block pipeline matching - Status normalization shared between pipeline and resolvers, with tests - Reject empty jobTitle/company on create/update - IMAP fallback synthesizes Message-ID from stable message traits - Consistent list ordering with id tie-break Frontend (JobApplications.vue): - Unified status vocabulary with pipeline (lowercase keys) - Emptied optional fields now clear on save; row stays open on failure - URL editable, notes textarea, appliedAt defaults to today - Error banner, delete confirmations, inline status select - Search, sortable columns, status-count filter tiles, stale-row marker - CSV export with UTF-8 BOM + CRLF Tests: stdlib table-driven tests for sync, status, auth, handlers. Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
@@ -2,7 +2,9 @@ package services
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"crypto/sha256"
|
||||
"crypto/tls"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
@@ -308,8 +310,19 @@ func parseRawEmail(raw string) (graphMessage, error) {
|
||||
// Extract body text
|
||||
bodyContent := extractTextBody(msg.Header, msg.Body)
|
||||
|
||||
// Dedup is keyed on GraphMessageID: a missing Message-ID header would
|
||||
// yield "", which collides every headerless message onto one shared row
|
||||
// (the first one processed, forever). Synthesise an id from stable
|
||||
// message traits instead — hashing because From/Date/Subject/size are not
|
||||
// unique alone but their combination is stable across retries.
|
||||
msgID := header.Get("Message-ID")
|
||||
if msgID == "" {
|
||||
hash := sha256.Sum256([]byte(fromAddr + "|" + dateStr + "|" + header.Get("Subject") + "|" + bodyContent))
|
||||
msgID = "synth-" + hex.EncodeToString(hash[:8])
|
||||
}
|
||||
|
||||
return graphMessage{
|
||||
ID: header.Get("Message-ID"),
|
||||
ID: msgID,
|
||||
Subject: decodeHeader(header.Get("Subject")),
|
||||
ReceivedDateTime: parsedDate.Format(time.RFC3339),
|
||||
From: graphFrom{
|
||||
|
||||
Reference in New Issue
Block a user