Skip to content

Commit 050bee7

Browse files
philipphofmannroaga
authored andcommitted
fix(sdk-crashes): Ignore current stacktrace (#75140)
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 shipped in sentry-dart 8.2.1.
1 parent 61ad1b1 commit 050bee7

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

fixtures/sdk_crash_detection/crash_event_dart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_crash_event_with_frames(frames: Sequence[Mapping[str, str]], **kwargs) -
8888
"type": "os",
8989
},
9090
},
91-
"sdk": {"name": "sentry.dart.flutter", "version": "8.2.0"},
91+
"sdk": {"name": "sentry.dart.flutter", "version": "8.2.1"},
9292
"timestamp": time.time(),
9393
"type": "error",
9494
}

src/sentry/utils/sdk_crashes/sdk_crash_detection_config.py

Lines changed: 6 additions & 4 deletions
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

Lines changed: 3 additions & 3 deletions
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]
@@ -195,7 +195,7 @@ def test_ignore_get_sentry_exception(mock_sdk_crash_reporter, mock_random, store
195195
@decorators
196196
def test_beta_sdk_version_detected(mock_sdk_crash_reporter, mock_random, store_event, configs):
197197
event_data = get_crash_event()
198-
set_path(event_data, "sdk", "version", value="8.2.1-beta.0")
198+
set_path(event_data, "sdk", "version", value="8.2.2-beta.0")
199199
event = store_event(data=event_data)
200200

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

0 commit comments

Comments
 (0)