Skip to content
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
fix(auto_source): Handle data property correctly
  • Loading branch information
armenzg committed Apr 2, 2025
commit 8c2c6af0bbc20ff8a4336d9bac4007d2dbfe6143
5 changes: 4 additions & 1 deletion src/sentry/issues/auto_source_code_config/stacktraces.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def get_frames_to_process(data: NodeData | dict[str, Any], platform: str) -> lis


def _check_not_categorized(frame: dict[str, Any]) -> bool:
return frame.get("data", {}).get("category") is None
data = frame.get("data", {})
if data:
return "category" not in data
return True


def get_stacktraces(data: NodeData | dict[str, Any]) -> list[dict[str, Any]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,20 @@ def _stacktrace(frames: list[dict[str, Any]]) -> dict[str, Any]:
),
pytest.param(
[
# This frame is excluded because it has already been categorized
# These frames are excluded because they have been categorized
{"module": "android.app", "in_app": False, "data": {"category": "foo"}},
{"module": "android.app", "in_app": False, "data": {"category": None}},
# These frames will be considered since they don't have a category set
{"module": "android.app", "in_app": False, "data": {}},
{"module": "android.app", "in_app": False, "data": None},
{"module": "com.example.foo", "in_app": False, "data": {}},
{"module": "com.example.bar", "in_app": False},
],
"java",
[
# These will be considered since they don't have a category set
{"module": "android.app", "in_app": False, "data": {}},
{"module": "android.app", "in_app": False, "data": None},
{"module": "com.example.foo", "in_app": False, "data": {}},
{"module": "com.example.bar", "in_app": False},
],
Expand Down
Loading