Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

### Features

- Add `enableTombstone` option for improved native crash reporting on Android 12+ ([#3526](https://github.com/getsentry/sentry-dart/pull/3526))
- When enabled, uses Android's `ApplicationExitInfo.REASON_CRASH_NATIVE` to capture native crashes with more detailed thread information
- Disabled by default

### Fixes

- Dont guard user attributes behind `sendDefaultPii` for logs and metrics ([#3524](https://github.com/getsentry/sentry-dart/pull/3524))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ void main() {
options.anrTimeoutInterval = const Duration(seconds: 2);
options.connectionTimeout = const Duration(milliseconds: 1234);
options.readTimeout = const Duration(milliseconds: 2345);
options.enableTombstone = false;
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
});
});

Expand Down Expand Up @@ -280,12 +281,15 @@ void main() {
expect(findMatchingPackage, isNotNull);
}
expect(androidOptions.isEnableAutoTraceIdGeneration(), isFalse);
expect(androidOptions.isTombstoneEnabled(), isFalse);

final androidProxy = androidOptions.getProxy();
expect(androidProxy, isNotNull);
expect(androidProxy!.getHost()?.toDartString(), 'proxy.local');
expect(androidProxy.getPort()?.toDartString(), '8084');
expect(androidProxy.getUser()?.toDartString(), 'u');
expect(androidProxy.getPass()?.toDartString(), 'p');

final r = androidOptions.getSessionReplay();
expect(r.getQuality(), jni.SentryReplayOptions$SentryReplayQuality.HIGH);
expect(r.getSessionSampleRate(), isNotNull);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ void configureAndroidOptions({
androidOptions
.setAnrTimeoutIntervalMillis(options.anrTimeoutInterval.inMilliseconds);
androidOptions.setAnrEnabled(options.anrEnabled);
androidOptions.setTombstoneEnabled(options.enableTombstone);
Comment thread
buenaflor marked this conversation as resolved.
androidOptions.setAttachThreads(options.attachThreads);
androidOptions.setAttachStacktrace(options.attachStacktrace);

Expand Down
6 changes: 6 additions & 0 deletions packages/flutter/lib/src/sentry_flutter_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ class SentryFlutterOptions extends SentryOptions {
/// Available only for Android. Enabled by default.
bool anrEnabled = true;

/// Enable or disable Tombstone reporting for improved native crash reporting.
/// When enabled, uses Android's `ApplicationExitInfo.REASON_CRASH_NATIVE` to
/// capture native crashes with more detailed thread information.
/// Available only for Android 12+ (API level 30+). Disabled by default.
bool enableTombstone = false;

Duration _anrTimeoutInterval = Duration(milliseconds: 5000);

/// ANR Timeout internal. Default is 5000 milliseconds or 5 seconds.
Expand Down
7 changes: 7 additions & 0 deletions packages/flutter/test/sentry_flutter_options_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,12 @@ void main() {
expect(options.enableMemoryPressureBreadcrumbs, isTrue);
expect(options.enableAutoNativeBreadcrumbs, isFalse);
});

testWidgets('enableTombstone defaults to false',
(WidgetTester tester) async {
final options = defaultTestOptions();

expect(options.enableTombstone, isFalse);
});
});
}
Loading