Skip to content

Commit

Permalink
Add debug_meta to all events (#1756)
Browse files Browse the repository at this point in the history
* load_image_list_integration now appends debug_meta info to all non-transaction events with a stacktrace, instead of checking for Exception existence
  • Loading branch information
stefanosiano authored Nov 29, 2023
1 parent 4829ad3 commit f25f207
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

### Fixes

- Add debug_meta to all events ([#1756](https://github.com/getsentry/sentry-dart/pull/1756))
- Fixes obfuscated stacktraces when `captureMessage` or `captureEvent` is called with `attachStacktrace` option

### Features

- Add option to opt out of fatal level for automatically collected errors ([#1738](https://github.com/getsentry/sentry-dart/pull/1738))
Expand Down
21 changes: 16 additions & 5 deletions flutter/lib/src/integrations/load_image_list_integration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,25 @@ extension _NeedsSymbolication on SentryEvent {
if (this is SentryTransaction) {
return false;
}
if (exceptions?.isNotEmpty == false) {
return false;
}
final frames = exceptions?.first.stackTrace?.frames;
final frames = _getStacktraceFrames();
if (frames == null) {
return false;
}
return frames.any((frame) => 'native' == frame.platform);
return frames.any((frame) => 'native' == frame?.platform);
}

List<SentryStackFrame?>? _getStacktraceFrames() {
if (exceptions?.isNotEmpty == true) {
return exceptions?.first.stackTrace?.frames;
}
if (threads?.isNotEmpty == true) {
var stacktraces = threads?.map((e) => e.stacktrace);
return stacktraces
?.where((element) => element != null)
.expand((element) => element!.frames)
.toList();
}
return null;
}
}

Expand Down
7 changes: 1 addition & 6 deletions flutter/test/integrations/load_image_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,7 @@ void main() {
SentryEvent _getEvent() {
final frame = SentryStackFrame(platform: 'native');
final st = SentryStackTrace(frames: [frame]);
final ex = SentryException(
type: 'type',
value: 'value',
stackTrace: st,
);
return SentryEvent(exceptions: [ex]);
return SentryEvent(threads: [SentryThread(stacktrace: st)]);
}

class Fixture {
Expand Down

0 comments on commit f25f207

Please sign in to comment.