Skip to content

fix: tiktok remove lowercasing for custom events - #2926

Closed
anantjain45823 wants to merge 13 commits into
hotfix/Dec.18from
fix.titkokeventlowercasing
Closed

anantjain45823 wants to merge 13 commits into
hotfix/Dec.18from
fix.titkokeventlowercasing

Conversation

@anantjain45823

@anantjain45823 anantjain45823 commented Dec 15, 2023 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

For custom events we are lowering their event name but we should retain the message event case as these are case sensitive at tiktok side

Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here

Type of change

If the pull request is a bug-fix, enhancement or a refactor, please fill in the details on the changes made.

  • Existing capabilities/behavior

  • New capabilities/behavior

If the pull request is a new feature,

Any technical or performance related pointers to consider with the change?

N/A

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

N/A

If the PR has changes in more than 10 files, please mention why the changes were not split into multiple PRs.

N/A

If multiple linear tasks are associated with the PR changes, please elaborate on the reason:

N/A


Developer checklist

  • No breaking changes are being introduced.

  • Are all related docs linked with the PR?

  • Are all changes manually tested?

  • Does this change require any documentation changes?

  • Are relevant unit and component test-cases added?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

Summary by CodeRabbit

  • Bug Fixes

    • Improved event handling logic for more accurate tracking in the TikTok Ads integration.
  • Tests

    • Expanded test suite with new cases for TikTok Ads to ensure robustness and reliability.

aashishmalik and others added 11 commits December 13, 2023 15:08
Bumps [actions/stale](https://github.com/actions/stale) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v8.0.0...v9.0.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Krishna Chaitanya <[email protected]>
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 5.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v4.1.1...v5.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Krishna Chaitanya <[email protected]>
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.9.1 to 3.0.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v2.9.1...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Krishna Chaitanya <[email protected]>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.7.0 to 4.0.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v3.7.0...v4.0.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Krishna Chaitanya <[email protected]>
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3.5.3...v4.1.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@anantjain45823 anantjain45823 self-assigned this Dec 15, 2023
@anantjain45823
anantjain45823 requested review from a team and sivashanmukh as code owners December 15, 2023 15:55
@coderabbitai

coderabbitai Bot commented Dec 15, 2023 •

Copy link
Copy Markdown
Contributor

Important

Auto Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Walkthrough

The recent updates involve modifying the event handling logic in a TikTok Ads integration. Specifically, the way the event variable is determined has been changed in the transformation function, which could impact how events are processed and named. Additionally, new test data for TikTok Ads has been added, providing configurations and expected inputs and outputs for testing purposes.

Changes

File Path Change Summary
src/v0/.../tiktok_ads/transform.js Updated the trackResponseBuilder function to change the assignment of the event variable from eventNameMapping[event] or event to eventNameMapping[event] or message.event.
test/.../tiktok_ads/processor/data.ts Added a new tiktok_ads object to the test data array, including properties such as name, description, and nested objects for configurations.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@anantjain45823

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 52e5a0d and c8cbfbd.
Files selected for processing (2)
  • src/v0/destinations/tiktok_ads/transform.js (1 hunks)
  • test/integrations/destinations/tiktok_ads/processor/data.ts (1 hunks)
Additional comments: 3
src/v0/destinations/tiktok_ads/transform.js (2)
  • 158-160: The change to retain the case of message.event aligns with the PR objective to fix the issue with case sensitivity in TikTok Ads integration. This ensures that custom event names are sent as they are received without converting them to lowercase.

  • 158-160: Verify that eventNameMapping contains all the necessary mappings and that message.event is always defined when this function is called to prevent any potential issues with undefined or null values.

test/integrations/destinations/tiktok_ads/processor/data.ts (1)
  • 4956-5125: The test case 'Test 29 -> Camel Case Custom Event Pass' has been added to ensure that custom events with camel case names are processed correctly when sendCustomEvents is set to true. This is a good addition to the test suite as it checks for case sensitivity in event handling, which is important for compatibility with TikTok's case-sensitive event name requirements. Ensure that the actual implementation correctly handles event names in both lower case and camel case.

@codecov

codecov Bot commented Dec 15, 2023 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (69ba1b6) 87.27% compared to head (a67d279) 87.27%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2926   +/-   ##
========================================
  Coverage    87.27%   87.27%           
========================================
  Files          790      790           
  Lines        29211    29211           
  Branches      6831     6831           
========================================
  Hits         25494    25494           
  Misses        3373     3373           
  Partials       344      344           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud

Copy link
Copy Markdown

@koladilip

Copy link
Copy Markdown
Contributor

What about device mode?

@sanpj2292

Copy link
Copy Markdown

Don't understand where lower-casing of event is happening 🤔

@anantjain45823

Copy link
Copy Markdown
Contributor Author

Don't understand where lower-casing of event is happening 🤔

@sanpj2292 L133 transform.js

@anantjain45823
anantjain45823 changed the base branch from develop to hotfix/Dec.18 December 18, 2023 05:06
@anantjain45823

Copy link
Copy Markdown
Contributor Author

Moved to #2930

@devops-github-rudderstack
devops-github-rudderstack deleted the fix.titkokeventlowercasing branch March 16, 2024 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants