-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Gmail updates for email replies #16552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update primarily increments version numbers across multiple Gmail action and source modules, reflecting minor updates or maintenance. Notably, the "Send Email" action and supporting logic in Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SendEmailAction
participant GmailApp
User->>SendEmailAction: Initiate send email (with inReplyTo)
SendEmailAction->>GmailApp: getOptionsToSendEmail(props)
alt replyAll is true
GmailApp->>GmailApp: Extract From, To, Cc, Bcc from original message
GmailApp->>SendEmailAction: Return all recipients as to/cc/bcc
else replyAll is false
GmailApp->>SendEmailAction: Return standard recipients
end
SendEmailAction->>User: Email sent summary (generic success message)
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/gmail/actions/send-email/send-email.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
components/gmail/gmail.app.mjs (1)
306-322
: Consider removing the current user from recipients listThe current implementation adds all recipients to the reply, but doesn't filter out the current user's email address. This could result in the user receiving their own email.
if (props.replyAll) { const from = repliedMessage.payload.headers.find(({ name }) => name.toLowerCase() === "from"); const to = repliedMessage.payload.headers.find(({ name }) => name.toLowerCase() === "to"); const cc = repliedMessage.payload.headers.find(({ name }) => name.toLowerCase() === "cc"); const bcc = repliedMessage.payload.headers.find(({ name }) => name.toLowerCase() === "bcc"); opts.to = from.value.split(","); opts.to.push(...to.value.split(",")); + // Filter out the current user's email address + const currentUserEmail = email.toLowerCase().trim(); + opts.to = opts.to.filter(addr => { + // Extract email from possible format like "Name <[email protected]>" + const match = addr.match(/<(.+?)>/) || [null, addr.trim()]; + return match[1].toLowerCase() !== currentUserEmail; + }); opts.to = [ ...new Set(opts.to), ]; if (cc) { opts.cc = cc.value; } if (bcc) { opts.bcc = bcc.value; } }This ensures the sender doesn't receive their own email when using the "reply all" feature.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (19)
components/gmail/actions/add-label-to-email/add-label-to-email.mjs
(1 hunks)components/gmail/actions/approve-workflow/approve-workflow.mjs
(1 hunks)components/gmail/actions/archive-email/archive-email.mjs
(1 hunks)components/gmail/actions/create-draft/create-draft.mjs
(1 hunks)components/gmail/actions/download-attachment/download-attachment.mjs
(1 hunks)components/gmail/actions/find-email/find-email.mjs
(1 hunks)components/gmail/actions/list-labels/list-labels.mjs
(1 hunks)components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs
(1 hunks)components/gmail/actions/send-email/send-email.mjs
(4 hunks)components/gmail/actions/update-org-signature/update-org-signature.mjs
(1 hunks)components/gmail/actions/update-primary-signature/update-primary-signature.mjs
(1 hunks)components/gmail/gmail.app.mjs
(1 hunks)components/gmail/package.json
(1 hunks)components/gmail/sources/common/base.mjs
(1 hunks)components/gmail/sources/new-attachment-received/new-attachment-received.mjs
(1 hunks)components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs
(1 hunks)components/gmail/sources/new-email-received/new-email-received.mjs
(1 hunks)components/gmail/sources/new-labeled-email/new-labeled-email.mjs
(1 hunks)components/gmail/sources/new-sent-email/new-sent-email.mjs
(1 hunks)
🔇 Additional comments (21)
components/gmail/actions/list-labels/list-labels.mjs (1)
7-7
: Bump action version
Version updated to "0.0.3" to align with the coordinated version increments across Gmail actions and sources in this PR. No functional changes.components/gmail/actions/download-attachment/download-attachment.mjs (1)
10-10
: Version Bump Consistency
The version number has been correctly incremented from0.0.5
to0.0.6
to reflect this non-functional update. This matches the version bumps applied across the other Gmail action components in this PR.components/gmail/actions/update-primary-signature/update-primary-signature.mjs (1)
7-7
: Consistent version bump to 0.0.6
The version has been incremented from 0.0.5 to 0.0.6 to align with the coordinated updates across Gmail action modules. No functional changes detected.components/gmail/actions/create-draft/create-draft.mjs (1)
9-9
: Approve version bump
The action’s version has been updated from0.0.5
to0.0.6
, aligning with the coordinated version increments across other Gmail action modules in this PR.components/gmail/sources/new-attachment-received/new-attachment-received.mjs (1)
9-9
: Version bump is consistent
The version string has been updated from "0.0.10" to "0.0.11" to align with coordinated releases across Gmail components in this PR. No functional changes were introduced.components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs (1)
9-9
: Version bump is appropriate
The source’sversion
has been correctly updated from0.0.8
to0.0.9
, keeping it in sync with the other Gmail components in this release. No other changes are present in this file.components/gmail/actions/update-org-signature/update-org-signature.mjs (1)
11-11
: Version bump is consistent
The version has been updated from "0.0.5" to "0.0.6", matching the coordinated increments across other Gmail action components in this PR.components/gmail/actions/find-email/find-email.mjs (1)
7-7
: Version bump for Find Email action.
The component version has been updated from "0.0.10" to "0.0.11" to reflect this release’s coordinated updates.components/gmail/actions/archive-email/archive-email.mjs (1)
8-8
: Version bump for Archive Email action.
The component version has been updated from "0.0.1" to "0.0.2" in line with the overall Gmail actions package update.components/gmail/actions/add-label-to-email/add-label-to-email.mjs (1)
7-7
: Version bump for Add Label to Email action.
The component version has been updated from "0.0.7" to "0.0.8" to align with the other Gmail action updates.components/gmail/sources/new-email-received/new-email-received.mjs (1)
18-18
: Version bump for New Email Received source.
The source version has been updated from "0.2.3" to "0.2.4" to coincide with related Gmail component enhancements in this release.components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs (1)
7-7
: Version bump for Remove Label from Email action.
The component version has been updated from "0.0.4" to "0.0.5" as part of the coordinated Gmail actions package version increment.components/gmail/package.json (1)
3-3
: Version bump reflects new features and improvements.This version increment from 0.3.0 to 0.3.1 properly reflects the minor enhancements made across Gmail components, particularly the addition of cc/bcc header parsing and reply-all functionality.
components/gmail/actions/approve-workflow/approve-workflow.mjs (1)
7-7
: Version increment is appropriate.The version bump from 0.0.3 to 0.0.4 aligns with the coordinated updates across Gmail components, maintaining version consistency across the package.
components/gmail/sources/new-labeled-email/new-labeled-email.mjs (1)
11-11
: Version increment is appropriate.The version bump from 0.0.10 to 0.0.11 maintains consistency with other Gmail component updates in this PR.
components/gmail/sources/new-sent-email/new-sent-email.mjs (1)
9-9
: Version increment is appropriate.The version bump from 0.0.9 to 0.0.10 aligns with other Gmail component updates in this PR, maintaining version consistency.
components/gmail/sources/common/base.mjs (1)
78-79
: Enhancement for cc/bcc recipients handling.Good addition of cc and bcc email header parsing to complete the recipient information in the processed email object. This change properly implements the PR objective of adding cc/bcc recipients to the parsedHeaders field.
The implementation correctly uses the existing parseEmail method pattern and maintains consistency with how other email headers are processed.
components/gmail/actions/send-email/send-email.mjs (4)
9-9
: LGTM - Version incrementAppropriately incremented version number for tracking changes.
87-87
: LGTM - Props reload configurationAdding
reloadProps: true
to theinReplyTo
property is appropriate to ensure UI updates when this value changes.
96-111
: LGTM - Well-structured dynamic properties handlingThe
additionalProps
method implementation is well-structured:
- It adds the
replyAll
property only when needed (wheninReplyTo
is set)- It properly hides the redundant fields when reply all is enabled
- It ensures the UI is updated when
replyAll
value changes viareloadProps: true
120-120
: LGTM - Improved export summaryGood update to use
opts.to
instead ofthis.to
in the summary message, ensuring the proper recipients are displayed when using "reply all" functionality.
@michelle0927 this is great start, thank you so much! |
} | ||
if (bcc) { | ||
opts.bcc = bcc.value; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to set the inReplyTo
and reference
props to messageId
automatically here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that'd be nice but Wwe don't want to set props references automatically from the component code because step references can change and it also doesn't work in the context of Pipedream Connect
I don't totally understand the ask, can you clarify? |
@dannyroosevelt since the Headers:
ReplyAll should set this:
not this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @michelle0927 lgtm! Ready for QA!
Hi everyone, all test cases are passed! Ready for release! Test report |
/approve |
cc
andbcc
recipients (if available) to to theparsedHeaders
field in the event.replyAll
prop which replaces theto
,cc
, andbcc
fields with thefrom
,to
,cc
, andbcc
recipients (if available) from the original message.Summary by CodeRabbit
New Features
Chores