Repository navigation
feat(klaviyo): add unique_id support for create events APIs - #4646
Conversation
- Add unique_id field to track events in both v1 and v2 APIs - Use messageId as unique_id for event deduplication - Update test data to include unique_id validation - Resolves INT-4135
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughA new field unique_id is set on event attributes in trackOrScreenRequestHandler within src/v0/destinations/klaviyo/transformV2.js, assigning attributes.unique_id = message.messageId for track and screen events. No other code paths or exports are modified. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/v0/destinations/klaviyo/transformV2.js (1)
100-101: Preserve caller-provided unique_id; only fallback to message.messageIdDon't overwrite attributes.unique_id — set it from message.messageId only when unique_id is absent and message.messageId is defined.
File: src/v0/destinations/klaviyo/transformV2.js (around lines 98–102)
- attributes.unique_id = message.messageId; + // Prefer caller-provided unique_id; fall back to messageId when absent + if (!isDefinedAndNotNull(attributes.unique_id) && isDefinedAndNotNull(message.messageId)) { + attributes.unique_id = message.messageId; + }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
CHANGELOG.mdis excluded by!**/*.mdpackage-lock.jsonis excluded by!**/package-lock.json,!**/*.jsonpackage.jsonis excluded by!**/*.jsontest/integrations/destinations/klaviyo/processor/ecomTestData.tsis excluded by!**/test/**test/integrations/destinations/klaviyo/processor/trackTestData.tsis excluded by!**/test/**test/integrations/destinations/klaviyo/processor/trackTestDataV2.tsis excluded by!**/test/**test/integrations/destinations/klaviyo/router/dataV2.tsis excluded by!**/test/**
📒 Files selected for processing (1)
src/v0/destinations/klaviyo/transformV2.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
Focus on ESLint errors (max 3) and warnings (max 5).
Files:
src/v0/destinations/klaviyo/transformV2.js
🧠 Learnings (1)
📓 Common learnings
Learnt from: ItsSudip
PR: rudderlabs/rudder-transformer#4497
File: src/v0/destinations/tiktok_ads/transformV2.js:686-691
Timestamp: 2025-07-15T06:27:07.528Z
Learning: For TikTok Ads destination in src/v0/destinations/tiktok_ads/transformV2.js, there are plans for a future enhancement to group events by eventSource when batching to ensure all events in a batch have the same event_source value, as acknowledged by ItsSudip in PR #4497.
🧬 Code graph analysis (1)
src/v0/destinations/klaviyo/transformV2.js (3)
src/v0/destinations/klaviyo/util.js (1)
attributes(181-184)src/v0/destinations/klaviyo/transform.js (1)
attributes(171-171)src/v0/util/index.js (2)
message(1162-1162)message(1196-1196)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v1.108.0 #4646 +/- ##
=================================================
Coverage 91.78% 91.78%
=================================================
Files 642 642
Lines 33973 33974 +1
Branches 8045 8048 +3
=================================================
+ Hits 31183 31184 +1
Misses 2538 2538
Partials 252 252 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



What are the changes introduced in this PR?
This PR adds support for unique_id field in Klaviyo create events APIs for both v1 and v2 versions. The unique_id is used for event deduplication and is set to the messageId from the incoming event.
What is the related Linear task?
Resolves INT-4135
Please explain the objectives of your changes below
The changes implement unique_id support for Klaviyo track events to enable proper event deduplication. This ensures that duplicate events are not processed multiple times by Klaviyo's API.
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
Any technical or performance related pointers to consider with the change?
@coderabbitai review
Developer checklist
Reviewer checklist