Skip to content

Comments

filering of email addresses#1986

Merged
ahmetskilinc merged 1 commit intostagingfrom
08-13-filering_of_email_addresses
Aug 26, 2025
Merged

filering of email addresses#1986
ahmetskilinc merged 1 commit intostagingfrom
08-13-filering_of_email_addresses

Conversation

@ahmetskilinc
Copy link
Contributor

@ahmetskilinc ahmetskilinc commented Aug 13, 2025

Skip draft generation for no-reply email addresses

Description

Added a check to prevent generating draft replies for messages from no-reply email addresses. This change introduces a set of common no-reply email addresses (like no-reply@gmail.com, notifications@github.com, etc.) and skips draft generation when the sender's email matches any of these addresses.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • ⚡ Performance improvement

Areas Affected

  • Email Integration (Gmail, IMAP, etc.)

Summary by CodeRabbit

  • Bug Fixes
    • Prevents auto-draft suggestions for emails from non-actionable senders (e.g., no-reply/noreply/do-not-reply and common notification services).
    • Reduces noise and avoids prompting replies where none are expected, improving relevance.
    • Applies the check earlier in the decision flow to stop drafts sooner, saving time.
    • No changes to user settings or visible controls.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Walkthrough

Introduces a dontReplyTo set of known non-actionable sender addresses and adds a new guard in shouldGenerateDraft to return false when the latest message’s sender matches that set. The guard is positioned after automated-content heuristics and before the 7‑day recency check. No public API changes.

Changes

Cohort / File(s) Summary
Draft generation heuristics
apps/server/src/thread-workflow-utils/index.ts
Added dontReplyTo set (e.g., no-reply/noreply/do-not-reply/notifications@github/Xing). Inserted early-exit check in shouldGenerateDraft to skip draft creation when latest sender is in dontReplyTo. Guard placed after automated-content checks and before 7-day recency logic. No exported signatures changed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Trigger as Trigger
  participant TWU as thread-workflow-utils
  participant Store as Message Store

  Trigger->>TWU: shouldGenerateDraft(threadId)
  TWU->>Store: getLatestMessage(threadId)
  Store-->>TWU: latestMessage(sender, content, ts)

  rect rgba(230,240,255,0.6)
    note over TWU: Automated-content heuristics
    TWU->>TWU: if automated content -> return false
  end

  rect rgba(240,255,230,0.6)
    note over TWU: New guard: dontReplyTo set
    TWU->>TWU: if sender in dontReplyTo -> return false
  end

  TWU->>TWU: if older than 7 days -> return false
  TWU->>TWU: other existing checks...
  TWU-->>Trigger: boolean (should generate draft)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

Rockets don’t reply to no-reply, they fly.
We added a gate, clean as the sky.
Drafts only when signals are true, not noise.
Threads stay sharp—precision deploys.
Onward, less spam, more signal—enjoys. 🚀

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 08-13-filering_of_email_addresses

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ahmetskilinc ahmetskilinc marked this pull request as ready for review August 23, 2025 09:46
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 1 file

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/server/src/thread-workflow-utils/index.ts (1)

31-34: Trim inputs before lowercasing – optional robustness boost

We ran a project-wide scan for any email: ' …' patterns and found no existing cases with leading whitespace. That said, proactively trimming before calling .toLowerCase() guards against future provider quirks.

• File: apps/server/src/thread-workflow-utils/index.ts (Lines 31–34)
• Current code:

const senderEmail = latestMessage.sender?.email?.toLowerCase() || '';
const subject     = latestMessage.subject?.toLowerCase() || '';
const decodedBody = latestMessage.decodedBody?.toLowerCase() || '';

• Suggested (optional) refactor:

const senderEmail = (latestMessage.sender?.email   ?? '').trim().toLowerCase();
const subject     = (latestMessage.subject          ?? '').trim().toLowerCase();
const decodedBody = (latestMessage.decodedBody      ?? '').trim().toLowerCase();

This extra trim is purely preventative—no failures detected today, but it future-proofs our normalization logic.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 576dfcc and 4cbf997.

📒 Files selected for processing (1)
  • apps/server/src/thread-workflow-utils/index.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{css,js,ts,jsx,tsx,mdx}

📄 CodeRabbit inference engine (.cursor/rules/tailwind-css-v4.mdc)

**/*.{css,js,ts,jsx,tsx,mdx}: Chain variants together for composable variants (e.g., group-has-data-potato:opacity-100).
Use new variants such as starting, not-*, inert, nth-*, in-*, open (for :popover-open), and ** for all descendants.
Do not use deprecated utilities like bg-opacity-*, text-opacity-*, border-opacity-*, and divide-opacity-*; use the new syntax (e.g., bg-black/50).
Use renamed utilities: shadow-sm is now shadow-xs, shadow is now shadow-sm, drop-shadow-sm is now drop-shadow-xs, drop-shadow is now drop-shadow-sm, blur-sm is now blur-xs, blur is now blur-sm, rounded-sm is now rounded-xs, rounded is now rounded-sm, outline-none is now outline-hidden.
Use bg-(--brand-color) syntax for CSS variables in arbitrary values instead of bg-[--brand-color].
Stacked variants now apply left-to-right instead of right-to-left.

Files:

  • apps/server/src/thread-workflow-utils/index.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENT.md)

**/*.{js,jsx,ts,tsx}: Use 2-space indentation
Use single quotes
Limit lines to 100 characters
Semicolons are required

Files:

  • apps/server/src/thread-workflow-utils/index.ts
**/*.{js,jsx,ts,tsx,css}

📄 CodeRabbit inference engine (AGENT.md)

Use Prettier with sort-imports and Tailwind plugins

Files:

  • apps/server/src/thread-workflow-utils/index.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENT.md)

Enable TypeScript strict mode

Files:

  • apps/server/src/thread-workflow-utils/index.ts
⏰ 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). (1)
  • GitHub Check: cubic · AI code reviewer

@ahmetskilinc ahmetskilinc merged commit fe989cc into staging Aug 26, 2025
7 checks passed
@ahmetskilinc ahmetskilinc deleted the 08-13-filering_of_email_addresses branch August 26, 2025 12:09
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