Skip to content
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

ref(sdk-crash-detection): Remove context detected #52108

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions src/sentry/utils/sdk_crashes/sdk_crash_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def detect_sdk_crash(self, event: Event, event_project_id: int) -> Optional[Even
return None

context = get_path(event.data, "contexts", "sdk_crash_detection")
if context is not None and context.get("detected", False):
if context is not None:
return None

# Getting the frames and checking if the event is unhandled might different per platform.
Expand All @@ -61,7 +61,6 @@ def detect_sdk_crash(self, event: Event, event_project_id: int) -> Optional[Even
"contexts",
"sdk_crash_detection",
value={
"detected": True,
"original_project_id": event.project.id,
"original_event_id": event.event_id,
},
Expand Down
11 changes: 9 additions & 2 deletions tests/sentry/utils/sdk_crashes/test_sdk_crash_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def execute_test(self, event_data, should_be_reported, mock_sdk_crash_reporter):

reported_event_data = mock_sdk_crash_reporter.report.call_args.args[0]
assert reported_event_data["contexts"]["sdk_crash_detection"] == {
"detected": True,
"original_project_id": event.project_id,
"original_event_id": event.event_id,
}
Expand Down Expand Up @@ -84,7 +83,15 @@ def test_no_exception_not_detected(self, mock_sdk_crash_reporter):
def test_sdk_crash_detected_event_is_not_reported(self, mock_sdk_crash_reporter):
event = get_crash_event()

set_path(event, "contexts", "sdk_crash_detection", value={"detected": True})
set_path(
event,
"contexts",
"sdk_crash_detection",
value={
"original_project_id": 1234,
"original_event_id": 1234,
},
)

self.execute_test(event, False, mock_sdk_crash_reporter)

Expand Down