Skip to content
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

Update new-email.mjs #15001

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Update new-email.mjs #15001

wants to merge 6 commits into from

Conversation

mchlbckr
Copy link

@mchlbckr mchlbckr commented Dec 16, 2024

Allow for all folders in Outlook to be checked for new emails

WHY

Currently, the node only checks for new emails in the inbox folder. If by certain rules, an email is directly moved into a separate folder, it is ignored by the trigger.

Summary by CodeRabbit

  • New Features
    • Added the ability to specify folder IDs for monitoring new emails in Outlook.
    • Updated description for clarity regarding email event emissions.
    • Increased version number to 0.0.10.
  • Package Updates
    • Updated package version from 1.0.3 to 1.0.4.
  • Chores
    • Minor formatting updates across various component files.

Allow for all folders in Outlook to be checked for new emails
Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jan 8, 2025 10:22pm

Copy link

vercel bot commented Dec 16, 2024

@mchlbckr is attempting to deploy a commit to the Pipedreamers Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Dec 16, 2024

Walkthrough

The pull request modifies the Microsoft Outlook email source component, specifically updating the exported object in the new-email.mjs file. Key changes include the addition of a folderIds property, an updated description, and a new version number. The activate method's resource path has been broadened from "/me/mailfolders('inbox')/messages" to "/me/messages", allowing for a more extensive retrieval of messages. Additionally, the getSampleEvents and run methods have been adjusted to accommodate these changes.

Changes

File Change Summary
components/microsoft_outlook/sources/new-email/new-email.mjs Updated description and version fields. Added folderIds property. Modified activate method resource path from "/me/mailfolders('inbox')/messages" to "/me/messages". Adjusted getSampleEvents and run methods to utilize folderIds.
components/microsoft_outlook/package.json Updated package version from 1.0.3 to 1.0.4.
components/autodesk/autodesk.app.mjs Added a newline at the end of the file.
components/easypromos/easypromos.app.mjs Added a newline at the end of the file.
components/instantly/instantly.app.mjs Added a newline at the end of the file.
components/motive/motive.app.mjs Added a newline at the end of the file.

Possibly related PRs

Suggested labels

docs

Suggested reviewers

  • GTFalcao

Poem

🐰 A rabbit's tale of email's new trail,
With folderIds added, we set sail,
From inbox confined to messages wide,
Outlook's new path, a joyful ride,
Hop along, let the emails flow,
In specified folders, let the updates grow! 📧


📜 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 6d906fe and 9907c1b.

📒 Files selected for processing (4)
  • components/autodesk/autodesk.app.mjs (1 hunks)
  • components/easypromos/easypromos.app.mjs (1 hunks)
  • components/instantly/instantly.app.mjs (1 hunks)
  • components/motive/motive.app.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • components/easypromos/easypromos.app.mjs
  • components/instantly/instantly.app.mjs
  • components/autodesk/autodesk.app.mjs
  • components/motive/motive.app.mjs

Finishing Touches

  • 📝 Generate Docstrings

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dylburger dylburger added the User submitted Submitted by a user label Dec 16, 2024
@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

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: 1

🔭 Outside diff range comments (1)
components/microsoft_outlook/sources/new-email/new-email.mjs (1)

Line range hint 45-54: Add error handling and implement deduplication strategy

The current implementation needs several improvements to align with Pipedream guidelines:

  1. Add error handling for getMessage API calls
  2. Implement deduplication strategy
  3. Enhance event summary with more details

Consider this implementation:

 async run(event) {
   await this.run({
     event,
     emitFn: async ({ resourceId } = {}) => {
-      const item = await this.microsoftOutlook.getMessage({
-        messageId: resourceId,
-      });
-      this.emitEvent(item);
+      try {
+        const item = await this.microsoftOutlook.getMessage({
+          messageId: resourceId,
+        });
+        
+        // Implement deduplication
+        const dedupKey = `${item.id}-${item.lastModifiedDateTime}`;
+        if (this.db.get(dedupKey)) {
+          return;
+        }
+        this.db.set(dedupKey, true);
+        
+        this.emitEvent(item);
+      } catch (error) {
+        console.error('Error fetching message:', error);
+        throw error;
+      }
     },
   });
 },

Also, enhance the event summary in generateMeta:

 generateMeta(item) {
   return {
     id: item.id,
-    summary: `New email (ID:${item.id})`,
+    summary: `New email from ${item.sender?.emailAddress?.address} - Subject: ${item.subject}`,
     ts: Date.parse(item.createdDateTime),
   };
 },
🧹 Nitpick comments (1)
components/microsoft_outlook/sources/new-email/new-email.mjs (1)

Line range hint 1-54: Add JSDoc documentation and configuration options

To fully comply with Pipedream guidelines, please add:

  1. JSDoc documentation for methods
  2. Optional configuration props for:
    • Folder filtering
    • Message age threshold
    • Update frequency

Example implementation:

props: {
  folders: {
    type: "string[]",
    label: "Folders to Monitor",
    description: "Leave empty to monitor all folders",
    optional: true,
  },
  maxMessageAge: {
    type: "integer",
    label: "Maximum Message Age (hours)",
    description: "Only process messages newer than this",
    default: 24,
    optional: true,
  },
},
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c2e2e9 and 0df6a1e.

📒 Files selected for processing (1)
  • components/microsoft_outlook/sources/new-email/new-email.mjs (1 hunks)

@@ -13,7 +13,7 @@ export default {
async activate() {
await this.activate({
changeType: "created",
resource: "/me/mailfolders('inbox')/messages",
resource: "/me/messages",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Consider version bump for breaking change

Changing from inbox-only to all-folders monitoring is a breaking change that could affect existing implementations. Consider bumping the major version number from 0.0.9.

Additionally, monitoring all folders instead of just inbox could significantly increase the number of events and API calls. Consider adding optional props to:

  1. Allow folder filtering
  2. Set rate limits
  3. Configure message age thresholds

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

🔭 Outside diff range comments (1)
components/microsoft_outlook/sources/new-email/new-email.mjs (1)

Line range hint 6-6: Consider bumping the version number.

The change in message fetching behavior is significant enough to warrant a version bump. Since this is a behavioral change that expands functionality without breaking existing behavior, consider incrementing the minor version (e.g., from 0.0.9 to 0.1.0).

-  version: "0.0.9",
+  version: "0.1.0",
🧹 Nitpick comments (1)
components/microsoft_outlook/sources/new-email/new-email.mjs (1)

Line range hint 4-4: Update component description to reflect the enhanced functionality.

The current description "Emit new event when an email received" should be updated to clarify that it monitors all folders, not just the inbox.

-  description: "Emit new event when an email received",
+  description: "Emit new event when an email is received in any folder",

Also applies to: 7-7

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c2e2e9 and 0df6a1e.

📒 Files selected for processing (1)
  • components/microsoft_outlook/sources/new-email/new-email.mjs (1 hunks)
🔇 Additional comments (2)
components/microsoft_outlook/sources/new-email/new-email.mjs (2)

16-16: Verify the impact of querying all messages.

The change from /me/mailfolders('inbox')/messages to /me/messages will now fetch emails from all folders instead of just the inbox. While this aligns with the PR objective, please consider:

  1. Performance: Fetching from all folders might increase response time and API usage
  2. Rate Limiting: Verify if this broader scope might hit Microsoft Graph API rate limits sooner
  3. Duplicate Prevention: Ensure the webhook system properly handles messages that might be moved between folders

Let's verify the Microsoft Graph API documentation and rate limits:

✅ Verification successful

The change to query all messages is properly implemented with safeguards

The codebase analysis reveals that the implementation includes important safeguards for querying all messages:

  1. Pagination is implemented using $top parameter to limit the number of messages per request
  2. Messages are ordered by creation date ($orderby: "createdDateTime desc"), ensuring newest messages are processed first
  3. The change aligns with the existing app-level implementation which already supports the /me/messages endpoint

The broader scope of querying all folders should not cause performance or rate limiting issues due to these built-in controls. The webhook system will naturally handle message movements between folders as it operates on message IDs rather than folder locations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for related API endpoint usage and rate limiting information
# in the codebase

# Check for any existing rate limiting handling
rg -A 5 "rateLimitExceeded|429|TooManyRequests" ./components/microsoft_outlook/

# Look for related documentation or comments about message fetching
rg -l "\/me\/messages|\/mailfolders|Microsoft Graph API" ./components/microsoft_outlook/

Length of output: 287


Script:

#!/bin/bash
# Search for rate limiting handling with proper escaping
rg -A 5 "rateLimitExceeded|429|TooManyRequests" ./components/microsoft_outlook/

# Look for API endpoint usage with proper escaping
rg -A 5 "/me/messages|/me/mailfolders" ./components/microsoft_outlook/

# Check component documentation and readme
fd -e md . ./components/microsoft_outlook/ -x cat {}

# Look for error handling in the component
rg -A 5 "catch|error" ./components/microsoft_outlook/sources/new-email/

Length of output: 3529


Script:

#!/bin/bash
# Check for error handling and rate limiting in the app file
rg -A 10 "async _makeRequest|error handling|rate limit" ./components/microsoft_outlook/microsoft_outlook.app.mjs

# Look for pagination or batch processing
rg -A 5 "nextLink|page|batch|\$top|\$skip" ./components/microsoft_outlook/sources/new-email/

# Check if there are any filters applied to message retrieval
rg -A 5 "\$filter|\$select|\$orderby" ./components/microsoft_outlook/sources/new-email/

# Look for webhook subscription configuration
ast-grep --pattern 'createHook|createSubscription'

Length of output: 1373


Line range hint 28-34: Verify message listing parameters for the sample events.

The getSampleEvents method should be consistent with the new behavior. Verify if additional parameters are needed to properly represent messages from all folders.

✅ Verification successful

The getSampleEvents implementation is consistent with the source's behavior

The implementation of getSampleEvents is correctly aligned with the source's functionality:

  • It uses the same message listing endpoint as the webhook subscription (/me/messages)
  • The parameters ($top and $orderby) are appropriate for retrieving recent messages
  • No folder-specific filtering is needed as the source monitors all incoming messages across folders through the webhook subscription
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any folder-specific filtering in message listing

# Search for message listing parameters across the codebase
rg -A 5 "listMessages|\/messages\?" ./components/microsoft_outlook/

Length of output: 174


Script:

#!/bin/bash
# Search for message listing parameters across the codebase
rg -A 5 "listMessages|/messages\?" ./components/microsoft_outlook/

Length of output: 1112


Script:

#!/bin/bash
# Search for getSampleEvents implementations
ast-grep --pattern 'async getSampleEvents() {
  $$$
}'

Length of output: 56


Script:

#!/bin/bash
# Search for message listing related code
rg -A 5 "\$top|\$orderby|listMessages|/messages" ./components/microsoft_outlook/

Length of output: 3481


Script:

#!/bin/bash
# Search for getSampleEvents method with a more flexible pattern
ast-grep --pattern 'getSampleEvents() {
  $$$
}'

Length of output: 50


Script:

#!/bin/bash
# Search for any folder-related message filtering
rg -A 5 "folder|mailFolder" ./components/microsoft_outlook/

Length of output: 2179


Script:

#!/bin/bash
# Search for the entire new-email.mjs file content
cat ./components/microsoft_outlook/sources/new-email/new-email.mjs

Length of output: 1380

@GTFalcao
Copy link
Collaborator

Hi @mchlbckr , thanks for your contribution!

The version number needs to be incremented both in the component being changed, and the package.json of the app.

Also, perhaps this behavior should be controlled by an optional boolean prop - defaulting to false (keeping the existing behavior), thus giving users the option to enable if desired. What do you think?

@mchlbckr
Copy link
Author

@GTFalcao Thanks for reviewing! Yes, I think either a boolean option would be better or an option to specify all folders that should be screened. Should I make a proposal for this?

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: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0df6a1e and 2b87190.

📒 Files selected for processing (1)
  • components/microsoft_outlook/sources/new-email/new-email.mjs (3 hunks)
🧰 Additional context used
🪛 eslint
components/microsoft_outlook/sources/new-email/new-email.mjs

[error] 37-37: A linebreak is required after '['.

(array-bracket-newline)


[error] 37-37: A linebreak is required before ']'.

(array-bracket-newline)


[error] 54-54: Expected a line break after this opening brace.

(object-curly-newline)


[error] 54-54: Expected a line break before this closing brace.

(object-curly-newline)


[error] 55-56: Missing trailing comma.

(comma-dangle)


[error] 69-69: A linebreak is required after '['.

(array-bracket-newline)


[error] 69-69: A linebreak is required before ']'.

(array-bracket-newline)

🔇 Additional comments (1)
components/microsoft_outlook/sources/new-email/new-email.mjs (1)

8-9: Consider version bump for breaking change

Changing from inbox-only to all-folders monitoring is a breaking change that could affect existing implementations. Consider bumping the major version number instead of a minor version bump.

Comment on lines 24 to 26
changeType: "created",
resource: "/me/mailfolders('inbox')/messages",
resource: "/me/messages",
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for subscription creation

The activate hook should include error handling for subscription creation failures, especially important now that it's monitoring all messages.

 async activate() {
+  try {
     await this.activate({
       changeType: "created",
       resource: "/me/messages",
     });
+  } catch (error) {
+    console.error("Failed to create subscription:", error);
+    throw new Error(`Failed to create message subscription: ${error.message}`);
+  }
 }

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines 35 to 49
const folders = this.folderIds?.length
? this.folderIds.map((id) => `/me/mailFolders/${id}/messages`)
: ["/me/messages"];

const results = [];
for (const folder of folders) {
const messages = await this.microsoftOutlook.listMessages({
resource: folder,
params: {
$top: pageSize,
$orderby: "createdDateTime desc",
},
});
results.push(...messages);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve result handling in getSampleEvents

The current implementation has several potential issues:

  1. Results from different folders aren't sorted by creation time
  2. No deduplication of messages that might appear in multiple folders
  3. Potential memory issues when aggregating results from many folders
 const results = [];
 for (const folder of folders) {
   const messages = await this.microsoftOutlook.listMessages({
     resource: folder,
     params: {
       $top: pageSize,
       $orderby: "createdDateTime desc",
     },
   });
-  results.push(...messages);
+  results.push(...messages.map(msg => ({...msg, sourceFolder: folder})));
 }
+// Sort all results by creation time
+results.sort((a, b) => 
+  new Date(b.createdDateTime) - new Date(a.createdDateTime)
+);
+// Deduplicate by message ID
+const uniqueResults = Array.from(
+  new Map(results.map(item => [item.id, item])).values()
+);
+return uniqueResults.slice(0, pageSize);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const folders = this.folderIds?.length
? this.folderIds.map((id) => `/me/mailFolders/${id}/messages`)
: ["/me/messages"];
const results = [];
for (const folder of folders) {
const messages = await this.microsoftOutlook.listMessages({
resource: folder,
params: {
$top: pageSize,
$orderby: "createdDateTime desc",
},
});
results.push(...messages);
}
const folders = this.folderIds?.length
? this.folderIds.map((id) => `/me/mailFolders/${id}/messages`)
: ["/me/messages"];
const results = [];
for (const folder of folders) {
const messages = await this.microsoftOutlook.listMessages({
resource: folder,
params: {
$top: pageSize,
$orderby: "createdDateTime desc",
},
});
results.push(...messages.map(msg => ({...msg, sourceFolder: folder})));
}
// Sort all results by creation time
results.sort((a, b) =>
new Date(b.createdDateTime) - new Date(a.createdDateTime)
);
// Deduplicate by message ID
const uniqueResults = Array.from(
new Map(results.map(item => [item.id, item])).values()
);
return uniqueResults.slice(0, pageSize);
🧰 Tools
🪛 eslint

[error] 37-37: A linebreak is required after '['.

(array-bracket-newline)


[error] 37-37: A linebreak is required before ']'.

(array-bracket-newline)

Comment on lines +13 to +18
folderIds: {
type: "string[]",
label: "Folder IDs to Monitor",
description: "Specify the folder IDs or names in Outlook that you want to monitor for new emails. Leave empty to monitor all folders.",
optional: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add validation and controls for folder monitoring

While the folderIds property is well-documented, consider adding:

  1. Input validation to ensure folder IDs match expected format
  2. Rate limiting controls to prevent API throttling
  3. Pagination settings for large folder structures
 folderIds: {
   type: "string[]",
   label: "Folder IDs to Monitor",
   description: "Specify the folder IDs or names in Outlook that you want to monitor for new emails. Leave empty to monitor all folders.",
   optional: true,
+  validate: (ids) => {
+    if (!ids?.length) return true;
+    return ids.every(id => /^[A-Za-z0-9-_]+$/.test(id));
+  },
 },
+maxItemsPerRun: {
+  type: "integer",
+  label: "Max Items Per Run",
+  description: "Maximum number of items to process per execution",
+  optional: true,
+  default: 100,
+},

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines 67 to 82
const folders = this.folderIds?.length
? this.folderIds.map((id) => `/me/mailFolders/${id}/messages`)
: ["/me/messages"];

for (const folder of folders) {
await this.run({
event,
emitFn: async ({ resourceId } = {}) => {
const item = await this.microsoftOutlook.getMessage({
resource: folder,
messageId: resourceId,
});
this.emitEvent(item);
},
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve performance and reliability of the run method

The current implementation processes folders sequentially without error handling or rate limiting. Consider:

  1. Adding concurrent processing with rate limiting
  2. Implementing per-folder error handling
  3. Adding retry logic for transient failures
+const CONCURRENCY_LIMIT = 3;
+const RETRY_ATTEMPTS = 3;
+
 async run(event) {
   const folders = this.folderIds?.length
     ? this.folderIds.map((id) => `/me/mailFolders/${id}/messages`)
     : ["/me/messages"];

-  for (const folder of folders) {
+  const processBatch = async (folderBatch) => {
+    await Promise.all(folderBatch.map(async (folder) => {
+      for (let attempt = 1; attempt <= RETRY_ATTEMPTS; attempt++) {
+        try {
+          await this.run({
+            event,
+            emitFn: async ({ resourceId } = {}) => {
+              const item = await this.microsoftOutlook.getMessage({
+                resource: folder,
+                messageId: resourceId,
+              });
+              this.emitEvent(item);
+            },
+          });
+          break;
+        } catch (error) {
+          if (attempt === RETRY_ATTEMPTS) {
+            console.error(`Failed to process folder ${folder}:`, error);
+          }
+          await new Promise(resolve => setTimeout(resolve, 1000 * attempt));
+        }
+      }
+    }));
+  };
+
+  // Process folders in batches
+  for (let i = 0; i < folders.length; i += CONCURRENCY_LIMIT) {
+    const batch = folders.slice(i, i + CONCURRENCY_LIMIT);
+    await processBatch(batch);
   }
 }

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 eslint

[error] 69-69: A linebreak is required after '['.

(array-bracket-newline)


[error] 69-69: A linebreak is required before ']'.

(array-bracket-newline)

@mchlbckr
Copy link
Author

Hey @GTFalcao @pipedream-component-development Do you have any update on this issue? Thanks!

@GTFalcao
Copy link
Collaborator

GTFalcao commented Jan 4, 2025

Hey @mchlbckr thanks for updating this, I saw your commit after we talked about the optional prop - looks good to me! I'm moving this forward to the QA stage

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check the test report below for more information
https://vunguyenhung.notion.site/Update-new-email-mjs-171bf548bb5e812dbe1adb3b652e3c76

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check the test report below for more information
https://vunguyenhung.notion.site/Update-new-email-mjs-171bf548bb5e812dbe1adb3b652e3c76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User submitted Submitted by a user
Projects
Development

Successfully merging this pull request may close these issues.

6 participants