-
-
Notifications
You must be signed in to change notification settings - Fork 461
Closed
Description
Problem Statement
I'm using a custom-built User with additional properties.
Sentry.setUser(
User().apply {
this.email = email
this.id = membership.user_id
this.others = mapOf(
"account" to membership.account_name,
"accountId" to membership.account_id,
"domain" to membership.account_domain,
"role" to membership.account_name
)
}
)
However, in Sentry UI, it's shown like:
email : ....
id : .....
other = {
account: Corp,
accountId: bf06170b-1934-41c4-9676-8c310117afe0,
domain: corp-trial,
role: Corp
}
However, when I use JS SDK to set custom objects, it puts them to the high level User object as follows:
email : ....
id : .....
account: Corp,
accountId: bf06170b-1934-41c4-9676-8c310117afe0,
domain: corp-trial,
role: Corp
Do you think it's worth a change? The User class is also final, and I cannot override it, unfortunately.
Solution Brainstorm
Instead of the following code in io.sentry.protocol.User, we can iterate the key values of other and put them to the root user object instead.
if (other != null) {
writer.name(JsonKeys.OTHER).value(logger, other);
}
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Done