Skip to content

Commit 6412a41

Browse files
fix(sdk-crashes): Ignore current stacktrace
Ignore the wrapper function getCurrentStackTrace instead of getSentryException. getCurrentStackTrace is the wrapper function for getting the current stacktrace, and getSentryException uses that function. This was changed with getsentry/sentry-dart#2072 and whipped in sentry-dart 8.2.1.
1 parent 94d9865 commit 6412a41

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/sentry/utils/sdk_crashes/sdk_crash_detection_config.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def build_sdk_crash_detection_configs() -> Sequence[SDKCrashDetectionConfig]:
275275
sdk_names=["sentry.dart", "sentry.dart.flutter"],
276276
# Since 8.2.0 the Dart SDK sends SDK frames, which is required;
277277
# see https://github.com/getsentry/sentry-dart/releases/tag/8.2.0
278-
min_sdk_version="8.2.0",
278+
min_sdk_version="8.2.1",
279279
report_fatal_errors=True,
280280
system_library_path_patterns={
281281
# Dart
@@ -301,9 +301,11 @@ def build_sdk_crash_detection_configs() -> Sequence[SDKCrashDetectionConfig]:
301301
},
302302
path_replacer=KeepFieldPathReplacer(fields={"package", "filename", "abs_path"}),
303303
),
304-
# SentryExceptionFactory.getSentryException is always part of the stacktrace when
305-
# users capture exceptions and would cause false positives. Therefore, we ignore it.
306-
sdk_crash_ignore_functions_matchers={"SentryExceptionFactory.getSentryException"},
304+
# getCurrentStackTrace is always part of the stacktrace when the SDK captures the stacktrace,
305+
# and would cause false positives. Therefore, we ignore it.
306+
sdk_crash_ignore_functions_matchers={
307+
"getCurrentStackTrace",
308+
},
307309
)
308310
configs.append(dart_config)
309311

tests/sentry/utils/sdk_crashes/test_sdk_crash_detection_dart.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ def test_sdk_crash_is_reported_with_flutter_paths(
178178

179179

180180
@decorators
181-
def test_ignore_get_sentry_exception(mock_sdk_crash_reporter, mock_random, store_event, configs):
182-
event_data = get_crash_event(sdk_function="SentryExceptionFactory.getSentryException")
181+
def test_ignore_get_current_stack_trace(mock_sdk_crash_reporter, mock_random, store_event, configs):
182+
event_data = get_crash_event(sdk_function="getCurrentStackTrace")
183183
event = store_event(data=event_data)
184184

185185
configs[1].organization_allowlist = [event.project.organization_id]

0 commit comments

Comments
 (0)