-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove sentry
frames if SDK falls back to current stack trace
#2351
Changes from all commits
7ce2108
adf8466
45a99cb
be807ef
7690750
89f72ba
3e0b272
0054c9d
6a2fb35
b74ef0c
89ff369
48c36f9
0ca1761
eef0828
e9b16e8
6bb1d53
d72452a
47e1472
9cd7166
65e93be
5ddd2af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,19 +24,26 @@ class SentryStackTraceFactory { | |
return parse(stackTrace).frames; | ||
} | ||
|
||
SentryStackTrace parse(dynamic stackTrace) { | ||
SentryStackTrace parse(dynamic stackTrace, {bool? removeSentryFrames}) { | ||
final parsed = _parseStackTrace(stackTrace); | ||
final frames = <SentryStackFrame>[]; | ||
var onlyAsyncGap = true; | ||
|
||
for (var t = 0; t < parsed.traces.length; t += 1) { | ||
final trace = parsed.traces[t]; | ||
|
||
// NOTE: We want to keep the Sentry frames for crash detection | ||
// NOTE: We want to keep the Sentry frames for SDK crash detection | ||
// this does not affect grouping since they're not marked as inApp | ||
// only exception if there was no stack trace, we remove them | ||
for (final frame in trace.frames) { | ||
final stackTraceFrame = encodeStackTraceFrame(frame); | ||
var stackTraceFrame = encodeStackTraceFrame(frame); | ||
|
||
if (stackTraceFrame != null) { | ||
if (removeSentryFrames == true && | ||
(stackTraceFrame.package == 'sentry' || | ||
stackTraceFrame.package == 'sentry_flutter')) { | ||
continue; | ||
Comment on lines
+42
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not only limited to 'sentry' and 'sentry_flutter' see here: https://github.com/getsentry/sentry-dart/blob/f754e867516d18d38272967acc03289a4ff83c0c/dart/lib/src/sentry_stack_trace_factory.dart#L18C1-L29C1 (this has been removed in the current code, this links to an older commit) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case only those are relevant, as we just want to remove those frames that originate from creating the fallback stack-trace, no? |
||
} | ||
frames.add(stackTraceFrame); | ||
onlyAsyncGap = false; | ||
} | ||
|
@@ -100,7 +107,7 @@ class SentryStackTraceFactory { | |
final member = frame.member; | ||
|
||
if (frame is UnparsedFrame && member != null) { | ||
// if --split-debug-info is enabled, thats what we see: | ||
// if --split-debug-info is enabled, that's what we see: | ||
// #00 abs 000000723d6346d7 _kDartIsolateSnapshotInstructions+0x1e26d7 | ||
|
||
// we are only interested on the #01, 02... items which contains the 'abs' addresses. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is not part of this PR but isn't the
attachStacktrace
option basically useless because it will still add teh stacktrace if there is one even though a user might've setattachStacktrace
to false.We don't have to address this here but I just find it strange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check was introduced here.
And with the change in #524 the fallback thread was moved from the event to the threads.
Reading the discription for
attachThreads
, I think we should only attach it here if it is set to true. It's a breaking change, as it affects grouping. This feature is also opt-out, so it will not affect as many users.Seeing that @rxlabz and @ueman were involved, maybe they have some additional insight for us?