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

setUserInfo should not overwrite previous usage #254

Closed
brunovsiqueira opened this issue Oct 18, 2022 · 3 comments · Fixed by #263
Closed

setUserInfo should not overwrite previous usage #254

brunovsiqueira opened this issue Oct 18, 2022 · 3 comments · Fixed by #263
Labels
bug Something isn't working enhancement New feature or request

Comments

@brunovsiqueira
Copy link

brunovsiqueira commented Oct 18, 2022

Hi there. I'd like to discuss if this is the expected behavior.

Describe what happened
When you use "setUserInfo" method in order to set User RUM information more than once, only what you have set in the latest usage appear in RUM logs. It seems to clear all user information you have set even if you are setting only additional info.

Steps to reproduce the issue:
Call "setUserInfo" with only id, name and email.
Afterward, call "setUserinfo" with only "extraInfo" map.
In RUM log, you only see the extraInfo propertities you have set.

Describe what you expected:
In my opinion, it should compose userInfo instead of overwriting it. In RUM logs, I should see all the basic user info (id, name and email) added by the extraInfo I have set separeteley.

Additional context

  • Datadog SDK version: 1.0.1
@brunovsiqueira brunovsiqueira added the bug Something isn't working label Oct 18, 2022
@fuzzybinary fuzzybinary added the enhancement New feature or request label Oct 18, 2022
@fuzzybinary
Copy link
Member

Hi @brunovsiqueira,

This is expected behavior as setUserInfo is considered an overwrite of all properties of the user. You can work around this by calling setUserInfo with the already set id, name and email when you add the extraInfo.

That said, I agree we should have a separate method to add or change additional properties for the current user without modifying the user info already provided. I'll look into adding it.

@brunovsiqueira
Copy link
Author

Hi @fuzzybinary. Thanks for your attention.

Ok, it's clear now and makes sense. I have implemented what you suggested and it works properly.

I agree with you that would be helpful having a separate method to add or change extra properties. If you want, you can close this issue or mark it with feature request.

fuzzybinary added a commit that referenced this issue Oct 27, 2022
This allows users to set additionally attributes on a user without having to reset their name, id or email.

Fixes #254
fuzzybinary added a commit that referenced this issue Oct 31, 2022
This allows users to set additionally attributes on a user without having to reset their name, id or email.

Fixes #254
@fuzzybinary
Copy link
Member

addUserExtraInfo should how be available in 1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants