-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Gmail] add text export from base64 #16211
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 ↗︎ |
WalkthroughThis pull request updates the version identifiers in both the Gmail action module and its package configuration. In the Gmail action module, a new block of code has been added to the Changes
Sequence Diagram(s)sequenceDiagram
participant FE as Find Email Action
participant M as MessagesToEmit
participant P as Payload Parts
participant D as Decoder
FE->>M: Iterate over each message
M-->>FE: Return message with payload
FE->>P: Check for parts in payload
alt Parts Exist
P-->>FE: Return parts array
FE->>D: For each part, check for body data
alt Data Present
D-->>FE: Decode base64 to UTF-8
FE-->>FE: Assign decoded data to part.body.text
end
end
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/find-email/find-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 ✨ 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:
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: 0
🧹 Nitpick comments (1)
components/gmail/actions/find-email/find-email.mjs (1)
51-58: Consider adding error handling and improving code robustnessThe new functionality to decode base64 email content to text is valuable, but could benefit from a few improvements:
- Add error handling around the decoding operation to prevent exceptions with malformed base64 data
- Check if
part.bodyexists before accessingpart.body.data- Add a comment explaining the purpose of this text extraction
for await (const message of messagesToEmit) { for (const part of message.payload?.parts || []) { - if (part.body.data) { - part.body.text = Buffer.from(part.body.data, "base64").toString("utf-8"); + if (part.body?.data) { + try { + // Decode base64 email content to human-readable text + part.body.text = Buffer.from(part.body.data, "base64").toString("utf-8"); + } catch (error) { + console.error(`Failed to decode base64 content: ${error.message}`); + part.body.text = ""; // Provide a fallback empty string + } } } }Also, since
messagesToEmitis already an array (not an async iterable), consider using a regularfor...ofloop instead offor await...of.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/gmail/actions/find-email/find-email.mjs(2 hunks)components/gmail/package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (2)
components/gmail/package.json (1)
3-3: Version bump matches implementation changesThe package version increase from 0.2.8 to 0.2.9 aligns with the functionality addition in the find-email.mjs file for decoding base64 content to text.
components/gmail/actions/find-email/find-email.mjs (1)
7-7: Version increment is consistentThe component version has been properly incremented from 0.0.8 to 0.0.9 to reflect the new functionality, matching the package version update.
WHY
Summary by CodeRabbit
New Features
Chores