Skip to content

Commit f25f207

Browse files
authored
Add debug_meta to all events (#1756)
* load_image_list_integration now appends debug_meta info to all non-transaction events with a stacktrace, instead of checking for Exception existence
1 parent 4829ad3 commit f25f207

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
### Fixes
6+
7+
- Add debug_meta to all events ([#1756](https://github.com/getsentry/sentry-dart/pull/1756))
8+
- Fixes obfuscated stacktraces when `captureMessage` or `captureEvent` is called with `attachStacktrace` option
9+
510
### Features
611

712
- Add option to opt out of fatal level for automatically collected errors ([#1738](https://github.com/getsentry/sentry-dart/pull/1738))

flutter/lib/src/integrations/load_image_list_integration.dart

+16-5
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,25 @@ extension _NeedsSymbolication on SentryEvent {
2525
if (this is SentryTransaction) {
2626
return false;
2727
}
28-
if (exceptions?.isNotEmpty == false) {
29-
return false;
30-
}
31-
final frames = exceptions?.first.stackTrace?.frames;
28+
final frames = _getStacktraceFrames();
3229
if (frames == null) {
3330
return false;
3431
}
35-
return frames.any((frame) => 'native' == frame.platform);
32+
return frames.any((frame) => 'native' == frame?.platform);
33+
}
34+
35+
List<SentryStackFrame?>? _getStacktraceFrames() {
36+
if (exceptions?.isNotEmpty == true) {
37+
return exceptions?.first.stackTrace?.frames;
38+
}
39+
if (threads?.isNotEmpty == true) {
40+
var stacktraces = threads?.map((e) => e.stacktrace);
41+
return stacktraces
42+
?.where((element) => element != null)
43+
.expand((element) => element!.frames)
44+
.toList();
45+
}
46+
return null;
3647
}
3748
}
3849

flutter/test/integrations/load_image_list_test.dart

+1-6
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,7 @@ void main() {
187187
SentryEvent _getEvent() {
188188
final frame = SentryStackFrame(platform: 'native');
189189
final st = SentryStackTrace(frames: [frame]);
190-
final ex = SentryException(
191-
type: 'type',
192-
value: 'value',
193-
stackTrace: st,
194-
);
195-
return SentryEvent(exceptions: [ex]);
190+
return SentryEvent(threads: [SentryThread(stacktrace: st)]);
196191
}
197192

198193
class Fixture {

0 commit comments

Comments
 (0)