-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[BUG] Gmail (Developer App) - New Attachment source not working consistently #12334
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
[BUG] Gmail (Developer App) - New Attachment source not working consistently #12334
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
@jcortes is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
Warning Rate limit exceeded@jcortes has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 33 minutes and 39 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe recent updates focus on enhancing the Gmail custom OAuth components by refining message retrieval, adding retry logic, and incrementing versions across various modules. Key changes include increasing the Changes
Sequence Diagram(s)sequenceDiagram
participant Polling as Polling Module
participant GmailAPI as Gmail API
participant RetryLogic as Retry Logic
participant AttachmentQuery as Attachment Query
Polling->>GmailAPI: Retrieve Messages
GmailAPI-->>Polling: Response
Polling->>RetryLogic: Check for Failures
RetryLogic-->>Polling: Retry if Necessary
Polling->>AttachmentQuery: Construct Query
AttachmentQuery-->>Polling: Return Query Results
Polling-->>GmailAPI: Process Messages
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 2
Outside diff range and nitpick comments (2)
components/gmail/common/constants.mjs (1)
6-6
: Consider the impact of increasingHISTORICAL_EVENTS
to 500 on system performance.Increasing the number of historical events processed may significantly impact memory and performance. It's advisable to monitor system metrics closely after this change and consider implementing pagination or other performance optimization techniques if necessary.
components/gmail_custom_oauth/sources/common/polling.mjs (1)
117-140
: Enhance logging for better traceability in therun
method.Consider adding more detailed logging statements in the
run
method to provide better insights into the flow of data and decision points. This will aid in debugging and maintaining the system.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- components/gmail/common/constants.mjs (1 hunks)
- components/gmail_custom_oauth/package.json (1 hunks)
- components/gmail_custom_oauth/sources/common/polling.mjs (2 hunks)
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs (1 hunks)
Files skipped from review due to trivial changes (2)
- components/gmail_custom_oauth/package.json
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs
0e1ce3e
to
1a50322
Compare
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: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- components/gmail_custom_oauth/package.json (1 hunks)
- components/gmail_custom_oauth/sources/common/polling.mjs (2 hunks)
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- components/gmail_custom_oauth/package.json
Additional comments not posted (1)
components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs (1)
8-8
: Version update is appropriate given the new functionality added.
components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs
Outdated
Show resolved
Hide resolved
1a50322
to
55b1e39
Compare
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
Outside diff range and nitpick comments (1)
components/gmail_custom_oauth/sources/common/polling.mjs (1)
36-36
: Replaceconsole.log
with a more robust logging framework.As previously suggested, consider using a more sophisticated logging framework to manage log levels and maintainability.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- components/gmail/common/constants.mjs (1 hunks)
- components/gmail_custom_oauth/package.json (1 hunks)
- components/gmail_custom_oauth/sources/common/polling.mjs (2 hunks)
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs (2 hunks)
Files skipped from review as they are similar to previous changes (3)
- components/gmail/common/constants.mjs
- components/gmail_custom_oauth/package.json
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs
Additional comments not posted (4)
components/gmail_custom_oauth/sources/common/polling.mjs (4)
41-43
: MethodgetQuery()
correctly encapsulates query retrieval.This method provides a clean and encapsulated way to retrieve the query string.
93-95
: Methodpaginate
effectively utilizes theiterate
method.This method correctly abstracts the pagination logic by leveraging the
iterate
method, simplifying the pagination process.
86-92
: Ensure robust error handling in theiterate
method.Consider adding try-catch blocks to manage exceptions that may occur during iteration.
Line range hint
98-135
: Review the overall logic in therun
method.The
run
method contains several console logs and complex logic. Verify that all paths are correctly handling errors and that the logging is appropriate for production.
55b1e39
to
bd26537
Compare
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: 3
Outside diff range and nitpick comments (1)
components/gmail_custom_oauth/sources/common/polling.mjs (1)
Line range hint
98-135
: Refactor therun
method to improve clarity and error handling.The
run
method is complex and mixes different levels of abstraction. Consider breaking it down into smaller, more focused methods. Additionally, enhance error handling to manage cases where no new messages are found or all messages have been processed.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- components/gmail_custom_oauth/gmail_custom_oauth.app.mjs (1 hunks)
- components/gmail_custom_oauth/package.json (1 hunks)
- components/gmail_custom_oauth/sources/common/polling.mjs (2 hunks)
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- components/gmail_custom_oauth/package.json
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs
bd26537
to
4bfa8b8
Compare
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
Outside diff range and nitpick comments (3)
components/gmail_custom_oauth/sources/common/polling.mjs (3)
52-52
: Consider replacingconsole.log
with a structured logging framework for better control over log levels and maintainability.
63-63
: Consider using a structured logging framework here as well.
79-79
: Again, consider using a structured logging framework for better maintainability and control over log levels.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- components/gmail_custom_oauth/gmail_custom_oauth.app.mjs (1 hunks)
- components/gmail_custom_oauth/package.json (1 hunks)
- components/gmail_custom_oauth/sources/common/polling.mjs (2 hunks)
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- components/gmail_custom_oauth/gmail_custom_oauth.app.mjs
- components/gmail_custom_oauth/package.json
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs
Additional comments not posted (2)
components/gmail_custom_oauth/sources/common/polling.mjs (2)
36-36
: LGTM! The method correctly updates the last message ID in the database.
41-43
: LGTM! ThegetQuery
method correctly encapsulates the retrieval of the query string.
4bfa8b8
to
42b1dba
Compare
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
Outside diff range and nitpick comments (1)
components/gmail_custom_oauth/sources/new-labeled-email/new-labeled-email.mjs (1)
Line range hint
76-77
: Refactor to use optional chaining for better safety and readability.- if (!history) { + if (!history?.length) {
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (14)
- components/gmail_custom_oauth/actions/add-label-to-email/add-label-to-email.mjs (1 hunks)
- components/gmail_custom_oauth/actions/create-draft/create-draft.mjs (1 hunks)
- components/gmail_custom_oauth/actions/download-attachment/download-attachment.mjs (1 hunks)
- components/gmail_custom_oauth/actions/find-email/find-email.mjs (1 hunks)
- components/gmail_custom_oauth/actions/send-email/send-email.mjs (1 hunks)
- components/gmail_custom_oauth/actions/update-org-signature/update-org-signature.mjs (1 hunks)
- components/gmail_custom_oauth/actions/update-primary-signature/update-primary-signature.mjs (1 hunks)
- components/gmail_custom_oauth/gmail_custom_oauth.app.mjs (1 hunks)
- components/gmail_custom_oauth/package.json (1 hunks)
- components/gmail_custom_oauth/sources/common/polling.mjs (2 hunks)
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs (1 hunks)
- components/gmail_custom_oauth/sources/new-email-received/new-email-received.mjs (1 hunks)
- components/gmail_custom_oauth/sources/new-labeled-email/new-labeled-email.mjs (1 hunks)
- components/gmail_custom_oauth/sources/new-sent-email/new-sent-email.mjs (1 hunks)
Files skipped from review due to trivial changes (9)
- components/gmail_custom_oauth/actions/add-label-to-email/add-label-to-email.mjs
- components/gmail_custom_oauth/actions/create-draft/create-draft.mjs
- components/gmail_custom_oauth/actions/download-attachment/download-attachment.mjs
- components/gmail_custom_oauth/actions/find-email/find-email.mjs
- components/gmail_custom_oauth/actions/send-email/send-email.mjs
- components/gmail_custom_oauth/actions/update-org-signature/update-org-signature.mjs
- components/gmail_custom_oauth/actions/update-primary-signature/update-primary-signature.mjs
- components/gmail_custom_oauth/sources/new-email-received/new-email-received.mjs
- components/gmail_custom_oauth/sources/new-sent-email/new-sent-email.mjs
Files skipped from review as they are similar to previous changes (3)
- components/gmail_custom_oauth/package.json
- components/gmail_custom_oauth/sources/common/polling.mjs
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs
Additional context used
Biome
components/gmail_custom_oauth/sources/new-labeled-email/new-labeled-email.mjs
[error] 76-76: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
[error] 77-77: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
components/gmail_custom_oauth/gmail_custom_oauth.app.mjs
[error] 106-109: This else clause can be omitted because previous branches break early. (lint/style/noUselessElse)
Unsafe fix: Omit the else clause.
Additional comments not posted (1)
components/gmail_custom_oauth/sources/new-labeled-email/new-labeled-email.mjs (1)
10-10
: Version updated to "0.0.6" to reflect enhancements or bug fixes.
4aabaae
to
e4bbfdf
Compare
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- components/gmail_custom_oauth/gmail_custom_oauth.app.mjs (1 hunks)
- components/gmail_custom_oauth/sources/common/polling.mjs (2 hunks)
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- components/gmail_custom_oauth/gmail_custom_oauth.app.mjs
- components/gmail_custom_oauth/sources/common/polling.mjs
- components/gmail_custom_oauth/sources/new-attachment-received/new-attachment-received.mjs
WHY
Resolves #12227
Summary by CodeRabbit
New Features
getMessagesWithRetry
method.constructAttachmentQuery
method for improved attachment handling.getQuery
method for efficient attachment queries in the "New Attachment Received" source.Bug Fixes
Refactor