Skip to content

Commit

Permalink
Merge branch 'main' into feat/redact-screenshots-via-view-hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhaintz authored Nov 20, 2024
2 parents d3a0a2a + 404f5a9 commit d6212ac
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
cd drift
flutter test --coverage --test-randomize-ordering-seed=random
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v3
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # pin@v3
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
with:
name: sentry_drift
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
flutter test --coverage --test-randomize-ordering-seed=random
dart run remove_from_coverage -f coverage/lcov.info -r 'binding.dart'
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v3
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # pin@v3
if: matrix.sdk == 'stable' && matrix.target == 'linux'
with:
name: sentry_flutter
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/isar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
cd isar
flutter test -j 1 --coverage --test-randomize-ordering-seed=random
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v3
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # pin@v3
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
with:
name: sentry_isar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sqflite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
cd sqflite
flutter test --coverage --test-randomize-ordering-seed=random
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # pin@v3
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # pin@v3
if: runner.os == 'Linux' && matrix.sdk == 'stable' && matrix.target == 'linux'
with:
name: sentry_sqflite
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Enhancements

- Only send debug images referenced in the stacktrace for events ([#2329](https://github.com/getsentry/sentry-dart/pull/2329))
- Remove `sentry` frames if SDK falls back to current stack trace ([#2351](https://github.com/getsentry/sentry-dart/pull/2351))
- Flutter doesn't always provide stack traces for unhandled errors - this is normal Flutter behavior
- When no stack trace is provided (in Flutter errors, `captureException`, or `captureMessage`):
Expand Down Expand Up @@ -65,9 +66,12 @@

### Dependencies

- Bump Android SDK from v7.16.0 to v7.17.0 ([#2408](https://github.com/getsentry/sentry-dart/pull/2408))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7170)
- [diff](https://github.com/getsentry/sentry-java/compare/7.16.0...7.17.0)
- 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))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7180)
- [diff](https://github.com/getsentry/sentry-java/compare/7.16.0...7.18.0)
- Bump Native SDK from v0.7.12 to v0.7.13 ([#2420](https://github.com/getsentry/sentry-dart/pull/2420))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0713)
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.12...0.7.13)

## 8.10.1

Expand Down
2 changes: 1 addition & 1 deletion flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ android {
}

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

// Required -- JUnit 4 framework
Expand Down
2 changes: 1 addition & 1 deletion flutter/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
classpath 'io.sentry:sentry-android-gradle-plugin:4.12.0'
classpath 'com.android.tools.build:gradle:8.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.github.howardpang:androidNativeBundle:1.1.3'
classpath 'io.github.howardpang:androidNativeBundle:1.1.5'
}
}

Expand Down
2 changes: 2 additions & 0 deletions flutter/ios/Classes/SentryFlutterPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
#import <FlutterMacOS/FlutterMacOS.h>
#endif

#import <Sentry/SentryDebugImageProvider.h>

@interface SentryFlutterPlugin : NSObject<FlutterPlugin>
@end
31 changes: 27 additions & 4 deletions flutter/ios/Classes/SentryFlutterPluginApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
loadContexts(result: result)

case "loadImageList":
loadImageList(result: result)
loadImageList(call, result: result)

case "initNativeSdk":
initNativeSdk(call, result: result)
Expand Down Expand Up @@ -277,9 +277,32 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
}
}

private func loadImageList(result: @escaping FlutterResult) {
let debugImages = PrivateSentrySDKOnly.getDebugImages() as [DebugMeta]
result(debugImages.map { $0.serialize() })
private func loadImageList(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
var debugImages: [DebugMeta] = []

if let arguments = call.arguments as? [String], !arguments.isEmpty {
var imagesAddresses: Set<String> = []

for argument in arguments {
let hexDigits = argument.replacingOccurrences(of: "0x", with: "")
if let instructionAddress = UInt64(hexDigits, radix: 16) {
let image = SentryDependencyContainer.sharedInstance().binaryImageCache.image(
byAddress: instructionAddress)
if let image = image {
let imageAddress = sentry_formatHexAddressUInt64(image.address)!
imagesAddresses.insert(imageAddress)
}
}
}
debugImages =
SentryDependencyContainer.sharedInstance().debugImageProvider
.getDebugImagesForImageAddressesFromCache(imageAddresses: imagesAddresses) as [DebugMeta]
}
if debugImages.isEmpty {
debugImages = PrivateSentrySDKOnly.getDebugImages() as [DebugMeta]
}

result(debugImages.map { $0.serialize() })
}

private func initNativeSdk(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
Expand Down
11 changes: 9 additions & 2 deletions flutter/lib/src/native/sentry_native_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,15 @@ class SentryNativeChannel
@override
Future<List<DebugImage>?> loadDebugImages(SentryStackTrace stackTrace) =>
tryCatchAsync('loadDebugImages', () async {
final images = await channel
.invokeListMethod<Map<dynamic, dynamic>>('loadImageList');
Set<String> instructionAddresses = {};
for (final frame in stackTrace.frames) {
if (frame.instructionAddr != null) {
instructionAddresses.add(frame.instructionAddr!);
}
}

final images = await channel.invokeListMethod<Map<dynamic, dynamic>>(
'loadImageList', instructionAddresses.toList());
return images
?.map((e) => e.cast<String, dynamic>())
.map(DebugImage.fromJson)
Expand Down
2 changes: 1 addition & 1 deletion flutter/sentry-native/CMakeCache.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Basically, this is a properties file we use both in CMake and update-deps.yml to update dependencies.

repo=https://github.com/getsentry/sentry-native
version=0.7.12
version=0.7.13
2 changes: 1 addition & 1 deletion flutter/test/sentry_native_channel_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void main() {
}
];

when(channel.invokeMethod('loadImageList'))
when(channel.invokeMethod('loadImageList', any))
.thenAnswer((invocation) async => json);

final data = await sut.loadDebugImages(SentryStackTrace(frames: []));
Expand Down
2 changes: 1 addition & 1 deletion metrics/flutter.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 3.24.4
version = 3.24.5
repo = https://github.com/flutter/flutter

0 comments on commit d6212ac

Please sign in to comment.