Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Sentry/Platforms/Android/BindableNativeSentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class NativeOptions
public bool? PrintUncaughtStackTrace { get; set; }
public double? ProfilesSampleRate { get; set; }
public TimeSpan? ReadTimeout { get; set; }
public bool? TombstoneEnabled { get; set; }
public bool? ReportHistoricalTombstones { get; set; }
public bool? EnableTracing { get; set; }
public bool? EnableBeforeSend { get; set; }

Expand Down Expand Up @@ -77,6 +79,8 @@ public void ApplyTo(SentryOptions.NativeOptions options)
options.PrintUncaughtStackTrace = PrintUncaughtStackTrace ?? options.PrintUncaughtStackTrace;
options.ProfilesSampleRate = ProfilesSampleRate ?? options.ProfilesSampleRate;
options.ReadTimeout = ReadTimeout ?? options.ReadTimeout;
options.TombstoneEnabled = TombstoneEnabled ?? options.TombstoneEnabled;
options.ReportHistoricalTombstones = ReportHistoricalTombstones ?? options.ReportHistoricalTombstones;
options.EnableTracing = EnableTracing ?? options.EnableTracing;
options.EnableBeforeSend = EnableBeforeSend ?? options.EnableBeforeSend;

Expand Down
12 changes: 12 additions & 0 deletions src/Sentry/Platforms/Android/NativeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,18 @@ internal NativeOptions(SentryOptions options)
/// </summary>
public TimeSpan ReadTimeout { get; set; } = TimeSpan.FromSeconds(5);

/// <summary>
/// Gets or sets a value that indicates if native crash reporting via tombstones is enabled.
/// The default value is <c>true</c> (enabled).
/// </summary>
public bool TombstoneEnabled { get; set; } = true;
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated

/// <summary>
/// Gets or sets a value that indicates if historical tombstones should be reported.
/// The default value is <c>true</c> (enabled).
/// </summary>
public bool ReportHistoricalTombstones { get; set; } = true;
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated

// ---------- Other ----------

internal List<string>? InAppExcludes { get; private set; }
Expand Down
2 changes: 2 additions & 0 deletions src/Sentry/Platforms/Android/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@
o.ProfilesSampleRate = (JavaDouble?)options.Native.ProfilesSampleRate;
o.PrintUncaughtStackTrace = options.Native.PrintUncaughtStackTrace;
o.ReadTimeoutMillis = (int)options.Native.ReadTimeout.TotalMilliseconds;
o.TombstoneEnabled = options.Native.TombstoneEnabled;
o.ReportHistoricalAnrs = options.Native.ReportHistoricalTombstones;

Check failure on line 160 in src/Sentry/Platforms/Android/SentrySdk.cs

View check run for this annotation

@sentry/warden / warden: code-review

ReportHistoricalTombstones is mapped to the unrelated Java ReportHistoricalAnrs option

The new .NET option `ReportHistoricalTombstones` is mapped to the Java SDK property `ReportHistoricalAnrs`. Historical ANRs and historical tombstones are distinct concepts in the Android SDK (ANRs are past Application-Not-Responding events; tombstones are native crash records from `ApplicationExitInfo`). Users who set `ReportHistoricalTombstones=false` to suppress historical tombstone reporting will instead toggle historical ANR reporting, and historical tombstone behavior will remain at the Java SDK default. This is a silent behavioral mismatch with confusing semantics that will be hard to discover.

Check failure on line 160 in src/Sentry/Platforms/Android/SentrySdk.cs

View check run for this annotation

@sentry/warden / warden: find-bugs

ReportHistoricalTombstones is incorrectly mapped to ReportHistoricalAnrs

The new managed option `options.Native.ReportHistoricalTombstones` is assigned to the Java SDK's `o.ReportHistoricalAnrs` field. ANRs (Application Not Responding) and tombstones are distinct Android crash-reporting concepts in the Sentry Java SDK. As a result, toggling `ReportHistoricalTombstones` will silently change historical ANR reporting behavior instead of (or in addition to) historical tombstone behavior, and any actual historical-tombstone Java option remains unconfigured. This also conflicts with the documentation on `NativeOptions.ReportHistoricalTombstones` which states it controls historical tombstones.
Comment thread
sentry-warden[bot] marked this conversation as resolved.
Outdated

// In-App Excludes and Includes to be passed to the Android SDK
options.Native.InAppExcludes?.ForEach(o.AddInAppExclude);
Expand Down
Loading