Skip to content
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

analytics.identify sends traits through context when userId is null (version 1.53.0) #909

Closed
seg-leonelsanches opened this issue Jul 25, 2023 · 2 comments · Fixed by #950
Labels
bug Something isn't working

Comments

@seg-leonelsanches
Copy link

On version 1.53.0, I tested with a client the following call:

analytics.identify(null, {
   prop1: 1,
   prop2: "2"
});

The properties will go to context payload in Segment, instead of traits.

The problem doesn't happen in version 1.52.0. I advised the client to downgrade the library.

@silesky
Copy link
Contributor

silesky commented Aug 2, 2023

@seg-leonelsanches thank you for your report.
I see that you get both context and traits.

image

I can reproduce this odd behavior when passing null as the first argument to identify. This differs from the classic behavior, so I can safely label this as a bug.

I do not see any difference in the behavior between 1.53.x and 1.52.x -- (I tested with an versions that > 1 year old and it had the same bug), so it's strange to me that you're saying that the problem doesn't happen in 1.52.0

As a "workaround", instead of using null, you can use undefined:
e.g.

analytics.identify(undefined, {
   prop1: 1,
   prop2: "2"
});

@silesky silesky added the bug Something isn't working label Aug 2, 2023
@seg-leonelsanches
Copy link
Author

Hi @silesky. We got to reproduce also in 1.52.0. The customer is not using userId, but another column called CPF (it's like the SSN for Brazil):

image

@oscb oscb linked a pull request Sep 14, 2023 that will close this issue
1 task
@oscb oscb closed this as completed in #950 Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants