-
Notifications
You must be signed in to change notification settings - Fork 281
Worked on handling empty array being sent to Klaviyo resulting 400 Bad request. #2885
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2885 +/- ##
===========================================
+ Coverage 32.57% 77.92% +45.35%
===========================================
Files 14 1047 +1033
Lines 703 19253 +18550
Branches 119 3755 +3636
===========================================
+ Hits 229 15003 +14774
- Misses 474 2927 +2453
- Partials 0 1323 +1323 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
packages/destination-actions/src/destinations/klaviyo/removeProfile/index.ts
Show resolved
Hide resolved
varadarajan-tw
approved these changes
Apr 28, 2025
@Innovative-GauravKochar - This PR has been deployed |
akhsueh
pushed a commit
to akhsueh/action-destinations
that referenced
this pull request
May 16, 2025
…request. (segmentio#2885) * Worked on fixing empty array being sent to Klaviyo * Unit Test cases for removeProfile --------- Co-authored-by: Gaurav Kochar <gaurav.kochar@segment.com>
joe-ayoub-segment
added a commit
that referenced
this pull request
May 28, 2025
* add phone number support to reddit-conversions-api * Update order of mapping for phone numbers Co-authored-by: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com> * [Twilio-Messaging-Omnichannel] Register and set up Basic Authentication (#2827) * Initial commit on branch * Delete packages/destination-actions/src/destinations/twilio-messaging-omnichannel/__tests__/index.test.ts * Delete packages/destination-actions/src/destinations/twilio-messaging-omnichannel/__tests__/snapshot.test.ts * Delete packages/destination-actions/src/destinations/twilio-messaging-omnichannel/sendMessage/__tests__/snapshot.test.ts * Delete packages/destination-actions/src/destinations/twilio-messaging-omnichannel/sendMessage/__tests__/index.test.ts * [Salesforce] Advanced stats for CSV generation (#2825) * WIP * Adds stats around CSV generation. Counts the number of columns and rows. Counts the number of actual values and number of nulls for the whole CSV. Unit tests included * Log out the CSV stats after the job is created to ensure the jobID is a defined tag * [STRATCONN-5603] - Format timestamp fields without miliiseconds (#2816) * [STRATCONN-5603] - Format timestamp fields without miliiseconds * Revert type changes * Revert type changes * [GEC] Simplify convertTimestamp Regex * Revert unintended change * [STRATCONN-5601] add subscription object support for unsubscribeProfile action in Klaviyo (#2814) * add subscription object support for unsubscribeProfile action in Klaviyo * update snapshots * add tests * add tests * fix comments * Made Event properties hidden (#2813) Co-authored-by: Gaurav Kochar <gaurav.kochar@segment.com> * [Criteo] Audience Destination: set enable_batching to true by default (#2771) * [Criteo] Audience Destination: set enable_batching to true by default * Criteo Audience Destination: make 'Enable Batching' optional * Criteo Audience Destination: updated generated types --------- Co-authored-by: m.dillar <m.dillar@criteo.com> * [algolia-insights] update presets for conversion events (#2770) * deprecate Product Added * update conversion presets * fix * Register twilio messaging omnichannel destination (#2829) * Publish (#2830) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Support min/max string length validation (#2831) * Passes on the InputField min and max properties to JSONSchema for validation * Adds unit tests and updated comment descriptions for string field min/max * [Salesforce Marketing Cloud] V2 Data Extension mapping save hook (#2826) * Scaffolds new v2 actions * Hook Definition and fields from the original branch * dataExtensionV2 action filled out with the action definition from original branch * contactdataExtensionV2 action filled out with the action definition from original branch * Generates types * Fixes build. Introduces an upsertRowsV2 function for the new actions * Declares keys and values fields as dynamic only in the V2 actions to ensure no new behavior for the existing actions * Adds a little (V2) suffix to the titles for the new actions * Improves error message when users encounter auth issues for data extension id dynamic field * When a user doesn't have auth permission to lookup a data extension, use the ID they provide without verifying it. Provide improved error messaging * Throw an error if no data extension is connected to the mapping * Eventbridge enhancements (#2828) * Passes on the InputField min and max properties to JSONSchema for validation * [required-field-check] Run yarn install after switching to main branch (#2801) * [required-field-check] Run install after switching to main branch * Add more comments * Eventbridge cosmetic changes (#2807) * Description changes * Description changes * additional enhancements * eventbridge enhancements * eventbridge enhancements * changed Error to IntegrationError --------- Co-authored-by: Nick Aguilar <nicholas.aguilar@segment.com> Co-authored-by: Varadarajan V <109586712+varadarajan-tw@users.noreply.github.com> * Publish (#2835) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * [STRATCONN-5608] - Make ssl_enabled and ssl_reject_unauthorized_ca settings optional (#2832) * Revert "Fix Test cases (#2538)" (#2844) This reverts commit dda2c53. * Update Trubrics action destination (#2784) * Test * Test * update types * final * identify * pr comments * utils https * add thread_id * fix tests --------- Co-authored-by: Jeff Kayne <43336277+jeffkayne@users.noreply.github.com> * [STRATCONN-5473] Add destinationInstanceID and subscriptionId to support audience fanout for Liveramp Audiences (#2786) * [STRATCONN-5473] Add destinationInstanceID and subscriptionId to support audience fanout * Revert Tradesk Changes * handle file path edge cases * handle file path edge cases * Add Tests * [SMART-HASHING] [STRATCONN-5636] Updated smart-hashing in delivrai-activate (#2836) * Updated smart-hashing in delivrai-activate * Updated unit test cases * [Smart Hashing] [Snap Conversions API] Implement Smart hashing for Snap Conversions API (#2837) * Implement Smart hashing for Snap Conversions API * Return undefined from smart hash if hash field are not defined * [SMART-HASHING] [STRATCONN-5637] Updated smart-hashing in dynamic-yield (#2839) * Updated smart-hashing in dynamic-yield * Removed email formating * Fixed test cases * Return undefined from smart hash if hash field are not defined (#2841) * [Smart Hashing] [Snap Audience] Implement Smart hashing for Snap Audience (#2843) * Implement Smart hashing for Snap Audience * Remove console log * Publish (#2845) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add hashedPII category to all fields that are hashed using process hashing (#2847) * [Smart Hashing] Remove redundant hashing descriptions (#2848) * [GEC] update description * [Amazon AMC] Update description * [Tiktok-offline-conversions] Update hashing description * update generated-types * Update packages/destination-actions/src/destinations/amazon-amc/syncAudiencesToDSP/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [Amazon AMC] update types --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Correct Presets for Linked Audience Activations * Handles non-http error in SFMC multistatus handler (#2854) * Handles non-http error in SFMC multistatus handler * Update tests * Update test case * Amazon AMC - Increased http client timeout to 15 seconds (#2852) * Publish (#2855) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * [Google Ads] Standardize Phone Number Formatting (#2810) * [STRATCONN-5676] - Adds support braze web sdk - 5.8.1 (#2833) * [STRATCONN-5602] - Sendgrid EU endpoint (#2849) * [Sendgrid] Add support for EU endpoint * Update sendEmail action to use regional endpoints * Update uri format * Add tests * Add tests for dynamic fields * Fix template content url * Update Liveramp Docs (#2862) * Update Liveramp Docs * Update Liveramp Docs * Update membership lifespan (#2863) * Publish (#2864) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add mapping-kit labels and alert (#2867) * Add error when no audience found (#2872) * Angler AI - Add missing payload field (#2818) * initial commit * fix failing tests * updated saveUser action * updated saveOrder action * updated saveEvent action * added action descriptions * updated presets * flattened saveEvent mapping * fixed saveEvent.perform * fixed saveEvent mapping * updated snapshots * updated snapshots * fixed saveEvent payload structure * don't include empty objects in payload * updated * progress * restructure events * remove defaults for optional fields * restore address field * update untranslated title default values * updated snapshots * remove unused import * fixed default paths * reorganized saveUser fields * updated saveBaseEvent fields * fixed default_address default in saveUser * moved custom event name to saveBaseEvent * updated tests * added defaults for customer field in saveEvent * test commit * refactor fields * consistent naming for fields variables * removed cartFields from saveCartEvent * removed less important saveOrder fields * updated event names * moved event name field from common fields * fixed field name * refactor event fields * updated generated types * updated tests * fixed checkout fields * updated payload transformation functions * removed custom event preset * fixed identifiers transformation * updated tests * wrapped cart and checkout fields into objects * updated tests * minor changes to presets * added missing checkout event name * fixed saveUser payload structure * fixed typo * updated tests * fix customers endpoint url * add preset for saveOrder * add email and phone to checkout payload * add billing and shipping address to checkout object * update snapshots * save line items * update snapshots * update tests for saveOrder * generate line item id * update snapshots * add missing custom_event_name field to saveCustomEvent --------- Co-authored-by: Jonathan Sudhakar <1854861+jonathansudhakar1@users.noreply.github.com> Co-authored-by: Joe Ayoub <joe.ayoub@segment.com> * Add fs_user_id and web_user_id to Optimizely payload interfaces (#2789) * Add fs_user_id and web_user_id to Optimizely payload interfaces * Add fs_user_id and web_user_id fields to Optimizely user identifiers * Generates types * Updates unit test snapshots * Manually sets snapshot expectation to address broken test * Manually sets snapshot expectation to address broken test, again --------- Co-authored-by: Manuel Nuñez <manuel.nunez@optimizely.com> Co-authored-by: Nick Aguilar <nicholas.aguilar@segment.com> * Publish (#2882) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Added MultiStatus Documentation (#2886) * Fix MultiStatus README (#2887) * MultiStatus Readme Fix (#2889) * Disable failing logrocket tests (#2890) * Disable logrocket tests till they are fixed * Disable another test * [Klaviyo] Handle empty array being sent to Klaviyo resulting 400 Bad request. (#2885) * Worked on fixing empty array being sent to Klaviyo * Unit Test cases for removeProfile --------- Co-authored-by: Gaurav Kochar <gaurav.kochar@segment.com> * Add initial status to drip destination (#2884) Co-authored-by: Jacob Meyer <jacobpmeyer87@gmail.com> * Allow only dropdown value in objectType and toObjectType in UpsertCustomObjectRecord. (#2881) * Disabled other enteries in obejctTYpe and toObjectType expect dropdown value * . --------- Co-authored-by: Gaurav Kochar <gaurav.kochar@segment.com> * [HubSpot] Fix data type validations (#2866) Co-authored-by: Gaurav Kochar <gaurav.kochar@segment.com> * [STRAT-5634] | Multistatus Support on Google Enhanced Conversions. (#2853) * Worked on implementing multistatus support on google enhanced conversions * Made external audience Id mandatory * Removed hardcoded token * Handle externalAudienceId * Commenting , just typo fix --------- Co-authored-by: Gaurav Kochar <gaurav.kochar@segment.com> * Update Rokt-Audiences Destination to support emailsha256 values (#2851) * build: updates * fix: run yarn types * fix: build errors * Postscript Events for Entered/Exit Segment Audience (#2842) * Add events for entered and exited audience * Add nock for events for tests * [eventbridge] support for multi-status response (#2859) * support for multi-status response * changed title of action Send to SendV2 * added feature flag code check * [Podscribe] New hashed_email property field (#2819) * Add library field to Podscribe destination * Handle case when payload.library is undefined * Remove format validation from email field * Update test snapshots * Add library field to Podscribe destination * Handle case when payload.library is undefined * Update test snapshots * feat(podscribe) add hashed_email properties field and user_id settings field * fix(sergment) add hashed email * fix(podscribe) clean up * fix(podscribe) update test snapshot * fix(podscribe) re-generate types * Publish (#2892) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * STRATCONN-5564 - add sales objects (#2888) * added sales type objects to SUPPORTED_HUBSPOT_OBJECT_TYPES * added product * removed quotes and leads * add hubspot objects (#2898) * adding new regions for Braze (#2896) * Add User-Agent header to Drip destination for source identification (#2897) * small updates to the default mappings in the Reddit CAPI integration (#2893) Co-authored-by: Austin Hsueh <austin.hsueh@reddit.com> * [Smart Hashing] [Liveramp Audiences] Cleanup (#2883) * cleanup for smart hashing * Update fb test to use processHashing. * Use processHashing instead of old hashing util * [STRATCONN-5489] - Add batch_keys to Klaviyo actions (#2880) * [STRATCONN-5489] - Add batch_keys to Klaviyo actions * Fix build * UpsertProfile - add override_list_id to batch keys * Add stats to measure grouping * handle undefined statsclient * Fix tests * Add snapshot tests for batch keys * Remove unused stat * [STRATCONN-5657] - Add batch keys to webhook action destination (#2878) * [STRATCONN-5657] - Add batch keys to webhook action destination * Add stats * Use histogram * Add test for batch keys * Supporting Group event in Userpilot cloud destination (#2838) * Loops destination: ability to sync contact properties when sending events (#2792) * Added contact properties to Send event action * Type for contactProperties * Type for full payload * Update generated-types.ts * feat: vendorId in purchase (#2766) * Publish (#2900) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * [Smart Hashing] Add smart hashing documentation in readme (#2860) * Add smart hashing documentation in readme * Update smart hashing documentation * update heading * update docs * Update smart hashing documentation * [Smart Hashing] Add eslint rule to limit usage of createHash from crypto module (#2861) * Add eslint rule to limit usage of createHash from crypto module * Update error message * [Smart Hashing] Cleanup (#2876) * cleanup for smart hashing * cleanup for smart hashing * [Smart Hashing] Cleanup (#2877) * cleanup for smart hashing * Remove createHash from test file * [Smart Hashing] Cleanup (#2879) * cleanup for smart hashing * Update reddit conversions test case * Publish (#2901) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * STRATCONN-5564: add quotes object support (#2910) * Update subscription presets and action descriptions for audience destinations for Journeys V2 (#2894) * Update subscription presets and action descriptions * Update the sync destination's description * Change 'Journeys Step Transition Track' to 'Journeys Step Entered' * added cleaning and hashing function and updated tests * update cleanPhoneNumber for optional phoneNumber --------- Co-authored-by: Austin Hsueh <austin.hsueh@reddit.com> Co-authored-by: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com> Co-authored-by: rvadera12 <89420099+rvadera12@users.noreply.github.com> Co-authored-by: Nick Aguilar <nicholas.aguilar@segment.com> Co-authored-by: Varadarajan V <109586712+varadarajan-tw@users.noreply.github.com> Co-authored-by: Arijit Ray <35370469+itsarijitray@users.noreply.github.com> Co-authored-by: Innovative-GauravKochar <117165746+Innovative-GauravKochar@users.noreply.github.com> Co-authored-by: Gaurav Kochar <gaurav.kochar@segment.com> Co-authored-by: Marc Dillar <marc.dillar@gmail.com> Co-authored-by: m.dillar <m.dillar@criteo.com> Co-authored-by: Jessica <jessh.dev@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mayur-pitale <109548891+mayur-pitale@users.noreply.github.com> Co-authored-by: guillaumefontan <82604059+guillaumefontan@users.noreply.github.com> Co-authored-by: Jeff Kayne <43336277+jeffkayne@users.noreply.github.com> Co-authored-by: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com> Co-authored-by: harsh-joshi99 <129737395+harsh-joshi99@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Drew Thompson <37553273+drew-thompson@users.noreply.github.com> Co-authored-by: Sayan Das <109198085+sayan-das-in@users.noreply.github.com> Co-authored-by: maryamsharif <99763167+maryamsharif@users.noreply.github.com> Co-authored-by: victor-ru <ruban.victor@mail.ru> Co-authored-by: Jonathan Sudhakar <1854861+jonathansudhakar1@users.noreply.github.com> Co-authored-by: Joe Ayoub <joe.ayoub@segment.com> Co-authored-by: Manuel Núñez <manuelnt11@gmail.com> Co-authored-by: Manuel Nuñez <manuel.nunez@optimizely.com> Co-authored-by: Stephen Webber <42975588+stevedrip@users.noreply.github.com> Co-authored-by: Jacob Meyer <jacobpmeyer87@gmail.com> Co-authored-by: Ben Goodman <52042939+GoodmanBen@users.noreply.github.com> Co-authored-by: James Bathgate <julesbravo@gmail.com> Co-authored-by: pitronalldak <ryabinin.p.b@gmail.ru> Co-authored-by: monutwilio <monkumar@twilio.com> Co-authored-by: Arjun Bhandage <abhandage@twilio.com> Co-authored-by: Jacob Meyer <49496782+jacobpmeyer@users.noreply.github.com> Co-authored-by: ThabetIbrahim <thabet.ig@gmail.com> Co-authored-by: Dan <hello@danrowden.com> Co-authored-by: Felipe Rivera Cienfuegos <63276808+FelipeRiveraC@users.noreply.github.com> Co-authored-by: Miguel Pavon Diaz <71112226+miguelpdiaz8@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to handle empty array being sent to Klaviyo resulting 400 Bad Request.
Jira Ticket :- https://segment.atlassian.net/jira/software/c/projects/STRATCONN/boards/310?assignee=63617339fc0cc7a600b03c6b&selectedIssue=STRATCONN-5759
Problem:-

When Data is sent as empty array due to no profile Id found for provided identifier.
API threw an error.

Solution:-

When Data is sent as empty array due to no profile Id found for provided identifier,handled it and throws a Payload Validation Error before making an API request.
In case of valid Identifier , it successfully makes an API request and works as expected.

Testing
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.