Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Oct 24, 2025

Resolves #18847

Summary by CodeRabbit

  • Chores

    • Released maintenance update bumping Gmail component to 1.3.5 with version increments across Gmail actions and event sources.
  • Refactor

    • Optimized email composition workflow to improve performance and reliability when creating drafts and sending messages.
@vercel
Copy link

vercel bot commented Oct 24, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Oct 28, 2025 2:14pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 28, 2025 2:14pm
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2025

Walkthrough

This PR increments version strings across many Gmail action and source modules, updates components/gmail/package.json version, and changes MailComposer usage in sendEmail and createDraft to call compile() during construction (method chaining); no other logic changes.

Changes

Cohort / File(s) Summary
Action version updates
components/gmail/actions/add-label-to-email/add-label-to-email.mjs, components/gmail/actions/approve-workflow/approve-workflow.mjs, components/gmail/actions/archive-email/archive-email.mjs, components/gmail/actions/create-draft/create-draft.mjs, components/gmail/actions/create-label/create-label.mjs, components/gmail/actions/delete-email/delete-email.mjs, components/gmail/actions/download-attachment/download-attachment.mjs, components/gmail/actions/find-email/find-email.mjs, components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs, components/gmail/actions/list-labels/list-labels.mjs, components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs, components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs, components/gmail/actions/send-email/send-email.mjs, components/gmail/actions/update-org-signature/update-org-signature.mjs, components/gmail/actions/update-primary-signature/update-primary-signature.mjs
Incremented version field in each action's default export; no behavioral or control-flow changes.
Source version updates
components/gmail/sources/new-attachment-received/new-attachment-received.mjs, components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs, components/gmail/sources/new-email-received/new-email-received.mjs, components/gmail/sources/new-labeled-email/new-labeled-email.mjs, components/gmail/sources/new-sent-email/new-sent-email.mjs
Incremented version field in each source's default export; no logic changes.
MailComposer refactor
components/gmail/gmail.app.mjs
In sendEmail and createDraft, MailComposer is constructed and compile() is invoked via chaining (new MailComposer(options).compile()); subsequent build() is called on the compiled object.
Package manifest
components/gmail/package.json
Bumped package version (components/gmail/package.json).
Trailing newline/formatting fixes
components/alienvault/alienvault.app.mjs, components/beyond_presence/beyond_presence.app.mjs, components/callhippo/callhippo.app.mjs, components/flotiq/flotiq.app.mjs
Added trailing newlines / minor formatting; no behavioral changes.

Sequence Diagram(s)

sequenceDiagram participant Caller as sendEmail/createDraft participant MailComposer participant Compiled as CompiledMail rect rgb(220,240,200) Note over Caller,Compiled: New (chained) flow Caller->>MailComposer: new MailComposer(options).compile() MailComposer->>Compiled: compiled mail instance Caller->>Compiled: mail.build() Compiled-->>Caller: raw message end 
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus areas:
    • components/gmail/gmail.app.mjs (MailComposer compile/build sequence in sendEmail and createDraft)
    • components/gmail/actions/create-draft/create-draft.mjs and components/gmail/actions/send-email/send-email.mjs for any implicit behavioral assumptions (BCC handling linked issue [BUG] Gmail "Create Draft" BCC not working #18847)
    • components/gmail/package.json version bump consistency

Suggested reviewers

  • jcortes

Poem

🐰
Versions hop up, one by one,
MailComposer compiles right when begun.
Drafts and sends now follow the cue,
Carrots of code — tidy and true. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The pull request includes numerous version bumps across Gmail actions and sources (add-label, approve-workflow, archive-email, create-label, delete-email, find-email, get-send-as-alias, list-labels, list-send-as-aliases, remove-label, send-email, update-org-signature, update-primary-signature, and multiple sources) along with the main package.json version bump. Additionally, unrelated components (alienvault, beyond_presence, callhippo, flotiq) have trailing newline additions. Since the linked issue #18847 is specifically about the BCC bug in Gmail "Create Draft," these widespread version updates and unrelated file formatting changes appear to be out of scope for this bug fix.
Description Check ⚠️ Warning The pull request description only contains "Resolves #18847" without providing the context specified in the repository's description template, which requires a "WHY" section to be completed by the author. While the issue reference is provided, there is no explanation of the problem, the approach taken, or reasoning behind the changes. The description is minimal and does not follow the template structure, making it difficult for reviewers to understand the rationale without consulting the linked issue.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Linked Issues Check ❓ Inconclusive The linked issue #18847 reports that the BCC property is not being added to drafts in the Gmail "Create Draft" action. The primary functional change in gmail.app.mjs modifies how MailComposer is called in both sendEmail and createDraft methods. However, the raw summary explicitly states "The keepBcc behavior remains unchanged," which raises questions about whether this change actually resolves the reported BCC issue. Without clear evidence that the MailComposer modification fixes the specific BCC problem, it is unclear whether the linked issue requirements are fully met.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Gmail 'Create Draft' bug fix" clearly identifies the component (Gmail Create Draft action) and indicates a bug fix is being applied. This aligns with the primary functional change visible in the raw summary, which documents modifications to the MailComposer usage in the createDraft method within gmail.app.mjs. The title is concise and specific enough for teammates reviewing commit history to understand the focus area of the change.
✨ 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 issue-18847

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3408e4e and 7bf443f.

📒 Files selected for processing (6)
  • components/alienvault/alienvault.app.mjs (1 hunks)
  • components/beyond_presence/beyond_presence.app.mjs (1 hunks)
  • components/callhippo/callhippo.app.mjs (1 hunks)
  • components/flotiq/flotiq.app.mjs (1 hunks)
  • components/gmail/actions/send-email/send-email.mjs (1 hunks)
  • components/gmail/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • components/flotiq/flotiq.app.mjs
  • components/alienvault/alienvault.app.mjs
  • components/beyond_presence/beyond_presence.app.mjs
  • components/callhippo/callhippo.app.mjs
  • components/gmail/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/gmail/actions/send-email/send-email.mjs

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.

@michelle0927 michelle0927 marked this pull request as ready for review October 24, 2025 19:01
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: 0

🧹 Nitpick comments (1)
components/gmail/gmail.app.mjs (1)

525-532: Consider aligning draft encoding with email sending for consistency.

There's an encoding inconsistency between sendEmail and createDraft:

  • sendEmail (lines 484-487) converts the message to UTF-8, fixes header formatting (:\r\n and :\n:), then uses the encodeMessage helper for URL-safe base64
  • createDraft (line 532) uses message.toString("base64") directly without header fixing or URL-safe encoding

While the current approach appears to work for drafts, aligning both methods would improve maintainability and reduce the risk of subtle encoding issues.

Apply this diff to align the encoding:

 const mail = new MailComposer(options).compile(); mail.keepBcc = true; const message = await mail.build(); +// Fix headers that are separated with newlines +const messageFixed = message.toString("utf8") + .replace(/:\r\n/g, ":") + .replace(/:\n/g, ":"); +const rawMessage = this.encodeMessage(messageFixed); try { const response = await this._client().users.drafts.create({ userId: constants.USER_ID, requestBody: { message: { threadId: threadId, - raw: message.toString("base64"), + raw: rawMessage, }, }, });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2c5f4f2 and 3408e4e.

📒 Files selected for processing (22)
  • 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/create-label/create-label.mjs (1 hunks)
  • components/gmail/actions/delete-email/delete-email.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/get-send-as-alias/get-send-as-alias.mjs (1 hunks)
  • components/gmail/actions/list-labels/list-labels.mjs (1 hunks)
  • components/gmail/actions/list-send-as-aliases/list-send-as-aliases.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 (1 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/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)
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (22)
components/gmail/package.json (1)

3-3: LGTM: Package version bump is appropriate.

The version bump from 1.3.3 to 1.3.4 follows semantic versioning for a patch release containing the BCC bug fix.

components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs (1)

9-9: LGTM: Version bump is consistent with package release.

components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs (1)

7-7: LGTM: Version bump is consistent with package release.

components/gmail/actions/download-attachment/download-attachment.mjs (1)

10-10: LGTM: Version bump is consistent with package release.

components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs (1)

8-8: LGTM: Version bump is consistent with package release.

components/gmail/actions/send-email/send-email.mjs (1)

9-9: LGTM: Version bump is consistent with package release.

components/gmail/sources/new-sent-email/new-sent-email.mjs (1)

9-9: LGTM: Version bump is consistent with package release.

components/gmail/actions/delete-email/delete-email.mjs (1)

8-8: LGTM: Version bump is consistent with package release.

components/gmail/actions/update-primary-signature/update-primary-signature.mjs (1)

7-7: Version bump only — OK.

No behavioral changes; safe to ship.

components/gmail/actions/add-label-to-email/add-label-to-email.mjs (1)

7-7: Version bump only — OK.

No logic changes in this action.

components/gmail/actions/create-label/create-label.mjs (1)

9-9: Version bump only — OK.

No functional changes detected.

components/gmail/actions/list-labels/list-labels.mjs (1)

7-7: Version bump only — OK.

No runtime impact here.

components/gmail/actions/find-email/find-email.mjs (1)

8-8: Version bump approved — BCC fix verified.

Verification confirms BCC is properly integrated into Create Draft: prop definition in create-draft.mjs (line 30), passed through gmail.app.mjs (line 311), MailComposer keepBcc flag set correctly (line 524), and message with headers sent to Gmail API via raw field (line 532). Metadata version change in find-email.mjs unrelated to this feature.

components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs (1)

7-7: LGTM! Standard version bump.

The patch version increment aligns with the PR's bug fix scope.

components/gmail/actions/archive-email/archive-email.mjs (1)

8-8: LGTM! Standard version bump.

The patch version increment is appropriate for this bug fix release.

components/gmail/actions/update-org-signature/update-org-signature.mjs (1)

11-11: LGTM! Standard version bump.

The patch version increment is consistent with the PR's release scope.

components/gmail/sources/new-attachment-received/new-attachment-received.mjs (1)

11-11: LGTM! Standard version bump.

The patch version increment aligns with the coordinated release across Gmail components.

components/gmail/sources/new-labeled-email/new-labeled-email.mjs (1)

11-11: LGTM! Standard version bump.

The patch version increment is appropriate for this coordinated release.

components/gmail/actions/approve-workflow/approve-workflow.mjs (1)

7-7: LGTM! Standard version bump.

The patch version increment is consistent with the PR's bug fix release.

components/gmail/sources/new-email-received/new-email-received.mjs (1)

18-18: LGTM! Standard version bump.

The patch version increment aligns with the coordinated release across all Gmail components.

components/gmail/actions/create-draft/create-draft.mjs (1)

9-9: BCC fix is properly implemented and verified.

The script output confirms the implementation is correct:

  • createDraft method instantiates MailComposer with all options including BCC
  • mail.keepBcc = true is set to preserve BCC recipients in the compiled message
  • getOptionsToSendEmail properly passes bcc: props.bcc through options
  • The pattern is consistent and applied systematically

The version bump from 0.1.8 to 0.1.9 is appropriate for this bug fix. BCC recipients will now be correctly included in created drafts.

components/gmail/gmail.app.mjs (1)

523-525: LGTM! This fix should resolve the BCC bug.

The change ensures compile() is called on the MailComposer before setting keepBcc = true and calling build(). Without the compile step, the BCC recipients and other mail options aren't properly processed, which explains why BCC wasn't working in draft creation. This now matches the working pattern used in sendEmail (lines 479-482).

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

Labels

None yet

2 participants