-
Notifications
You must be signed in to change notification settings - Fork 284
[Hubspot] Add de duplication for assosiations #3336
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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3336 +/- ##
==========================================
- Coverage 80.32% 79.98% -0.34%
==========================================
Files 1257 1204 -53
Lines 25159 22323 -2836
Branches 5217 4416 -801
==========================================
- Hits 20208 17855 -2353
+ Misses 4163 3685 -478
+ Partials 788 783 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR adds deduplication functionality for HubSpot associations to prevent API errors when the same association appears multiple times in a single batch request. The HubSpot API rejects batches containing duplicate association references, so this change filters out duplicates before sending payloads.
Key changes:
- Added a new
deDuplicateAssociations
helper function that removes duplicate associations based on a composite key - Integrated the deduplication logic into the main
send
function in the upsertObject action - Added comprehensive unit tests for the new deduplication functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/destination-actions/src/destinations/hubspot/upsertObject/index.ts |
Imports and applies the new deduplication function to association payloads before sending to HubSpot |
packages/destination-actions/src/destinations/hubspot/upsertObject/functions/validation-functions.ts |
Implements the deDuplicateAssociations function and includes some formatting changes from Prettier |
packages/destination-actions/src/destinations/hubspot/upsertObject/__tests__/validate.test.ts |
Adds comprehensive test coverage for the new deduplication functionality |
packages/destination-actions/src/destinations/hubspot/upsertObject/index.ts
Outdated
Show resolved
Hide resolved
.../destination-actions/src/destinations/hubspot/upsertObject/functions/validation-functions.ts
Outdated
Show resolved
Hide resolved
LGTM, please address co-pilot comments |
Co-authored-by: Copilot <[email protected]>
packages/destination-actions/src/destinations/hubspot/upsertObject/__tests__/validate.test.ts
Show resolved
Hide resolved
Hi @harsh-joshi99 - do you have any proof of testing you can attach? |
PR deployed - however Integrations Worker not yet deployed due to deployment issue. |
This update prevents duplicate associations from being included in a single batch request. The HubSpot API does not allow multiple references to the same association within the same batch, which was previously causing errors.
A new helper function has been added to de-duplicate associations before sending the payload to HubSpot.
There are some unrelated Prettier changes.
JIRA -> https://twilio-engineering.atlassian.net/browse/STRATCONN-6106
Testing
Testing Doc.
Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.