Skip to content

Commit 8077563

Browse files
committed
Merge branch 'main' into feat/enable-windows-native
2 parents 729bd1a + 07cd9e8 commit 8077563

23 files changed

+254
-153
lines changed

.github/workflows/drift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
cd drift
9797
flutter test --coverage --test-randomize-ordering-seed=random
9898
99-
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v3
99+
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # pin@v3
100100
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
101101
with:
102102
name: sentry_drift

.github/workflows/flutter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
flutter test --coverage --test-randomize-ordering-seed=random
9999
dart run remove_from_coverage -f coverage/lcov.info -r 'binding.dart'
100100
101-
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v3
101+
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # pin@v3
102102
if: matrix.sdk == 'stable' && matrix.target == 'linux'
103103
with:
104104
name: sentry_flutter

.github/workflows/isar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
cd isar
9797
flutter test -j 1 --coverage --test-randomize-ordering-seed=random
9898
99-
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v3
99+
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # pin@v3
100100
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
101101
with:
102102
name: sentry_isar

.github/workflows/sqflite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
cd sqflite
9797
flutter test --coverage --test-randomize-ordering-seed=random
9898
99-
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v3
99+
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # pin@v3
100100
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
101101
with:
102102
name: sentry_sqflite

CHANGELOG.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22

33
## Unreleased
44

5-
### Enhancements
5+
### Features
66

7-
- Remove `sentry` frames if SDK falls back to current stack trace ([#2351](https://github.com/getsentry/sentry-dart/pull/2351))
8-
- Flutter doesn't always provide stack traces for unhandled errors - this is normal Flutter behavior
9-
- When no stack trace is provided (in Flutter errors, `captureException`, or `captureMessage`):
10-
- SDK creates a synthetic trace using `StackTrace.current`
11-
- Internal SDK frames are removed to reduce noise
12-
- Original stack traces (when provided) are left unchanged
7+
- Windows native error & obfuscation support ([#2286](https://github.com/getsentry/sentry-dart/pull/2286), [#2426](https://github.com/getsentry/sentry-dart/pull/2426))
138

149
### Features
1510

16-
- Windows native error & obfuscation support ([#2286](https://github.com/getsentry/sentry-dart/pull/2286), [#2426](https://github.com/getsentry/sentry-dart/pull/2426))
11+
- Improve app start measurements by using `addTimingsCallback` instead of `addPostFrameCallback` to determine app start end ([#2405](https://github.com/getsentry/sentry-dart/pull/2405))
12+
- ⚠️ This change may result in reporting of shorter app start durations
1713
- Improve frame tracking accuracy ([#2372](https://github.com/getsentry/sentry-dart/pull/2372))
1814
- Introduces `SentryWidgetsFlutterBinding` that tracks a frame starting from `handleBeginFrame` and ending in `handleDrawFrame`, this is approximately the [buildDuration](https://api.flutter.dev/flutter/dart-ui/FrameTiming/buildDuration.html) time
1915
- By default, `SentryFlutter.init()` automatically initializes `SentryWidgetsFlutterBinding` through the `WidgetsFlutterBindingIntegration`
@@ -29,6 +25,16 @@
2925
```
3026
- ⚠️ Frame tracking will be disabled if a different binding is used
3127

28+
### Enhancements
29+
30+
- Only send debug images referenced in the stacktrace for events ([#2329](https://github.com/getsentry/sentry-dart/pull/2329))
31+
- Remove `sentry` frames if SDK falls back to current stack trace ([#2351](https://github.com/getsentry/sentry-dart/pull/2351))
32+
- Flutter doesn't always provide stack traces for unhandled errors - this is normal Flutter behavior
33+
- When no stack trace is provided (in Flutter errors, `captureException`, or `captureMessage`):
34+
- SDK creates a synthetic trace using `StackTrace.current`
35+
- Internal SDK frames are removed to reduce noise
36+
- Original stack traces (when provided) are left unchanged
37+
3238
### Fixes
3339

3440
- Apply default IP address (`{{auto}}`) to transactions ([#2395](https://github.com/getsentry/sentry-dart/pull/2395))
@@ -39,9 +45,12 @@
3945

4046
### Dependencies
4147

42-
- Bump Android SDK from v7.16.0 to v7.17.0 ([#2408](https://github.com/getsentry/sentry-dart/pull/2408))
43-
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7170)
44-
- [diff](https://github.com/getsentry/sentry-java/compare/7.16.0...7.17.0)
48+
- Bump Android SDK from v7.16.0 to v7.18.0 ([#2408](https://github.com/getsentry/sentry-dart/pull/2408), [#2419](https://github.com/getsentry/sentry-dart/pull/2419))
49+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7180)
50+
- [diff](https://github.com/getsentry/sentry-java/compare/7.16.0...7.18.0)
51+
- Bump Native SDK from v0.7.12 to v0.7.13 ([#2420](https://github.com/getsentry/sentry-dart/pull/2420))
52+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0713)
53+
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.12...0.7.13)
4554

4655
## 8.10.1
4756

flutter/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ android {
6060
}
6161

6262
dependencies {
63-
api 'io.sentry:sentry-android:7.17.0'
63+
api 'io.sentry:sentry-android:7.18.0'
6464
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6565

6666
// Required -- JUnit 4 framework

flutter/example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
classpath 'io.sentry:sentry-android-gradle-plugin:4.12.0'
1111
classpath 'com.android.tools.build:gradle:8.3.2'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13-
classpath 'io.github.howardpang:androidNativeBundle:1.1.3'
13+
classpath 'io.github.howardpang:androidNativeBundle:1.1.5'
1414
}
1515
}
1616

flutter/ios/Classes/SentryFlutterPlugin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
#import <FlutterMacOS/FlutterMacOS.h>
55
#endif
66

7+
#import <Sentry/SentryDebugImageProvider.h>
8+
79
@interface SentryFlutterPlugin : NSObject<FlutterPlugin>
810
@end

flutter/ios/Classes/SentryFlutterPluginApple.swift

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
9696
loadContexts(result: result)
9797

9898
case "loadImageList":
99-
loadImageList(result: result)
99+
loadImageList(call, result: result)
100100

101101
case "initNativeSdk":
102102
initNativeSdk(call, result: result)
@@ -277,9 +277,32 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
277277
}
278278
}
279279

280-
private func loadImageList(result: @escaping FlutterResult) {
281-
let debugImages = PrivateSentrySDKOnly.getDebugImages() as [DebugMeta]
282-
result(debugImages.map { $0.serialize() })
280+
private func loadImageList(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
281+
var debugImages: [DebugMeta] = []
282+
283+
if let arguments = call.arguments as? [String], !arguments.isEmpty {
284+
var imagesAddresses: Set<String> = []
285+
286+
for argument in arguments {
287+
let hexDigits = argument.replacingOccurrences(of: "0x", with: "")
288+
if let instructionAddress = UInt64(hexDigits, radix: 16) {
289+
let image = SentryDependencyContainer.sharedInstance().binaryImageCache.image(
290+
byAddress: instructionAddress)
291+
if let image = image {
292+
let imageAddress = sentry_formatHexAddressUInt64(image.address)!
293+
imagesAddresses.insert(imageAddress)
294+
}
295+
}
296+
}
297+
debugImages =
298+
SentryDependencyContainer.sharedInstance().debugImageProvider
299+
.getDebugImagesForImageAddressesFromCache(imageAddresses: imagesAddresses) as [DebugMeta]
300+
}
301+
if debugImages.isEmpty {
302+
debugImages = PrivateSentrySDKOnly.getDebugImages() as [DebugMeta]
303+
}
304+
305+
result(debugImages.map { $0.serialize() })
283306
}
284307

285308
private func initNativeSdk(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import 'package:flutter/cupertino.dart';
22
import 'package:flutter/scheduler.dart';
33

4+
/// Use instead of TimingsCallback as it is not available in the Flutter min version
5+
typedef SentryTimingsCallback = void Function(List<FrameTiming> timings);
6+
47
abstract class FrameCallbackHandler {
58
void addPostFrameCallback(FrameCallback callback);
6-
void addPersistentFrameCallback(FrameCallback callback);
7-
Future<void> get endOfFrame;
8-
bool get hasScheduledFrame;
9+
void removeTimingsCallback(SentryTimingsCallback callback);
10+
void addTimingsCallback(SentryTimingsCallback callback);
911
}
1012

1113
class DefaultFrameCallbackHandler implements FrameCallbackHandler {
@@ -18,19 +20,16 @@ class DefaultFrameCallbackHandler implements FrameCallbackHandler {
1820
}
1921

2022
@override
21-
void addPersistentFrameCallback(FrameCallback callback) {
23+
void addTimingsCallback(SentryTimingsCallback callback) {
2224
try {
23-
WidgetsBinding.instance.addPersistentFrameCallback(callback);
25+
WidgetsBinding.instance.addTimingsCallback(callback);
2426
} catch (_) {}
2527
}
2628

2729
@override
28-
Future<void> get endOfFrame async {
30+
void removeTimingsCallback(SentryTimingsCallback callback) {
2931
try {
30-
await WidgetsBinding.instance.endOfFrame;
32+
WidgetsBinding.instance.removeTimingsCallback(callback);
3133
} catch (_) {}
3234
}
33-
34-
@override
35-
bool get hasScheduledFrame => WidgetsBinding.instance.hasScheduledFrame;
3635
}

0 commit comments

Comments
 (0)