Skip to content

Commit cc432a6

Browse files
fix: Default breadcrumbs value for events without breadcrumbs (#4952)
Change the default value when annotating truncated breadcrumbs to a dictionary with the expected keys instead of an empty list. Closes #4951
1 parent 843c062 commit cc432a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sentry_sdk/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,8 @@ def _prepare_event(
619619
)
620620
if previous_total_breadcrumbs is not None:
621621
event["breadcrumbs"] = AnnotatedValue(
622-
event.get("breadcrumbs", []), {"len": previous_total_breadcrumbs}
622+
event.get("breadcrumbs", {"values": []}),
623+
{"len": previous_total_breadcrumbs},
623624
)
624625

625626
# Postprocess the event here so that annotated types do

0 commit comments

Comments
 (0)