Skip to content

Conversation

@elie222
Copy link
Owner

@elie222 elie222 commented Nov 19, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced email correspondence detection to now include both sent and received messages when determining prior communication history.
  • Chores

    • Version bumped to v2.20.9.

@vercel
Copy link

vercel bot commented Nov 19, 2025

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

Project Deployment Preview Updated (UTC)
inbox-zero Ready Ready Preview Nov 19, 2025 7:56am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

The PR broadens the hasPreviousEmail logic in the Microsoft email utility to check for both outgoing and incoming emails when determining prior correspondence, and increments the version number from v2.20.8 to v2.20.9.

Changes

Cohort / File(s) Summary
Email query logic enhancement
apps/web/utils/email/microsoft.ts
Updated hasPreviousEmail computation to consider both outgoing emails (toRecipients contains sender) and incoming emails (from equals sender). Modified the condition to ensure at least one prior message exists that is not the current message.
Version bump
version.txt
Incremented version from v2.20.8 to v2.20.9.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The Microsoft email utility change expands existing query logic with a clear, parallel condition for both sent and received emails
  • Version bump is trivial
  • The logic adjustment follows a straightforward pattern with no complex branching or edge cases introduced

Possibly related PRs

  • PR #839: Both PRs modify apps/web/utils/email/microsoft.ts to broaden the filter logic for Outlook message queries, with similar adjustments to how email correspondence is detected.

Suggested reviewers

  • mosesjames7271-svg

Poem

🐰 A query grows wider, both ways it flows,
Sent and received, the inbox now knows,
Previous emails from every angle found,
The version bumps up—v2.20.9 bound!
No message left behind, not today,
The rabbit's work brightens the way!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Skip cold email blocker on outlook if we've emailed the person' directly describes the main change: adjusting email detection logic to exclude recipients the sender has previously contacted, allowing the cold email blocker to be skipped.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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/skip-cold-email-outlook

📜 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 45e6d8b and de1a94a.

📒 Files selected for processing (2)
  • apps/web/utils/email/microsoft.ts (1 hunks)
  • version.txt (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/web/utils/email/microsoft.ts (1)
apps/web/utils/outlook/odata-escape.ts (1)
  • escapeODataString (13-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Secret Detection
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: test
🔇 Additional comments (3)
version.txt (1)

1-1: LGTM - Version bump is appropriate.

The patch version increment from v2.20.8 to v2.20.9 is appropriate for this enhancement to the cold email detection logic.

apps/web/utils/email/microsoft.ts (2)

1195-1198: LGTM - Defensive logic is well-implemented.

The hasPreviousEmail logic correctly handles both outgoing and incoming emails while defensively excluding the current message. The use of .some() with the ID check ensures that even if the current message appears in results (due to time precision or race conditions), it won't be counted as prior communication.

The logic correctly handles all scenarios:

  • No previous emails → returns false
  • Previous emails exist (excluding current) → returns true
  • Only the current message in results (edge case) → returns false

1189-1189: ****

OData supports the lt comparison operator for datetime fields, and the earlier web search confirmed that sentDateTime is a valid field in the Microsoft Graph API Messages resource that can be used in OData $filter queries. The filter logic correctly implements checking for both outgoing emails (via toRecipients with sentDateTime) and incoming emails (via from with receivedDateTime). No changes are needed.


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.

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 2 files

@elie222 elie222 merged commit 8c7cf27 into main Nov 19, 2025
15 checks passed
@elie222 elie222 deleted the fix/skip-cold-email-outlook branch November 19, 2025 14:40
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.

2 participants