You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: implement unique Message-ID generation and clean function naming
Enhanced email parsing with database safety and consistent naming:
**Function Naming Consistency:**
- Rename parse_email_headers() → parse_email() for cleaner, more accurate naming
- Function name now matches file name and purpose (parse complete email)
- Updated all references and test function names
**Unique Message-ID Generation:**
- Fix database UNIQUE constraint violation for missing Message-ID headers
- Generate unique IDs: "generated-{timestamp}-{content_hash}" format
- Uses timestamp + content hash for guaranteed uniqueness without external deps
- Prevents database conflicts when multiple emails lack Message-ID headers
**Type Architecture Analysis:**
- Confirmed ParsedEmail is optimal for database/IMAP operations (26 fields)
- Validated raw message transmission for P2P (RFC 5322 compliance)
- No duplication with mail-parser types (different purposes: parsing vs business logic)
- Clean separation: mail-parser for parsing, our types for storage/business logic
**Code Organization:**
- Helper function pattern established for address extraction (TODO: implement)
- Simplified parsing approach while mail-parser API is clarified
- Maintained modular structure with focused responsibilities
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
0 commit comments