Skip to content

Commit 7b9e707

Browse files
committed
Merge branch 'main' into fix/platform-dispatcher-onerror
2 parents 8189aaf + 1c6eb5b commit 7b9e707

27 files changed

+366
-29
lines changed

.github/workflows/metrics.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: SDK metrics
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
paths:
8+
- .github/workflows/metrics.yml
9+
- dart/**
10+
- flutter/**
11+
- metrics/**
12+
13+
jobs:
14+
metrics:
15+
name: ${{ matrix.name }}
16+
runs-on: ${{ matrix.host }}
17+
strategy:
18+
# We want that the matrix keeps running, default is to cancel all jobs if a single fails.
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- platform: ios
23+
name: iOS
24+
appPlain: test-app-plain.ipa
25+
host: macos-latest
26+
- platform: android
27+
name: Android
28+
appPlain: metrics/perf-test-app-plain/build/app/outputs/apk/release/app-arm64-v8a-release.apk
29+
host: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
# Let's stick to an explicit version and update manually because a version change may affect results.
35+
# If it would update implicitly it could confuse people to think the change is actually caused by the PR.
36+
# Instead, we use Updater (update-deps.yml) to create PRs for explicit Flutter SDK update.
37+
- name: Read configured Flutter SDK version
38+
id: conf
39+
run: |
40+
version=$(grep "version" metrics/flutter.properties | cut -d'=' -f2 | xargs)
41+
echo "::set-output name=flutter::$version"
42+
43+
- name: Install Flutter v${{ steps.conf.outputs.flutter }}
44+
uses: subosito/flutter-action@1e6ee87cb840500837bcd50a667fb28815d8e310 # pin@v2
45+
with:
46+
flutter-version: ${{ steps.conf.outputs.flutter }}
47+
48+
- uses: actions/setup-java@v3
49+
if: ${{ matrix.platform == 'android' }}
50+
with:
51+
java-version: '11'
52+
distribution: 'adopt'
53+
54+
- run: ./metrics/prepare.sh
55+
56+
- uses: actions/cache@v3
57+
id: app-plain-cache
58+
with:
59+
path: ${{ matrix.appPlain }}
60+
key: ${{ github.workflow }}-${{ github.job }}-appplain-${{ matrix.platform }}-${{ hashFiles('metrics/perf-test-app-plain/pubspec.yaml') }}
61+
62+
- name: Build
63+
run: ./metrics/build.sh ${{ matrix.platform }}
64+
env:
65+
# Necessary to build an iOS .ipa (using fastlane)
66+
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
67+
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
68+
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
69+
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
70+
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
71+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
72+
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
73+
APP_PLAIN: ${{ matrix.appPlain }}
74+
75+
- name: Collect apps metrics
76+
uses: getsentry/action-app-sdk-overhead-metrics@v1
77+
with:
78+
name: ${{ matrix.name }}
79+
config: ./metrics/metrics-${{ matrix.platform }}.yml
80+
sauce-user: ${{ secrets.SAUCE_USERNAME }}
81+
sauce-key: ${{ secrets.SAUCE_ACCESS_KEY }}

.github/workflows/update-deps.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@ jobs:
2525
name: Cocoa SDK
2626
secrets:
2727
api-token: ${{ secrets.CI_DEPLOY_KEY }}
28+
29+
metrics-flutter:
30+
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
31+
with:
32+
path: metrics/flutter.properties
33+
name: Flutter SDK (metrics)
34+
secrets:
35+
api-token: ${{ secrets.CI_DEPLOY_KEY }}

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Changelog
22

3-
## Unreleased
3+
## 6.12.1
4+
5+
### Dependencies
6+
7+
- Bump Android SDK from v6.4.3 to v6.5.0 ([#1062](https://github.com/getsentry/sentry-dart/pull/1062), [#1064](https://github.com/getsentry/sentry-dart/pull/1064))
8+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#650)
9+
- [diff](https://github.com/getsentry/sentry-java/compare/6.4.3...6.5.0)
10+
11+
## 6.12.0
412

513
### Features
614

@@ -10,6 +18,7 @@
1018

1119
- Handle traces sampler exception ([#1040](https://github.com/getsentry/sentry-dart/pull/1040))
1220
- tracePropagationTargets ignores invalid Regex ([#1043](https://github.com/getsentry/sentry-dart/pull/1043))
21+
- SentryDevice cast error ([#1059](https://github.com/getsentry/sentry-dart/pull/1059))
1322

1423
### Features
1524

dart/lib/src/protocol/sentry_device.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ class SentryDevice {
226226
manufacturer: data['manufacturer'],
227227
brand: data['brand'],
228228
screenResolution: data['screen_resolution'],
229-
screenHeightPixels: data['screen_height_pixels'],
230-
screenWidthPixels: data['screen_width_pixels'],
229+
screenHeightPixels: data['screen_height_pixels']?.toInt(),
230+
screenWidthPixels: data['screen_width_pixels']?.toInt(),
231231
screenDensity: data['screen_density'],
232232
screenDpi: data['screen_dpi'],
233233
online: data['online'],

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 = '6.11.2';
12+
const String sdkVersion = '6.12.1';
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: 6.11.2
2+
version: 6.12.1
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.

dart/test/protocol/sentry_device_test.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ void main() {
102102
true,
103103
);
104104
});
105+
106+
test('fromJson double screen_height_pixels and screen_width_pixels', () {
107+
sentryDeviceJson['screen_height_pixels'] = 100.0;
108+
sentryDeviceJson['screen_width_pixels'] = 100.0;
109+
110+
final sentryDevice = SentryDevice.fromJson(sentryDeviceJson);
111+
final json = sentryDevice.toJson();
112+
113+
expect(
114+
MapEquality().equals(sentryDeviceJson, json),
115+
true,
116+
);
117+
});
105118
});
106119

107120
group('copyWith', () {

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: 6.11.2
3+
version: 6.12.1
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
@@ -10,7 +10,7 @@ environment:
1010

1111
dependencies:
1212
dio: ^4.0.0
13-
sentry: 6.11.2
13+
sentry: 6.12.1
1414

1515
dev_dependencies:
1616
meta: ^1.3.0

flutter/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ android {
5454
}
5555

5656
dependencies {
57-
api 'io.sentry:sentry-android:6.4.3'
57+
api 'io.sentry:sentry-android:6.5.0'
5858
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
5959
}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
117117

118118
SentryAndroid.init(context) { options ->
119119
args.getIfNotNull<String>("dsn") { options.dsn = it }
120-
args.getIfNotNull<Boolean>("debug") { options.setDebug(it) }
120+
args.getIfNotNull<Boolean>("debug") { options.isDebug = it }
121121
args.getIfNotNull<String>("environment") { options.environment = it }
122122
args.getIfNotNull<String>("release") { options.release = it }
123123
args.getIfNotNull<String>("dist") { options.dist = it }
@@ -147,7 +147,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
147147
val nativeCrashHandling = (args["enableNativeCrashHandling"] as? Boolean) ?: true
148148
// nativeCrashHandling has priority over anrEnabled
149149
if (!nativeCrashHandling) {
150-
options.setEnableUncaughtExceptionHandler(false)
150+
options.isEnableUncaughtExceptionHandler = false
151151
options.isAnrEnabled = false
152152
// if split symbols are enabled, we need Ndk integration so we can't really offer the option
153153
// to turn it off
@@ -161,7 +161,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
161161
}
162162
}
163163

164-
args.getIfNotNull<Boolean>("sendClientReports") { options.setSendClientReports(it) }
164+
args.getIfNotNull<Boolean>("sendClientReports") { options.isSendClientReports = it }
165165

166166
options.setBeforeSend { event, _ ->
167167
setEventOriginTag(event)
@@ -179,8 +179,8 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
179179
result.success(null)
180180
return
181181
}
182-
val appStartTime = AppStartState.getInstance().getAppStartTime()
183-
val isColdStart = AppStartState.getInstance().isColdStart()
182+
val appStartTime = AppStartState.getInstance().appStartTime
183+
val isColdStart = AppStartState.getInstance().isColdStart
184184

185185
if (appStartTime == null) {
186186
Log.w("Sentry", "App start won't be sent due to missing appStartTime")
@@ -190,7 +190,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
190190
result.success(null)
191191
} else {
192192
val item = mapOf<String, Any?>(
193-
"appStartTime" to appStartTime.getTime().toDouble(),
193+
"appStartTime" to appStartTime.time.toDouble(),
194194
"isColdStart" to isColdStart
195195
)
196196
result.success(item)
@@ -222,9 +222,9 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
222222
val sentryId = SentryId(id)
223223
framesTracker?.setMetrics(activity, sentryId)
224224
val metrics = framesTracker?.takeMetrics(sentryId)
225-
val total = metrics?.get("frames_total")?.getValue()?.toInt() ?: 0
226-
val slow = metrics?.get("frames_slow")?.getValue()?.toInt() ?: 0
227-
val frozen = metrics?.get("frames_frozen")?.getValue()?.toInt() ?: 0
225+
val total = metrics?.get("frames_total")?.value?.toInt() ?: 0
226+
val slow = metrics?.get("frames_slow")?.value?.toInt() ?: 0
227+
val frozen = metrics?.get("frames_frozen")?.value?.toInt() ?: 0
228228

229229
if (total == 0 && slow == 0 && frozen == 0) {
230230
result.success(null)
@@ -307,7 +307,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
307307
"info" -> SentryLevel.INFO
308308
"debug" -> SentryLevel.DEBUG
309309
"error" -> SentryLevel.ERROR
310-
else -> SentryLevel.ERROR
310+
else -> SentryLevel.INFO
311311
}
312312
}
313313
(breadcrumb["data"] as? Map<String, Any?>)?.let { data ->
@@ -372,7 +372,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
372372
if (args.isNotEmpty()) {
373373
val event = args.first() as ByteArray?
374374

375-
if (event != null && event.size > 0) {
375+
if (event != null && event.isNotEmpty()) {
376376
if (!writeEnvelope(event)) {
377377
result.error("3", "SentryOptions or outboxPath are null or empty", null)
378378
}

flutter/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sentry_flutter_example
22
description: Demonstrates how to use the sentry_flutter plugin.
3-
version: 6.11.2
3+
version: 6.12.1
44

55
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
66

flutter/ios/Classes/SentryFlutterPluginApple.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
171171
infos["integrations"] = integrations
172172
}
173173

174-
if let sdkInfo = self.sentryOptions?.sdkInfo {
175-
infos["package"] = ["version": sdkInfo.version, "sdk_name": "cocoapods:sentry-cocoa"]
176-
}
174+
// Not reading the name from PrivateSentrySDKOnly.getSdkName because
175+
// this is added as a package and packages should follow the sentry-release-registry format
176+
infos["package"] = ["version": PrivateSentrySDKOnly.getSdkVersionString(), "sdk_name": "cocoapods:sentry-cocoa"]
177177

178178
result(infos)
179179
}

flutter/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 = '6.11.2';
2+
const String sdkVersion = '6.12.1';
33

44
/// The default SDK name reported to Sentry.io in the submitted events.
55
const String sdkName = 'sentry.dart.flutter';

flutter/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sentry_flutter
2-
version: 6.11.2
2+
version: 6.12.1
33
description: Sentry SDK for Flutter. This package aims to support different Flutter targets by relying on the many platforms supported by Sentry with native SDKs.
44
homepage: https://docs.sentry.io/platforms/flutter/
55
repository: https://github.com/getsentry/sentry-dart
@@ -14,7 +14,7 @@ dependencies:
1414
sdk: flutter
1515
flutter_web_plugins:
1616
sdk: flutter
17-
sentry: 6.11.2
17+
sentry: 6.12.1
1818
package_info_plus: ^1.0.0
1919
meta: ^1.3.0
2020

logging/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 = '6.11.2';
2+
const String sdkVersion = '6.12.1';
33

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

logging/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sentry_logging
22
description: An integration which adds support for recording log from the logging package.
3-
version: 6.11.2
3+
version: 6.12.1
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
@@ -10,7 +10,7 @@ environment:
1010

1111
dependencies:
1212
logging: ^1.0.0
13-
sentry: 6.11.2
13+
sentry: 6.12.1
1414

1515
dev_dependencies:
1616
lints: ^2.0.0

metrics/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
perf-test-app*

0 commit comments

Comments
 (0)