Sentry.Maui sends the user's device name with no PII gate

Open
#5,956 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start by reading MauiDeviceData.ApplyMauiDeviceData and its caller, SentryMauiEventProcessor, then review how SendDefaultPii is applied to device data and the related discussion in #5932. Decide how device names should interact with DataCollection; done means device names are gated consistently with the agreed option and covered by tests for the relevant settings.

Written by the indexing model from the issue text.

Description

Framework: MAUI State: Needs Discussion

Sentry.Maui sends the name of the user's device on every event, with no option gating it. MauiDeviceData.ApplyMauiDeviceData (called from SentryMauiEventProcessor) sets:

device.Name ??= deviceInfo.Name;

SendDefaultPii doesn't gate it, and no DataCollection option does either. It has been this way since #1713 (2022).

On the platforms MAUI targets, DeviceInfo.Name is often the user's own name for their device:

Platform MAUI's DeviceInfo.Name Typical value
Android Settings.Global device_name (API 25+), falling back to Model The name the user gave the phone, e.g. "Jane's Pixel"
iOS UIDevice.CurrentDevice.Name Generic ("iPhone") on iOS 16+ unless the app has Apple's user-assigned device name entitlement; the user's name for it before that
Windows EasClientDeviceInformation.FriendlyName The computer name
macOS SCDynamicStoreCopyComputerName The computer name, e.g. "Jane's MacBook Pro"
Other SDKs
  • sentry-cocoa doesn't send a device name. The device context has model and model_id only.
  • sentry-java (Android) doesn't set a device name.
  • sentry-dart sets device.name from the hostname, and only when sendDefaultPii is on.

So MAUI is the only mobile SDK we found that sends it unconditionally.

Data collection

The data collection spec puts "Device and environment context (OS, runtime, non-PII identifiers)" in technical context, which no dataCollection option gates, and puts "Identity (name, …)" under PII. A user-chosen device name is closer to the second. No dataCollection option covers it, the same gap as the hostname sent as server_name, discussed in #5932.

To decide
  • Gate it on SendDefaultPii now, as Dart does. This changes what existing MAUI apps send by default.
  • What gates it once DataCollection is configured. If .NET adds a top-level AttachServerName that defaults to false on Android and iOS (the shape #5932 discusses for the hostname), device name could follow the same switch or get its own.

Part of #5420.

Dominant language
C#
Stars
775
Forks
262
Avg merge
1d 16h
Merged PRs (30d)
118

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-dotnet

All issues in getsentry/sentry-dotnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.