Skip to content

feat(options): Add before_send_feedback hook - #1923

Merged
limbonaut merged 13 commits into
masterfrom
limbonaut/feat/before-send-feedback
Aug 3, 2026
Merged

limbonaut merged 13 commits into
masterfrom
limbonaut/feat/before-send-feedback

Conversation

@limbonaut

@limbonaut limbonaut commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator

Adds sentry_options_set_before_send_feedback, so user feedback can be modified or discarded before it is sent. The hook runs after the local and global scopes have been applied, so the callback sees the same feedback event that would otherwise be sent.

The callback also receives the capture's hint and can attach files to that single feedback. A hint is created for the callback when the caller did not pass one, so this works across all three capture functions. Returning sentry_value_new_null() discards the feedback and records a feedback client report.

@limbonaut
limbonaut force-pushed the limbonaut/feat/before-send-feedback branch from aa9a1b7 to b861083 Compare July 27, 2026 16:01
@codecov

codecov Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.80%. Comparing base (5bac907) to head (c320c75).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1923      +/-   ##
==========================================
+ Coverage   75.74%   75.80%   +0.06%     
==========================================
  Files          93       93              
  Lines       22128    22149      +21     
  Branches     3939     3942       +3     
==========================================
+ Hits        16760    16791      +31     
+ Misses       4484     4477       -7     
+ Partials      884      881       -3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@limbonaut
limbonaut force-pushed the limbonaut/feat/before-send-feedback branch from a267db0 to 6af6aea Compare July 27, 2026 19:43
Comment thread src/sentry_core.c Resolved
@limbonaut limbonaut changed the title WIP: feat(options): Add before_send_feedback hook feat(options): Add before_send_feedback hook Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against c320c75

@limbonaut
limbonaut merged commit c3bca45 into master Aug 3, 2026
99 of 100 checks passed
@limbonaut
limbonaut deleted the limbonaut/feat/before-send-feedback branch August 3, 2026 09:30
limbonaut added a commit to getsentry/sentry-docs that referenced this pull request Aug 10, 2026
…ack (#18982)

Documents what user feedback carries and how to control it in the Native
SDK: the global scope data attached to a feedback event, attaching files
through a hint, capturing feedback with a scope, and filtering with the
`before_send_feedback` hook. The hook receives a feedback event with the
feedback nested under `contexts.feedback`, so the filtering example
reads it from there and releases the event when dropping it.

- Refs getsentry/sentry-native#1915
- Refs getsentry/sentry-native#1916
- Refs getsentry/sentry-native#1923
- Refs getsentry/sentry-native#1932

## IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+

## PRE-MERGE CHECKLIST

*Make sure you've checked the following before merging your changes:*

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: JoshuaMoelans <[email protected]>
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
sentry-native 0.16.2

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.

- [ ] `resource` blocks have been checked for updates.
<details>
  <summary>release notes</summary>
  <pre>**Features**:

- Add `sentry_scope_remove_fingerprint` to remove a fingerprint set on a scope, matching the global `sentry_remove_fingerprint`. ([#1932](getsentry/sentry-native#1932))
- Add `sentry_options_set_before_send_feedback` to filter or enrich user feedback. Feedback does not go through `before_send`. ([#1923](getsentry/sentry-native#1923))
- Unix: Add `SENTRY_LINK_CURL` to control whether the curl transport links `libcurl` directly, loads it dynamically at runtime, or uses the default behavior. ([#1954](getsentry/sentry-native#1954))

**Fixes**:

- Name `sentry-logs` and `sentry-metrics` telemetry batcher threads so they can be identified in debuggers, profilers, and crash reports. ([#1937](getsentry/sentry-native#1937))
- Linux: close descriptor `0` on failed module file mapping when that descriptor was returned by `open`, avoiding a file descriptor leak. ([#1924](getsentry/sentry-native#1924))
- `sentry_attachment_set_filename`, `sentry_attachment_set_type`, and `sentry_attachment_set_content_type` now flush the scope, so changes applied after `sentry_attach_file`/`sentry_attach_bytes` also apply to hard-crash events instead of only to normal events. ([#1934](getsentry/sentry-native#1934))
- Crashpad: fix a crash when calling `sentry_init` before C++ dynamic initializers have run. ([#1930](getsentry/sentry-native#1930), [mini_chromium#8](getsentry/mini_chromium#8))
- Reduce the size of native-generated minidumps on Windows ([#1929](https://github.com/getsentry/sentry-native/pull/1929))</pre>
  <p>View the full release notes at <a href="https://github.com/getsentry/sentry-native/releases/tag/0.16.2">https://github.com/getsentry/sentry-native/releases/tag/0.16.2</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!16247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add before_send_feedback hook

3 participants