Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
load_image_list_integration now appends debug_meta info to all non-tr…
…ansaction events with a stacktrace, instead of checking for Exception existence
  • Loading branch information
stefanosiano committed Nov 24, 2023
commit 143feb59f05965fb068abee2f84cbccb4f3630ae
18 changes: 13 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,22 @@ 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