-
-
Notifications
You must be signed in to change notification settings - Fork 222
(MAUI) user.id is always set and can't remove it with SendDefaultPii or null #4172
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
Comments
@lucas-zimerman that was done intentionally in this PR: From what I can tell, we do want to have some default value for the @bruno-garcia if sentry-dotnet/src/Sentry/Internal/Enricher.cs Lines 86 to 95 in ee62bb9
|
Out of curiosity, why not set |
Hi @lucas-zimerman , So I checked with Bruno. We intentionally set User.Id to a non-null value so that Session health metrics work on Mobile platforms. The installationId is just a GUID that we generate, so nothing super sensitive (it just let's us distinguish sessions from different users). We could, as you suggest, do this when initialising the global/root scope for the app though (rather than in an enricher) so that you could overwrite this if you didn't care about session health metrics and you were worried about sending this. |
On the app that I was looking, they are using manual session metrics, because they only want to monitor users after they login and when they logout, to stop the session manually, since it's an app for business, more than one person could be using the same app on the same session. having the user.id set on the global scope would make it easier to clear it once and make it easier to actually know how many users are using the app, without counting the install ID |
Note that we can use In fact, BeforeSend should be the last thing that touches the event before we send it, to allow the user to have a full picture of what's being sent. And allow the user to make the mutations they want |
sentry.native.android.dotnet sentry.java.android.dotnet for .NET BeforeSend I just added a check to see if user.id has hopefully I won't need this filter on discover to count users lol
Workaroundapply the following rule to Sentry.io |
Uh oh!
There was an error while loading. Please reload this page.
Package
Sentry
.NET Flavor
.NET
.NET Version
9.0.4
OS
Android
OS Version
No response
Development Environment
Visual Studio v17.x
SDK Version
5.6.0
Self-Hosted Sentry Version
24.8.0
Workload Versions
A break change that I noticed from the Xamarin SDK to MAUI is that User.id is always set.
SendDefaultPii
does nothing when set to false, it keeps sending this identifier, and there doesn't seems to be an easy way remove.Even with
it still sends an event with an user.id
UseSentry or SentrySdk.Init call
Steps to Reproduce
And one of the following options:
One of the above options should unset the user.id from any event.
Expected Result
user.id not set with installationID
Actual Result
events with user.id not set by the developer
The text was updated successfully, but these errors were encountered: