Closed happypoulp closed 1 month ago
Thanks for opening this issue! We'll get back to you shortly. If it is a bug, please make sure to add steps to reproduce the issue.
Oh thanks, I did not understood it this way while reading the doc.
I am surprised about the behavior regarding arrays updating because it produces unexpected results where we could have duplicated entries in the array because of this merge behavior.
I guess it should then be safer to always call reset
before calling identify
?
Also maybe that is could be worth emphasizing about what "append or modify" means in the documentation because it may not be obvious that it means that you cannot remove any information once it's in the traits (especially tricky when dealing with arrays).
Hello @happypoulp, thanks for your feedback.
We've planned to improve the above doc page. So, it'll reflect very soon.
Describe the bug When calling the
identify
method with:I expect to see the same traits object being transmitted in the payload of the
identify
network call made to Rudderstack.However, the traits sent in the HTTP payload do not match the one I passed to
identify
method. Instead, it seems like the traits I pass to theidentify
method are being merged or added to the existing traits.To Reproduce Steps to reproduce the behavior:
rudderanalytics.identify("e36b8bc6-0c1e-44fd-907c-f63e94315b30", {foo: 1})
identify
HTTP call and see that the traits contains more than{foo: 1}
(if you already have existing traits)rudderanalytics.identify("e36b8bc6-0c1e-44fd-907c-f63e94315b30", {bar: 1})
identify
HTTP call and see that the traits still containsfoo
even though we only passedbar
rudderanalytics.identify("e36b8bc6-0c1e-44fd-907c-f63e94315b30", {baz:[1,2]})
identify
HTTP call and see that the traits containsbaz: [1,2]
(and alsofoo
andbar
)rudderanalytics.identify("e36b8bc6-0c1e-44fd-907c-f63e94315b30", {baz:[2]})
identify
HTTP call and see that the traits containsbaz: [2,2]
instead of{baz:[2]}
Expected behavior I expect the traits object passed to
identify
method to be the one sent in the payload of theidentify
HTTP request made to Rudderstack.Screenshots
Additional Information (please complete the following information):
Desktop (please complete the following information):
Additional context Add any other context about the problem here.