Skip to content

Comments

Fix cold email blocker being skipped#983

Merged
elie222 merged 2 commits intomainfrom
fix/cold-email-blocker-skipped
Nov 17, 2025
Merged

Fix cold email blocker being skipped#983
elie222 merged 2 commits intomainfrom
fix/cold-email-blocker-skipped

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Nov 17, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved cold email sender detection by implementing email address normalization. This enhancement ensures accurate recognition of cold emails across various sender address formats and display name variations.
  • Tests

    • Added comprehensive unit tests to validate the cold email detection functionality and ensure consistent behavior across different email formats.
  • Chores

    • Version bump to v2.20.3.

@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Nov 17, 2025 9:45pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR adds sender address normalization to the cold email detection logic by extracting and normalizing the from field before database lookup, along with comprehensive unit tests verifying the normalization behavior across different email formats.

Changes

Cohort / File(s) Summary
Cold email detection logic
apps/web/utils/cold-email/is-cold-email.ts, apps/web/utils/cold-email/is-cold-email.test.ts
Introduces normalization of sender address in isKnownColdEmailSender by computing normalizedFrom = extractEmailAddress(from) || from and switching database lookups to use the normalized email. Adds comprehensive unit tests verifying normalization across different from field formats (with/without display names) and confirming previously labeled cold emails resolve correctly with reason "ai-already-labeled".
Version bump
version.txt
Updates version from v2.20.2 to v2.20.3.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Focus areas for review:
    • Verify extractEmailAddress() correctly handles all from field formats (display names, angle brackets, edge cases)
    • Confirm the normalization logic doesn't break existing cold email detection for already-stored non-normalized addresses
    • Ensure test mocks accurately reflect Prisma and utility function behavior

Possibly related PRs

Poem

🐰 Normalizing hops and email bounds,
From fields now clean, no messy strands,
Display names parsed with gentle care,
Cold senders spotted everywhere! ✉️

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/cold-email-blocker-skipped

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf758ac and 6801c55.

📒 Files selected for processing (3)
  • apps/web/utils/cold-email/is-cold-email.test.ts (1 hunks)
  • apps/web/utils/cold-email/is-cold-email.ts (1 hunks)
  • version.txt (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@elie222 elie222 merged commit 8f42ed7 into main Nov 17, 2025
12 of 14 checks passed
@elie222 elie222 deleted the fix/cold-email-blocker-skipped branch November 17, 2025 21:39
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant