Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| timestamp: SystemTime::now(), | ||
| contexts: map, | ||
| ..Default::default() | ||
| } |
There was a problem hiding this comment.
Feedback event missing required type field
High Severity
The to_new_event method constructs a feedback Event but doesn't set r#type to Some("feedback".to_string()). The PR specifically added a type field to the Event struct for this purpose, but the ..Default::default() fallback leaves it as None, so it won't be serialized. Per the Sentry protocol, feedback event payloads require "type": "feedback" for the backend to correctly identify and process them as feedback rather than regular error events.
Additional Locations (1)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1033 +/- ##
==========================================
- Coverage 73.81% 73.63% -0.18%
==========================================
Files 64 66 +2
Lines 7538 7582 +44
==========================================
+ Hits 5564 5583 +19
- Misses 1974 1999 +25 |
| map.insert("feedback".to_string(), self.to_context()); | ||
| map | ||
| }; | ||
| Event { | ||
| event_id: random_uuid(), | ||
| level: Level::Info, | ||
| timestamp: SystemTime::now(), | ||
| contexts: map, | ||
| ..Default::default() | ||
| } | ||
| } |
There was a problem hiding this comment.
Bug: The to_new_event() function for feedback events fails to set the r#type field, causing them to be processed incorrectly by Sentry.
Severity: HIGH
Suggested Fix
In the to_new_event function, explicitly set the r#type field on the Event struct to Some("feedback".to_string()) to ensure the event is correctly categorized by the Sentry backend.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: sentry-types/src/protocol/feedback.rs#L25-L38
Potential issue: The `to_new_event()` method in `sentry-types/src/protocol/feedback.rs`
creates an `Event` from user feedback but fails to set the `r#type` field. The event is
initialized with `..Default::default()`, which sets the `r#type` field to `None`. Due to
the `skip_serializing_if = "Option::is_none"` attribute, this field is omitted from the
serialized JSON payload sent to Sentry. As a result, the Sentry backend will not
correctly identify the event as a feedback event, causing it to appear as an "unlabeled
event" and not be displayed in the User Feedback section, which defeats the purpose of
the feature.
Did we get this right? 👍 / 👎 to inform future reviews.
|
Hi @zmitchell, thank you for the pull request. Before I do a full review, please check and resolve (or mark as irrelevant) all of the comments from AI reviewers. Also, please add a changelog entry for these changes. Thanks! 🙏 |


Description
Implements the plumbing for the User Feedback API.
Issues
Reminders
feat:,fix:,ref:,meta:, etc.)