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-contact-property-change.mjs #8462

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

MCKLtech
Copy link
Contributor

@MCKLtech MCKLtech commented Oct 13, 2023

Slack Discussion: https://pipedream-users.slack.com/archives/CMZG4EBJ9/p1697210929916869

https://api.hubapi.com/crm/v3/objects/contacts/batch/read can only accept 50 inputs per call. If there are more than 50 contacts, it will fail with the following message:

"The maximum number of inputs supported in a batch request for property histories is 50. Please reduce the number of items and try again"

The code loops over the Contact IDs and limits the inputs to less than 50.

WHAT

🤖 Generated by Copilot at 3741e30

Improved the performance and reliability of the new-contact-property-change source by processing the updated contacts in batches. Added a batchSize variable and a for loop to new-contact-property-change.mjs to implement the batching logic.

🤖 Generated by Copilot at 3741e30

batchSize splits contacts
HubSpot API is spared
after marks time

WHY

Fixes bug whereby the workflow will fail if there are more than 50 Contacts in the BATCH API call

HOW

🤖 Generated by Copilot at 3741e30

  • Reduce the number of API calls to HubSpot by processing updated contacts in batches of 45 (link)

Slack Discussion: https://pipedream-users.slack.com/archives/CMZG4EBJ9/p1697210929916869

https://api.hubapi.com/crm/v3/objects/contacts/batch/read can only accept 50 inputs per call. If there are more than 50 contacts, it will fail with the following message:

"The maximum number of inputs supported in a batch request for property histories is 50. Please reduce the number of items and try again"

The code loops over the Contact IDs and limits the inputs to less than 50.
@dylburger dylburger added the User submitted Submitted by a user label Oct 13, 2023
@vercel
Copy link

vercel bot commented Oct 13, 2023

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

Name Status Preview Comments Updated (UTC)
pipedream-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2023 3:44pm
pipedream-docs-redirect-do-not-edit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2023 3:44pm

@dylburger dylburger added this to Ready for PR review in Component (Source and Action) Backlog Oct 13, 2023
@dylburger dylburger added the triaged For maintainers: This issue has been triaged by a Pipedream employee label Oct 13, 2023
@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:

@alysonturing
Copy link
Contributor

You need to bump the version of the component that you enhanced and the package.json too

@alysonturing alysonturing moved this from Ready for PR review to Changes Required in Component (Source and Action) Backlog Oct 13, 2023
Copy link
Contributor

@alysonturing alysonturing left a comment

Choose a reason for hiding this comment

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

  1. You need to change the version of components/hubspot/sources/new-contact-property-change/new-contact-property-change.mjs.
  2. You need to change the version of components/hubspot/package.json.

@michelle0927 michelle0927 moved this from Ready for PR review to Ready for QA in Component (Source and Action) Backlog Nov 21, 2023
@vunguyenhung vunguyenhung moved this from Ready for QA to In QA in Component (Source and Action) Backlog Nov 22, 2023
@vunguyenhung vunguyenhung moved this from In QA to Ready for release in Component (Source and Action) Backlog Nov 22, 2023
@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/Update-new-contact-property-change-mjs-8462-0f8fa434783142be846aff415155a28b

@michelle0927 michelle0927 merged commit 6680323 into PipedreamHQ:master Nov 22, 2023
9 checks passed
@michelle0927 michelle0927 moved this from Ready for release to Done in Component (Source and Action) Backlog Nov 22, 2023
Ahmad-anility pushed a commit to Anility/pipedream-anility that referenced this pull request Jan 3, 2024
* Update new-contact-property-change.mjs

Slack Discussion: https://pipedream-users.slack.com/archives/CMZG4EBJ9/p1697210929916869

https://api.hubapi.com/crm/v3/objects/contacts/batch/read can only accept 50 inputs per call. If there are more than 50 contacts, it will fail with the following message:

"The maximum number of inputs supported in a batch request for property histories is 50. Please reduce the number of items and try again"

The code loops over the Contact IDs and limits the inputs to less than 50.

* bump versions

* package.json

---------

Co-authored-by: michelle0927 <michellelbergero@hotmail.com>
Co-authored-by: michelle0927 <michelle0927@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged For maintainers: This issue has been triaged by a Pipedream employee User submitted Submitted by a user
Development

Successfully merging this pull request may close these issues.

None yet

6 participants