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

Allow us to call setUserInfo without completely wiping all previously set properties set by addUserProperties #2132

Open
StylianosGakis opened this issue Jul 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@StylianosGakis
Copy link

Feature description

My use case is that I have independent sources for where some of my attributes come, and where my ID comes from. Whenever each one of those change, I used to call Datadog.getInstance().addUserProperties().
Now I wanted to start using setUserInfo to set my ID, only to realize that this then simply clears (here) the previously set attributes.

Proposed solution

I would need one of the two options:

  • Provide a way to grab the existing attributes, so that I can grab them, and then call setUserProperties(id, ..., grabbedAttributes) to set the ID and re-set the attributes too
  • Provide a way for me to set the user info without clearing the extra properties as a hidden side-effect

Other relevant information

No response

@StylianosGakis StylianosGakis added the enhancement New feature or request label Jul 23, 2024
@xgouchet
Copy link
Collaborator

Hi @StylianosGakis ,
thanks a lot for opening a feature request, we included that in our internal tracker and we will try and address this in our roadmap.

StylianosGakis added a commit to HedvigInsurance/android that referenced this issue Jul 23, 2024
This works around the issue over at
DataDog/dd-sdk-android#2132 which does not let
one call setUserInfo without having to also clear all previously set
attributes.
With this change, we instead keep a flow for all of our source of truth,
and combine them together so if any single one of them change, we
re-apply all of them together with one `setUserInfo` call.
We do the same for RUM too, all inside DatadogAttributesManager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants