Skip to content

Commit

Permalink
Add missing props (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Mar 27, 2023
1 parent 89ea268 commit e2d89fc
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#832)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.3.1...8.3.2)

## Fixes

- Sync missing properties to the Native SDKs ([#1354](https://github.com/getsentry/sentry-dart/pull/1354))

## 7.2.0

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {

args.getIfNotNull<Boolean>("sendClientReports") { options.isSendClientReports = it }

args.getIfNotNull<Long>("maxAttachmentSize") { options.maxAttachmentSize = it }

val name = "sentry.java.android.flutter"

var sdkVersion = options.sdkVersion
Expand Down
26 changes: 16 additions & 10 deletions flutter/ios/Classes/SentryFlutterPluginApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,18 +313,12 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
options.dist = dist
}

if let enableAutoNativeBreadcrumbs = arguments["enableAutoNativeBreadcrumbs"] as? Bool,
enableAutoNativeBreadcrumbs == false {
options.integrations = options.integrations?.filter { (name) -> Bool in
name != "SentryAutoBreadcrumbTrackingIntegration"
}
if let enableAutoNativeBreadcrumbs = arguments["enableAutoNativeBreadcrumbs"] as? Bool {
options.enableAutoBreadcrumbTracking = false
}

if let enableNativeCrashHandling = arguments["enableNativeCrashHandling"] as? Bool,
enableNativeCrashHandling == false {
options.integrations = options.integrations?.filter { (name) -> Bool in
name != "SentryCrashIntegration"
}
if let enableNativeCrashHandling = arguments["enableNativeCrashHandling"] as? Bool {
options.enableCrashHandler = false
}

if let maxBreadcrumbs = arguments["maxBreadcrumbs"] as? UInt {
Expand All @@ -346,6 +340,18 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
if let sendClientReports = arguments["sendClientReports"] as? Bool {
options.sendClientReports = sendClientReports
}

if let maxAttachmentSize = arguments["maxAttachmentSize"] as? UInt {
options.maxAttachmentSize = maxAttachmentSize
}

if let captureFailedRequests = arguments["captureFailedRequests"] as? Bool {
options.enableCaptureFailedRequests = captureFailedRequests
}

if let enableAppHangTracking = arguments["enableAppHangTracking"] as? Bool {
options.enableAppHangTracking = enableAppHangTracking
}
}

private func logLevelFrom(diagnosticLevel: String) -> SentryLevel {
Expand Down
7 changes: 3 additions & 4 deletions flutter/lib/src/integrations/native_sdk_integration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ class NativeSdkIntegration extends Integration<SentryFlutterOptions> {
'enableNdkScopeSync': options.enableNdkScopeSync,
'enableAutoPerformanceTracing': options.enableAutoPerformanceTracing,
'sendClientReports': options.sendClientReports,
'sdk': {
'name': options.sdk.name,
'version': options.sdk.version,
},
'proguardUuid': options.proguardUuid,
'maxAttachmentSize': options.maxAttachmentSize,
'captureFailedRequests': options.captureFailedRequests,
'enableAppHangTracking': options.enableAppHangTracking,
});

options.sdk.addIntegration('nativeSdkIntegration');
Expand Down
5 changes: 5 additions & 0 deletions flutter/lib/src/sentry_flutter_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ class SentryFlutterOptions extends SentryOptions {
@experimental
bool attachViewHierarchy = false;

/// When enabled, the SDK tracks when the application stops responding for a
/// specific amount of time (default 2s).
/// Only available on iOS and macOS.
bool enableAppHangTracking = true;

/// By using this, you are disabling native [Breadcrumb] tracking and instead
/// you are just tracking [Breadcrumb]s which result from events available
/// in the current Flutter environment.
Expand Down
23 changes: 12 additions & 11 deletions flutter/test/integrations/init_native_sdk_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ void main() {
'enableNdkScopeSync': true,
'enableAutoPerformanceTracing': true,
'sendClientReports': true,
'sdk': {
'name': 'sentry.dart.flutter',
'version': sdkVersion,
},
'proguardUuid': null
'proguardUuid': null,
'maxAttachmentSize': 20 * 1024 * 1024,
'captureFailedRequests': true,
'enableAppHangTracking': true,
});
});

Expand Down Expand Up @@ -94,7 +93,10 @@ void main() {
..enableAutoPerformanceTracing = false
..sendClientReports = false
..enableNdkScopeSync = true
..proguardUuid = fakeProguardUuid;
..proguardUuid = fakeProguardUuid
..maxAttachmentSize = 10
..captureFailedRequests = false
..enableAppHangTracking = false;

options.sdk.addIntegration('foo');
options.sdk.addPackage('bar', '1');
Expand Down Expand Up @@ -131,11 +133,10 @@ void main() {
'enableNdkScopeSync': true,
'enableAutoPerformanceTracing': false,
'sendClientReports': false,
'sdk': {
'name': 'sentry.dart.flutter',
'version': sdkVersion,
},
'proguardUuid': fakeProguardUuid
'proguardUuid': fakeProguardUuid,
'maxAttachmentSize': 10,
'captureFailedRequests': false,
'enableAppHangTracking': false,
});
});

Expand Down
1 change: 1 addition & 0 deletions min_version_test/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
Text(
'$_counter',
// ignore: deprecated_member_use
style: Theme.of(context).textTheme.headline4,
),
],
Expand Down

0 comments on commit e2d89fc

Please sign in to comment.