-
-
Notifications
You must be signed in to change notification settings - Fork 196
feat: Add attachment support to user feedback #1414
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
base: master
Are you sure you want to change the base?
Conversation
|
|
|
||
| if (hint) { | ||
| sentry__feedback_hint_free(hint); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Feedback Capture Function Ownership Violation
The sentry_capture_feedback_with_hint function leaks the user_feedback value. It fails to decrement the value's reference count when sentry isn't initialized or when prepare_user_feedback successfully creates an envelope, violating its ownership contract.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If envelope was created successfully it takes ownership of the user_feedback value so we don't have to decref manually.
|
Looks good at first glance, even though it feels like it's a lot of new API for a very specific use case. Since the goal is to add attachments to envelopes, I wonder if it would make sense to open up some of the existing but internal envelope APIs to make the same achievable in a more generic way. What do you think? |
This PR adds the ability to attach files and binary data to feedback submissions allowing users to include screenshots, logs or other contextual information alongside their text messages.
The initial request to add attachment support for user feedback originated from the Unreal SDK:
Here, a hint pattern is used (borrowed from the Android SDK) which relies on an opaque pointer to provide a standardized way to attach optional context or metadata to feedback without modifying its core value.
Example usage:
Example feedback with two image attachments.
Current implementation focuses on the feedback use case but it leaves room for an easy refactor to support additional APIs later on if needed.