-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[FIX] Gmail Upgraded lib version #17061
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
[FIX] Gmail Upgraded lib version #17061
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 component actions and sources. Additionally, the polling logic in Changes
Sequence Diagram(s)sequenceDiagram
participant Source as New Labeled Email Source
participant Polling as polling-history.mjs
participant GmailAPI as Gmail API
Source->>Polling: Call getHistoryId()
Polling->>GmailAPI: Fetch messages for each label (inclusive OR)
GmailAPI-->>Polling: Return messages per label
Polling->>Polling: Remove duplicate messages by ID
Polling->>Polling: Sort messages by historyId (desc)
Polling->>Source: Return latest historyId
Source->>Polling: Call emitHistories(startHistoryId)
Polling->>GmailAPI: Fetch history since startHistoryId (as string)
GmailAPI-->>Polling: Return history or error
alt HistoryId expired or not found
Polling->>Polling: Log error, fetch fresh historyId
Polling->>Polling: Update stored last history ID
Polling-->>Source: Return early (skip processing)
else Success
Polling->>Polling: Update maxHistoryId
Polling->>Source: Emit events if history exists
end
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
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/add-label-to-email/add-label-to-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 components/gmail/actions/approve-workflow/approve-workflow.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/gmail/actions/archive-email/archive-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 ignored due to path filters (1)
📒 Files selected for processing (19)
🚧 Files skipped from review as they are similar to previous changes (19)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ 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 (2)
components/gmail/sources/common/polling-history.mjs (2)
45-46
: Redundant API round-tripYou already fetched
historyId
for every message inmessagesWithHistoryId
.
Re-callinggmail.getMessage
for the same ID adds latency and quota usage.-const { historyId } = await this.gmail.getMessage({ - id: sortedMessages[0].id, -}); -return historyId; +return sortedMessages[0].historyId;
69-70
:historyId
may beundefined
– guard beforeMath.max
listHistory
can return{ historyId: undefined }
when no matching history exists.
Passingundefined
toMath.max
will yieldNaN
, breaking the subsequent comparison.-maxHistoryId = Math.max(maxHistoryId, historyId); +if (historyId) { + maxHistoryId = Math.max(maxHistoryId, Number(historyId)); +}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
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
(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/package.json
(2 hunks)components/gmail/sources/common/polling-history.mjs
(2 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 (4)
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (17)
components/gmail/actions/download-attachment/download-attachment.mjs (1)
10-10
: Bump action version to 0.0.8
Version increment from0.0.7
to0.0.8
aligns with the coordinated release across Gmail actions.components/gmail/actions/list-labels/list-labels.mjs (1)
7-7
: Bump action version to 0.0.5
Version updated from0.0.4
to0.0.5
in sync with other Gmail component actions.components/gmail/actions/archive-email/archive-email.mjs (1)
8-8
: Bump action version to 0.0.4
Version increment from0.0.3
to0.0.4
maintains consistency with the Gmail component’s coordinated versioning.components/gmail/actions/update-primary-signature/update-primary-signature.mjs (1)
7-7
: Bump action version to 0.0.8
Updated from0.0.7
to0.0.8
to match the unified versioning across Gmail actions.components/gmail/sources/new-attachment-received/new-attachment-received.mjs (1)
9-9
: Bump source version to 0.0.13
Version updated from0.0.12
to0.0.13
, consistent with the batch version upgrades for Gmail sources.components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs (1)
9-9
: Approve version bump to 0.0.11
Version increment aligns with the overall Gmail component release plan.components/gmail/actions/approve-workflow/approve-workflow.mjs (1)
7-7
: Approve version bump to 0.0.6
This minor version update is consistent with the PR’s coordinated versioning strategy.components/gmail/actions/find-email/find-email.mjs (1)
9-9
: Approve version bump to 0.1.2
The version update correctly reflects the patch release for this action.components/gmail/sources/new-labeled-email/new-labeled-email.mjs (1)
11-11
: Approve version bump to 0.0.13
Matches the unified versioning scheme across Gmail sources.components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs (1)
7-7
: Approve version bump to 0.0.7
Consistent with the coordinated release of the Gmail component.components/gmail/actions/send-email/send-email.mjs (1)
9-9
: Approve version bump of send-email actionVersion updated from
0.1.11
to0.1.12
.components/gmail/actions/add-label-to-email/add-label-to-email.mjs (1)
7-7
: Approve version bump of add-label-to-email actionVersion updated from
0.0.9
to0.0.10
.components/gmail/actions/create-draft/create-draft.mjs (1)
9-9
: Approve version bump of create-draft actionVersion updated from
0.1.3
to0.1.4
.components/gmail/sources/new-email-received/new-email-received.mjs (1)
18-18
: Approve version bump of new-email-received sourceVersion updated from
0.2.5
to0.2.6
.components/gmail/actions/update-org-signature/update-org-signature.mjs (1)
11-11
: Approve version bump of update-org-signature actionVersion updated from
0.0.7
to0.0.8
.components/gmail/sources/new-sent-email/new-sent-email.mjs (1)
9-9
: Version bump looks fine.No functional impact – just a metadata update. ✅
components/gmail/package.json (1)
3-4
:❓ Verification inconclusive
Major dependency jump – please validate API compatibility and run full test suite
Going from
@googleapis/[email protected]
to13.x
is a 10-major-version leap. Google’s generated clients frequently introduce breaking changes (method signatures, auth flow, response shapes).Likewise, the component itself is now
1.0.0
, implying stability – ensure the surface really is unchanged.Follow-up checks you should confirm before merging:
- All internal wrappers (
gmail.*
) compile against the new types.- Integration tests for every Gmail action/source still succeed.
- The removal of the generic
googleapis
package doesn’t leave dead imports.Also applies to: 18-18
🏁 Script executed:
#!/bin/bash # Quick scan for any still-existing imports from the removed package rg --line-number --context 2 $'from .*googleapis' || trueLength of output: 8074
🏁 Script executed:
#!/bin/bash # Specific search for any remaining imports from the generic “googleapis” package within the Gmail component rg --line-number --context 2 -e "from ['\"]googleapis['\"]" components/gmail || trueLength of output: 89
Major dependency jump – validate API compatibility and run full test suite
File: components/gmail/package.json
Lines: 3–4Snippet:
"version": "1.0.0", "description": "Pipedream Gmail Components",
Going from
@googleapis/[email protected]
→13.x
is a 10-major-version leap. Google’s generated clients frequently introduce breaking changes (method signatures, auth flow, response shapes). Likewise, bumping the component to1.0.0
signals stability—ensure the public surface is unchanged.Follow-up checks before merging:
- All internal wrappers (
gmail.*
) compile cleanly against the new types.- Integration tests for every Gmail action/source still succeed.
- No remaining imports of the generic
googleapis
package incomponents/gmail
(onlyimport gmail from "@googleapis/gmail"
).
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 @jcortes, LGTM! Ready for QA!
e1f32e0
to
2b138a3
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
🧹 Nitpick comments (1)
components/gmail/gmail.app.mjs (1)
400-405
: Consider adding the same retry / error-handling strategy used elsewhere
getProfile()
makes a direct API call without the exponential-backoff wrapper you already apply ingetMessage()
(line 386) and other latency-sensitive areas. In practice, the profile endpoint can also return transient 429/5xx errors. Aligning the resilience pattern keeps behaviour consistent and prevents flakiness.- async getProfile() { - const { data } = await this._client().users.getProfile({ - userId: constants.USER_ID, - }); - return data; - }, + async getProfile() { + const fn = () => this._client().users.getProfile({ + userId: constants.USER_ID, + }); + const { data } = await this.retryWithExponentialBackoff(fn); + return data; + },Run the existing unit/integration tests or trigger the component manually to ensure the refactor doesn’t introduce regressions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 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
(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
(2 hunks)components/gmail/sources/common/polling-history.mjs
(3 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)
✅ Files skipped from review due to trivial changes (3)
- components/gmail/sources/new-sent-email/new-sent-email.mjs
- components/gmail/actions/update-org-signature/update-org-signature.mjs
- components/gmail/package.json
🚧 Files skipped from review as they are similar to previous changes (15)
- components/gmail/actions/download-attachment/download-attachment.mjs
- components/gmail/actions/approve-workflow/approve-workflow.mjs
- components/gmail/actions/archive-email/archive-email.mjs
- components/gmail/actions/remove-label-from-email/remove-label-from-email.mjs
- components/gmail/sources/new-attachment-received/new-attachment-received.mjs
- components/gmail/actions/list-labels/list-labels.mjs
- components/gmail/sources/new-labeled-email/new-labeled-email.mjs
- components/gmail/actions/send-email/send-email.mjs
- components/gmail/sources/new-email-matching-search/new-email-matching-search.mjs
- components/gmail/actions/find-email/find-email.mjs
- components/gmail/sources/new-email-received/new-email-received.mjs
- components/gmail/actions/update-primary-signature/update-primary-signature.mjs
- components/gmail/actions/add-label-to-email/add-label-to-email.mjs
- components/gmail/actions/create-draft/create-draft.mjs
- components/gmail/sources/common/polling-history.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
fixed historyId
2b138a3
to
9b71f3c
Compare
/approve |
WHY
Resolves #16990
Summary by CodeRabbit