Skip to content

feat(feedback): Enrich user feedback with scope data#1915

Open
limbonaut wants to merge 4 commits into
masterfrom
limbonaut/feat/apply-scope-to-feedback
Open

feat(feedback): Enrich user feedback with scope data#1915
limbonaut wants to merge 4 commits into
masterfrom
limbonaut/feat/apply-scope-to-feedback

Conversation

@limbonaut

@limbonaut limbonaut commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Previously, user feedback was sent as a bare event payload carrying no scope data, so it had no trace tying it to errors from the same session, no release, environment, etc, which left Sentry defaulting the environment to production and mislabeling feedback coming from other builds. This PR applies the global scope to the feedback event before it is enveloped, so release, environment, tags, user, and contexts including the trace all come along. Breadcrumbs, modules, stacktraces, and scope attachments are deliberately left off.

It also fixes a pre-existing leak where capturing feedback before the SDK is initialized dropped the feedback value without releasing it.

Scope attachments are excluded from this change. The spec requires scope data, such as tags, user, trace, and contexts, to be included with feedback, but only says attachments MAY be sent. The spec doesn't explicitly forbid scope attachments either. Java/Android doesn't include scope attachments, but .NET and Cocoa do. So it seems that existing implementations drifted on this. Per-feedback attachments remain available via sentry_capture_feedback_with_hint.

@github-actions

github-actions Bot commented Jul 26, 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 b834d70

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.18919% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.64%. Comparing base (b5cd30f) to head (1073ed7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1915      +/-   ##
==========================================
- Coverage   75.71%   75.64%   -0.07%     
==========================================
  Files          93       93              
  Lines       22034    22052      +18     
  Branches     3925     3928       +3     
==========================================
- Hits        16682    16681       -1     
- Misses       4464     4488      +24     
+ Partials      888      883       -5     
🚀 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/apply-scope-to-feedback branch from 1073ed7 to b834d70 Compare July 26, 2026 13:56
Comment thread src/sentry_core.c
sentry__scope_apply_to_event(scope, options, event, SENTRY_SCOPE_NONE);
}

sentry_envelope_t *envelope = sentry__envelope_new();

@limbonaut limbonaut Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One decision point is whether to include scope attachments in user feedback. Currently, scope attachments are excluded from this change. The spec requires scope data, such as tags, user, trace, and contexts, to be included with feedback, but only says attachments MAY be sent. The spec doesn't explicitly forbid scope attachments either. Java/Android doesn't include scope attachments, but .NET and Cocoa do. So it seems that existing implementations drifted on this. Per-feedback attachments remain available via sentry_capture_feedback_with_hint.

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.

Apply relevant scope data to user feedback

1 participant