braze-inc / braze-web-sdk

Public repo for the Braze Web SDK
https://www.braze.com
Other
70 stars 25 forks source link

[Bug]: Difference in request payload for setCustomUserAttribute dependent upon value type #146

Closed sparsons-gh closed 8 months ago

sparsons-gh commented 8 months ago

Braze Web SDK Version

4.7.2

Integration Method

CDN

Browser

Chrome

Steps To Reproduce

Invoke the setCustomUserAttribute with a string or an array of strings.

Example 1 (array of strings): .getUser().setCustomUserAttribute('some-attribute', ['first-value', 'second-value']);

Example 2 (string: .getUser().setCustomUserAttribute('some-attribute', 'first-value, second-value');

Expected Behavior

We expect the behavior to be similar between the type data types, string and string[] - we expect that the data should be in either events or attributes for both types, preferably the attributes array.

Actual Incorrect Behavior

As explained above, when a string[] is used as the value to setCustomUserAttribute, the data is included in the events array, and conversely, when a string is used as a the value, the data winds up in the attributes array.

Verbose Logs

No response

Additional Information

No response

wesleyorbin commented 8 months ago

Hi @sparsons-gh. This is intended behavior and expected by our backend. I'm going to close out this issue, but feel free to re-open or open a new issue if you notice any problems with the data flowing to the backend correctly.