Skip to content

fix(attentive_tag): correct identity resolution logic and add test cases - #4513

Merged
manish339k merged 4 commits into
developfrom
fix.attentive.identity
Jul 22, 2025
Merged

manish339k merged 4 commits into
developfrom
fix.attentive.identity

Conversation

@manish339k

@manish339k manish339k commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

  • Fix identity resolution condition to properly handle condition for API call

  • Add test case for insufficient identifiers (only clientUserId)

  • Add test case for sufficient identifiers (clientUserId + customIdentifiers)

  • Issue:
    Basically we need clientUserId or customIdentifiers with atleast one other identifier.

{
    "timestamp": "2025-07-22T04:41:12.731+00:00",
    "status": 400,
    "error": "Bad Request",
    "message": "clientUserId or customIdentifiers must be set",
    "path": "/identity-resolution/user-identifiers"
}
{
    "timestamp": "2025-07-22T04:40:32.496+00:00",
    "status": 400,
    "error": "Bad Request",
    "message": "at least one other field must be set",
    "path": "/identity-resolution/user-identifiers"
}

What is the related Linear task?

Resolves INT-3829

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

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

N/A

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?

N/A

@coderabbitai review


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

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.

@manish339k
manish339k requested review from a team and sivashanmukh as code owners July 22, 2025 04:37
@manish339k
manish339k requested review from a team, sandeepdsvs and vinayteki95 and removed request for a team July 22, 2025 04:37
@coderabbitai

coderabbitai Bot commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved the logic for identity resolution to more accurately determine when sufficient identifiers are present for a response. This enhances reliability when matching user identities.

Walkthrough

The internal logic for determining identity sufficiency within the responseBuilderForIdentityResolution function in src/v0/destinations/attentive_tag/transform.js was refined. The new approach introduces intermediate boolean variables to flexibly check combinations of identifiers, adjusting the conditions under which an identity resolution response is built and returned.

Changes

File(s) Change Summary
src/v0/destinations/attentive_tag/transform.js Refined internal logic for identity sufficiency checks in responseBuilderForIdentityResolution; introduced intermediate variables for clarity and flexibility.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Transformer (responseBuilderForIdentityResolution)
    Caller->>Transformer: Call with identifiers (email, phone, shopifyId, klaviyoId, clientUserId, customIdentifiers)
    Transformer->>Transformer: Evaluate hasOtherIdentifiers
    Transformer->>Transformer: Evaluate hasSufficientIdentity
    alt hasSufficientIdentity is true
        Transformer->>Caller: Return identity resolution response
    else
        Transformer->>Caller: Return null
    end
Loading

Estimated code review effort

2 (~15 minutes)

Possibly related PRs

Suggested reviewers

  • sivashanmukh

Suggestion: To further improve clarity, consider adding inline comments explaining the rationale behind each intermediate boolean condition. This will help future maintainers quickly grasp the nuanced identity checks without needing to reverse-engineer the logic.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f04805 and ca01824.

📒 Files selected for processing (1)
  • src/v0/destinations/attentive_tag/transform.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/v0/destinations/attentive_tag/transform.js
⏰ 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). (9)
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Jul 22, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.44%. Comparing base (b1f3584) to head (ca01824).
Report is 26 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4513      +/-   ##
===========================================
+ Coverage    91.24%   91.44%   +0.20%     
===========================================
  Files          641      639       -2     
  Lines        33761    33775      +14     
  Branches      7956     7987      +31     
===========================================
+ Hits         30804    30887      +83     
+ Misses        2722     2626      -96     
- Partials       235      262      +27     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maheshkutty

Copy link
Copy Markdown
Contributor

Add linear ticket

maheshkutty
maheshkutty previously approved these changes Jul 22, 2025
krishna2020
krishna2020 previously approved these changes Jul 22, 2025
ItsSudip
ItsSudip previously approved these changes Jul 22, 2025
@manish339k
manish339k changed the base branch from release/v1.105.0 to develop July 22, 2025 06:38
@manish339k
manish339k dismissed stale reviews from ItsSudip, krishna2020, and maheshkutty July 22, 2025 06:38

The base branch was changed.

maheshkutty
maheshkutty previously approved these changes Jul 22, 2025
@manish339k
manish339k force-pushed the fix.attentive.identity branch from aa36619 to 7f04805 Compare July 22, 2025 08:15
ItsSudip
ItsSudip previously approved these changes Jul 22, 2025
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@manish339k
manish339k dismissed stale reviews from ItsSudip and maheshkutty via c48da0c July 22, 2025 08:21
maheshkutty
maheshkutty previously approved these changes Jul 22, 2025
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

ItsSudip
ItsSudip previously approved these changes Jul 22, 2025
@manish339k
manish339k dismissed stale reviews from ItsSudip and maheshkutty via ca01824 July 22, 2025 08:41
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

Copy link
Copy Markdown

@manish339k
manish339k merged commit b105b72 into develop Jul 22, 2025
@manish339k
manish339k deleted the fix.attentive.identity branch July 22, 2025 09:23
@coderabbitai coderabbitai Bot mentioned this pull request Nov 4, 2025
10 tasks
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.

7 participants