Skip to content

fix: include distinct_id on $create_alias properties - #837

Closed
o-mid wants to merge 1 commit into
PostHog:mainfrom
o-mid:fix/alias-distinct-id-property
Closed

o-mid wants to merge 1 commit into
PostHog:mainfrom
o-mid:fix/alias-distinct-id-property

Conversation

@o-mid

@o-mid o-mid commented Oct 4, 2026

Copy link
Copy Markdown

💡 Motivation and Context

$create_alias already sets distinct_id on the event envelope. Some pipelines only read properties, so they miss the pre-alias identity. This mirrors what other PostHog SDKs emit and covers aliasStateless as well.

Note: #819 proposes the same change for the main alias() path; this branch also updates the stateless API and adds a regression test there.

💚 How did you test it?

  • :posthog:test — PostHogTest.captures an alias event, PostHogStatelessTest.aliasStateless creates alias event (local Gradle blocked on missing AGP 8.9.1 in this environment; CI expected to run full suite).

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

Made with Cursor

Mirror the event-level distinct_id in properties so tooling that only reads the payload can resolve both sides of an alias link, including the stateless API.
@o-mid
o-mid requested a review from a team as a code owner October 4, 2026 09:03
@o-mid

o-mid commented Oct 4, 2026

Copy link
Copy Markdown
Author

Closing in favor of #819, which already covers the PostHog.alias() path and the same PostHogTest assertion against the sdk-spec alias contract.

The only delta here was aliasStateless + PostHogStatelessTest — left on #819 as a follow-up comment so we do not maintain two changesets for the same fix.

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.

1 participant