Repository navigation
Add beforeSendFeedback callback for user feedback filtering - #1528
Merged
Merged
Conversation
Introduce USentryBeforeSendFeedbackHandler and wire it through plugin settings and the subsystem callback bundle so user feedback can be filtered or modified before being sent. Platform implementations follow.
Register sentry_options_set_before_send_feedback and route it through USentryBeforeSendFeedbackHandler, mirroring the beforeSend trampoline. Feedback dropped by the handler is discarded via sentry_value_decref; a new FGenericPlatformSentryFeedback constructor adopts the callback-provided value so the handler can read and mutate it in place.
Route SentryOptions.setBeforeSendFeedback through the JNI bridge to USentryBeforeSendFeedbackHandler: serialize the handler pointer, extract the Feedback from the SentryEvent in SentryUnrealBeforeSendFeedbackCallback, and invoke the handler via a new onBeforeSendFeedback native method. Adds an FAndroidSentryFeedback constructor that wraps an existing Java Feedback.
sentry-cocoa has no feedback filter and its beforeSend callback skips feedback, so invoke the handler manually at the start of CaptureFeedback, dropping the feedback when the handler returns null. The handler runs on the calling thread with the same reentrancy and safety guards as the other Apple callbacks.
Add a feedback-capture integration test that captures user feedback associated with an event and verifies it reaches Sentry with the expected fields. Add UCppBeforeSendFeedbackHandler, registered via an -ini override in the desktop Pester suite, to exercise the beforeSendFeedback hook end to end: the handler redacts the contact email, which the test asserts. Bump the app-runner pin to pull in the Get-SentryFeedback helpers.
sentry-native wraps the user feedback in an event under contexts.feedback before invoking before_send_feedback, so the callback receives the event, not the flat feedback value. Read contexts.feedback and hand that to the handler so its edits land where the feedback is serialized from. Caught by the feedback-capture integration test, which now passes 8/8.
Contributor
|
This was referenced Aug 11, 2026
beforeSendFeedback hookbeforeSendFeedback hook to filter user feedback
beforeSendFeedback hook to filter user feedbackbeforeSendFeedback callback for user feedback filtering
…kaging pack.ps1 rewrites the plugin's raw UPROPERTY handler pointers to TObjectPtr for UE 5.0+, where native pointer members are disallowed on some targets (e.g. macOS). The new BeforeSendFeedbackHandler member was missing from that list, so the packaged plugin failed to build on macOS UE 5.8.
EGuidFormats::DigitsLower was added in UE 5.0, breaking the UE 4.27 build. Digits is available on all supported engine versions and works the same for correlating the feedback by its message token.
Use Log verbosity on Linux/UE 4.27 to avoid duplicated log lines, matching the other integration tests, and pin app-runner to the latest commit carrying the feedback helpers and the manifest export.
limbonaut
approved these changes
Aug 11, 2026
Match the native and Android SDK callbacks by handing the handler the feedback event (USentryEvent) instead of a bare feedback object, so handlers can enrich or scrub the whole event - tags, contexts, message. Native and Android now wrap the event like the beforeSend hook, and the feedback-value adopt constructors are no longer needed.
sentry-cocoa has no before-send-feedback callback and applies scope internally when capturing feedback, so there's no seam to hand the handler a scope-enriched event. Don't invoke the hook on Mac/iOS and log a warning when one is configured.
Scrub the feedback contact email through the event's feedback context in the sample C++ and Blueprint handlers, skip the redaction assertion on the cocoa backend where the hook is a no-op, and pin app-runner to the merged feedback helpers.
…ry-unreal into feat/before-send-feedback
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.
Reviewed by Cursor Bugbot for commit 7b66199. Configure here.
Expose the feedback carried by a feedback event through a typed USentryFeedback so beforeSendFeedback handlers can inspect and modify the feedback fields. Native reads the feedback context value; Android returns the typed io.sentry.protocol.Feedback via the JNI bridge; Apple and Null return null. The generic context API can't serve this on Android, where the feedback context is a typed object rather than a map.
Scrub the contact email through Event->GetFeedback() in the sample handler, and add a feedback-capture Context to the Android integration suite so the typed-Feedback JNI path is covered on device.
2 tasks
tustanivsky
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Aug 18, 2026
This PR documents the new `beforeSendFeedback` hook in the Unreal SDK. ## Key Changes - Adds a "Filtering User Feedback" section to the Unreal filtering guide. - Adds a `configuration/before-send-feedback` platform-include showing how to subclass `USentryBeforeSendFeedbackHandler` and register it via the settings delegate. ## Related Items - getsentry/sentry-unreal#1528
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR adds a
beforeSendFeedbackhook to the Unreal SDK, letting applications inspect, enrich, or drop user feedback before it is sent to Sentry. It mirrorssentry_options_set_before_send_feedback(sentry-native) andSentryOptions.setBeforeSendFeedback(sentry-java), handing the handler the feedback event so it can scrub or enrich the whole event.Key Changes
USentryBeforeSendFeedbackHandler(Blueprintable), exposed via theBeforeSendFeedbackHandlerplugin setting and wired through the subsystem callback bundle. The handler receives the feedback event (USentryEvent); returnnullto drop it, or the (possibly modified) event to send it.USentryEvent::GetFeedback()returns the feedback carried by a feedback event as a typedUSentryFeedback, so handlers can read and modify the feedback fields (message, name, contact email, ...).sentry_options_set_before_send_feedbackand wraps the event like thebeforeSendhook.SentryOptions.setBeforeSendFeedbackthrough JNI, wrapping the event like thebeforeSendhook;GetFeedback()returns the typedio.sentry.protocol.Feedback.UCppBeforeSendFeedbackHandler(C++ and Blueprint) plus afeedback-captureintegration test (desktop and Android) that verifies delivery, field values, the handler scrubbing the contact email viaEvent->GetFeedback(), and the associated-event link against live Sentry.Documentation
Related Items