Skip to content

Allow set_user to update current user instead of replacing it #706

@thomaseizinger

Description

@thomaseizinger

In our application, not all user-identifying pieces of information are known at the same time. We would like to use set_user to add as much information as we can to the user context.

At present, sentry only allows the whole user to be set at once, meaning we have to track that information separately and update the user context every time we learn new information.

The simplest way to solve this would be if we could expose a user getter. That would allow the application to see, what the current user is and update it with the existing fields and add new ones to it. Alternatively, a user_mut could be exposed as well. If that would return &mut Option<User> then one could use the get_or_insert family of APIs to set / update the current user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions