-
Notifications
You must be signed in to change notification settings - Fork 284
Fix batching for editCustomerMatchMembers action in first party DV360 #3232
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: abhandage <[email protected]>
Co-authored-by: abhandage <[email protected]>
editCustomerMatchMembers
action in first party DV360
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (64.70%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3232 +/- ##
==========================================
+ Coverage 79.84% 79.86% +0.01%
==========================================
Files 1184 1184
Lines 21808 21818 +10
Branches 4248 4250 +2
==========================================
+ Hits 17413 17424 +11
Misses 3646 3646
+ Partials 749 748 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
// Filter out payloads that don't have mobile device ids | ||
const validPayloads = payloads.filter(payload => payload.mobileDeviceIds !== undefined) |
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.
@copilot this is not required, you can assume that the payloads are already filtered
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.
You're absolutely right. I've removed the unnecessary filtering from both editDeviceMobileIds
and editContactInfo
functions since the actions framework already validates payloads before calling these functions. The code is now cleaner and more efficient. Changes committed in 7425747.
// Filter out payloads that don't have any required identifiers | ||
const validPayloads = payloads.filter(payload => | ||
payload.emails !== undefined || | ||
payload.phoneNumbers !== undefined || | ||
payload.firstName !== undefined || | ||
payload.lastName !== undefined | ||
) |
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.
@copilot this is not required, you can assume that all payloads are valid
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.
You're absolutely right. I've already removed the unnecessary payload filtering logic in commit 7425747. The functions now process all payloads without validation since the actions framework already ensures payload validity.
Co-authored-by: abhandage <[email protected]>
The
editContactInfo
andeditDeviceMobileIds
functions in the first-party-dv360 destination were not properly handling batch requests, causing data loss for all but the first payload in each batch.Problem
When batching was enabled, the functions only processed the first payload in the array:
This meant that in a batch of 10 events, only the first event would be sent to DV360, and the remaining 9 events would be silently dropped.
Solution
Updated both functions to process all payloads in the batch:
Changes Made
editContactInfo
: Now processes all payloads in the batcheditDeviceMobileIds
: Now processes all payloads in the batchTest Coverage
Added comprehensive batch tests covering:
The fix ensures that when customers enable batching for DV360 audience management, all events in the batch are properly processed instead of losing data.
Fixes #3231.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.