-
Notifications
You must be signed in to change notification settings - Fork 110
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
fix: posthog swapped alias ids #3507
fix: posthog swapped alias ids #3507
Conversation
Thank you for your contribution @mjeffrey18 |
This PR is considered to be stale. It has been open for 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR. |
@mjeffrey18 can you sign the above CLA form ? |
Hi @mjeffrey18 , I see you didn't get a chance to sign the CLA. It shouldn't take more than a min, it is a quick online form that requires your confirmation. This is required before merging the code. This ensures your contributed code can be used according to the project's license. |
This PR is considered to be stale. It has been open for 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR. |
@mjeffrey18 can you please sign the CLA so that we can go ahead |
Hi @mjeffrey18, sorry about that error. Don't worry about it. @shrouti1507 you may go ahead with the review. |
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.
@mjeffrey18 can you edit the test cases as well? In files test/integrations/destinations/posthog/processor/data.ts and test/integrations/destinations/posthog/router/data.ts file. To confirm if the test cases are passing you can run npm run test:ts -- component --destination=posthog
757ac26
into
rudderlabs:posthog-mapping
* fix: posthog swapped alias ids (#3507) [Posthog] fix swapped alias ids Co-authored-by: shrouti1507 <[email protected]> * fix: test case update for posthog --------- Co-authored-by: Marc Jeffrey <[email protected]>
@mjeffrey18 this PR's changes has been released to production now |
What are the changes introduced in this PR?
This PR fixes an issue with how the alias call is mapped when sending events from Rudderstack to PostHog. It ensures the distinct_id and alias are correctly populated in the $create_alias event sent to PostHog.
Whenever I call this on the client
The resulting $create_alias event sent to PostHog has the distinct_id and alias swapped:
According to the PostHog docs, the distinct_id should be the ID we want to keep as the primary user identifier, and alias should be the secondary ID we want to merge into the primary.
Solution
Update the transformer logic for the PostHog destination to correctly map:
After this change, the $create_alias event sent to PostHog for the example above should look like:
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.