Skip to content

Commit 33908dd

Browse files
committed
Merge branch 'main' into feat/replay
2 parents 1526023 + e0ba81f commit 33908dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+286
-330
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
## Unreleased
44

5+
### Improvements
6+
7+
- Add permissions for `INTERNET` and `ACCESS_NETWORK_STATE` in the AndroidManifest.xml of the Flutter example app. ([#2255](https://github.com/getsentry/sentry-dart/pull/2255))
8+
9+
### Dependencies
10+
11+
- Bump Cocoa SDK from v8.35.1 to v8.36.0 ([#2252](https://github.com/getsentry/sentry-dart/pull/2252))
12+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8360)
13+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.35.1...8.36.0)
14+
15+
## 8.8.0
16+
517
### Features
618

719
- Session replay Alpha for Android and iOS ([#2208](https://github.com/getsentry/sentry-dart/pull/2208)).
@@ -19,6 +31,8 @@
1931
);
2032
```
2133

34+
- Add `SentryFlutter.nativeCrash()` using MethodChannels for Android and iOS ([#2239](https://github.com/getsentry/sentry-dart/pull/2239))
35+
- This can be used to test if native crash reporting works
2236
- Add `ignoreRoutes` parameter to `SentryNavigatorObserver`. ([#2218](https://github.com/getsentry/sentry-dart/pull/2218))
2337
- This will ignore the Routes and prevent the Route from being pushed to the Sentry server.
2438
- Ignored routes will also create no TTID and TTFD spans.
@@ -33,6 +47,9 @@
3347

3448
### Dependencies
3549

50+
- Bump Cocoa SDK from v8.33.0 to v8.35.1 ([#2247](https://github.com/getsentry/sentry-dart/pull/2247))
51+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8351)
52+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.33.0...8.35.1)
3653
- Bump Android SDK from v7.13.0 to v7.14.0 ([#2228](https://github.com/getsentry/sentry-dart/pull/2228))
3754
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7140)
3855
- [diff](https://github.com/getsentry/sentry-java/compare/7.13.0...7.14.0)

dart/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
library version;
1010

1111
/// The SDK version reported to Sentry.io in the submitted events.
12-
const String sdkVersion = '8.8.0-alpha.1';
12+
const String sdkVersion = '8.8.0';
1313

1414
String sdkName(bool isWeb) => isWeb ? _browserSdkName : _ioSdkName;
1515

dart/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sentry
2-
version: 8.8.0-alpha.1
2+
version: 8.8.0
33
description: >
44
A crash reporting library for Dart that sends crash reports to Sentry.io.
55
This library supports Dart VM and Web. For Flutter consider sentry_flutter instead.

dio/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// The SDK version reported to Sentry.io in the submitted events.
2-
const String sdkVersion = '8.8.0-alpha.1';
2+
const String sdkVersion = '8.8.0';
33

44
/// The package name reported to Sentry.io in the submitted events.
55
const String packageName = 'pub:sentry_dio';

dio/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sentry_dio
22
description: An integration which adds support for performance tracing for the Dio package.
3-
version: 8.8.0-alpha.1
3+
version: 8.8.0
44
homepage: https://docs.sentry.io/platforms/dart/
55
repository: https://github.com/getsentry/sentry-dart
66
issue_tracker: https://github.com/getsentry/sentry-dart/issues
@@ -19,7 +19,7 @@ platforms:
1919

2020
dependencies:
2121
dio: ^5.0.0
22-
sentry: 8.8.0-alpha.1
22+
sentry: 8.8.0
2323

2424
dev_dependencies:
2525
meta: ^1.3.0

drift/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// The SDK version reported to Sentry.io in the submitted events.
2-
const String sdkVersion = '8.8.0-alpha.1';
2+
const String sdkVersion = '8.8.0';
33

44
/// The package name reported to Sentry.io in the submitted events.
55
const String packageName = 'pub:sentry_drift';

drift/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sentry_drift
22
description: An integration which adds support for performance tracing for the drift package.
3-
version: 8.8.0-alpha.1
3+
version: 8.8.0
44
homepage: https://docs.sentry.io/platforms/flutter/
55
repository: https://github.com/getsentry/sentry-dart
66
issue_tracker: https://github.com/getsentry/sentry-dart/issues
@@ -17,7 +17,7 @@ platforms:
1717
web:
1818

1919
dependencies:
20-
sentry: 8.8.0-alpha.1
20+
sentry: 8.8.0
2121
meta: ^1.3.0
2222
drift: ^2.13.0
2323

@@ -32,4 +32,4 @@ dev_dependencies:
3232
yaml: ^3.1.0 # needed for version match (code and pubspec)
3333
sqlite3_flutter_libs: ^0.5.0
3434
sqlite3: ^2.1.0
35-
archive: ^3.1.2
35+
archive: ^3.1.2

file/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// The SDK version reported to Sentry.io in the submitted events.
2-
const String sdkVersion = '8.8.0-alpha.1';
2+
const String sdkVersion = '8.8.0';
33

44
/// The package name reported to Sentry.io in the submitted events.
55
const String packageName = 'pub:sentry_file';

file/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sentry_file
22
description: An integration which adds support for performance tracing for dart.io.File.
3-
version: 8.8.0-alpha.1
3+
version: 8.8.0
44
homepage: https://docs.sentry.io/platforms/dart/
55
repository: https://github.com/getsentry/sentry-dart
66
issue_tracker: https://github.com/getsentry/sentry-dart/issues
@@ -17,7 +17,7 @@ platforms:
1717
windows:
1818

1919
dependencies:
20-
sentry: 8.8.0-alpha.1
20+
sentry: 8.8.0
2121
meta: ^1.3.0
2222

2323
dev_dependencies:

flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package io.sentry.flutter
33
import android.app.Activity
44
import android.content.Context
55
import android.os.Build
6+
import android.os.Looper
67
import android.util.Log
78
import io.flutter.embedding.engine.plugins.FlutterPlugin
89
import io.flutter.embedding.engine.plugins.activity.ActivityAware
@@ -53,8 +54,8 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
5354

5455
sentryFlutter =
5556
SentryFlutter(
56-
androidSdk = androidSdk,
57-
nativeSdk = nativeSdk,
57+
androidSdk = ANDROID_SDK,
58+
nativeSdk = NATIVE_SDK,
5859
)
5960
}
6061

@@ -82,6 +83,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
8283
"removeTag" -> removeTag(call.argument("key"), result)
8384
"loadContexts" -> loadContexts(result)
8485
"displayRefreshRate" -> displayRefreshRate(result)
86+
"nativeCrash" -> crash()
8587
"addReplayScreenshot" -> addReplayScreenshot(call.argument("path"), call.argument("timestamp"), result)
8688
"captureReplay" -> captureReplay(call.argument("isCrash"), result)
8789
else -> result.notImplemented()
@@ -485,16 +487,17 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
485487
}
486488

487489
companion object {
488-
private const val flutterSdk = "sentry.dart.flutter"
489-
private const val androidSdk = "sentry.java.android.flutter"
490-
private const val nativeSdk = "sentry.native.android.flutter"
490+
private const val FLUTTER_SDK = "sentry.dart.flutter"
491+
private const val ANDROID_SDK = "sentry.java.android.flutter"
492+
private const val NATIVE_SDK = "sentry.native.android.flutter"
493+
private const val NATIVE_CRASH_WAIT_TIME = 500L
491494

492495
private fun setEventOriginTag(event: SentryEvent) {
493496
event.sdk?.let {
494497
when (it.name) {
495-
flutterSdk -> setEventEnvironmentTag(event, "flutter", "dart")
496-
androidSdk -> setEventEnvironmentTag(event, environment = "java")
497-
nativeSdk -> setEventEnvironmentTag(event, environment = "native")
498+
FLUTTER_SDK -> setEventEnvironmentTag(event, "flutter", "dart")
499+
ANDROID_SDK -> setEventEnvironmentTag(event, environment = "java")
500+
NATIVE_SDK -> setEventEnvironmentTag(event, environment = "native")
498501
else -> return
499502
}
500503
}
@@ -514,7 +517,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
514517
sdk: SdkVersion?,
515518
) {
516519
event.sdk?.let {
517-
if (it.name == flutterSdk) {
520+
if (it.name == FLUTTER_SDK) {
518521
sdk?.packageSet?.forEach { sentryPackage ->
519522
it.addPackage(sentryPackage.name, sentryPackage.version)
520523
}
@@ -524,6 +527,13 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
524527
}
525528
}
526529
}
530+
531+
private fun crash() {
532+
val exception = RuntimeException("FlutterSentry Native Integration: Sample RuntimeException")
533+
val mainThread = Looper.getMainLooper().thread
534+
mainThread.uncaughtExceptionHandler.uncaughtException(mainThread, exception)
535+
mainThread.join(NATIVE_CRASH_WAIT_TIME)
536+
}
527537
}
528538

529539
private fun loadContexts(result: Result) {

0 commit comments

Comments
 (0)