Description
Platform
Flutter Web
Obfuscation
Enabled
Debug Info
Enabled
Doctor
Version
8.12.0
Steps to Reproduce
Use options.beforeSend to override a value like this:
await Sentry.init((options) {
options.beforeSend = (event, hint) {
return event.copyWith(serverName: null); // Don't send server names.
};
});
Expected Result
The value is not sent (or null).
Actual Result
The value is sent and not null.
This is what the documentation says about how to remove information:
await Sentry.init((options) {
options.beforeSend = (event, hint) {
return event.copyWith(serverName: null); // Don't send server names.
};
});
but when you take a look at the code, this cannot work:
final String? serverName;
@override
SentryEvent copyWith({
String? serverName,
}) =>
SentryEvent(
serverName: serverName ?? this.serverName,
Replacing the geo object with an empty geo object does also not work. It seems that the data is overwritten afterwards.
await Sentry.init((options) {
options.beforeSend = (event, hint) {
return event.copyWith(
user: event.user?.copyWith(
geo: SentryGeo(),
),
);
};
});
What I ended up doing was masking the city value like this:
await Sentry.init((options) {
options.beforeSend = (event, hint) {
return event.copyWith(
user: event.user?.copyWith(
geo: SentryGeo(city: '****'),
),
);
};
});
Related to #980
Are you willing to submit a PR?
None
Metadata
Metadata
Assignees
Type
Projects
Status
Done
Status
No status