Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: allow retrieving the current user of a scope #715

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

thomaseizinger
Copy link
Contributor

In our application, not all information of the current user is known immediately upfront. The user ID is loaded directly on startup but the account that they log in to is only known later.

Currently, we have to separately track this information because we always have to set the entire user at once. To avoid this, this PR adds a user getter to get the current user from the scope. This solves our use-case because we can get the current user and produce a new one that has additional fields and set it again.

Resolves: #706.

@thomaseizinger thomaseizinger changed the title feat: allow retrieving the current user feat: allow retrieving the current user of a scope Dec 19, 2024
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 73.25%. Comparing base (605d36d) to head (318ec09).
Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #715      +/-   ##
==========================================
+ Coverage   72.79%   73.25%   +0.45%     
==========================================
  Files          66       66              
  Lines        7804     7926     +122     
==========================================
+ Hits         5681     5806     +125     
+ Misses       2123     2120       -3     

@thomaseizinger
Copy link
Contributor Author

CI failures are addressed in #716.

@Swatinem Swatinem merged commit fd92a32 into getsentry:master Dec 19, 2024
14 of 15 checks passed
github-merge-queue bot pushed a commit to firezone/firezone that referenced this pull request Dec 20, 2024
Previously, we needed to track our own user state in order to set the
whole thing in Sentry. That was necessary because Sentry didn't allow us
to _retrieve_ the current user of the scope but always required the full
user to be set. This was changed
getsentry/sentry-rust#715, which allows us to
remove some of that code and hopefully mitigating any sort of lingering
state when it comes to telemetry sessions.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow set_user to update current user instead of replacing it
2 participants