Skip to content

chore(logging): move device_id into Segment identity traits #2450

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gagik
Copy link
Contributor

@gagik gagik commented May 7, 2025

Our track function was misleadingly typed with regards to Segment SDK.

For device_id to actually be used by Segment we'd need it to be in traits.device_id in the identify function.

This ties our types closer to the Segment SDK and moves the device ID to traits instead.

this.currentUserId = message.userId ?? message.anonymousId;

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.currentUserId = message.userId ?? message.anonymousId!;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately because of the more derivative type I think TypeScript can no longer correctly resolve this scenario

@gagik gagik added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant