Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

Resolves getsentry/sentry-unity#2510

Without the enricher, User Feedback is lacking environment and release.

Screenshot 2026-01-30 at 14 32 02

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.83%. Comparing base (f2ea5c4) to head (c3608ac).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4883      +/-   ##
==========================================
- Coverage   73.84%   73.83%   -0.01%     
==========================================
  Files         483      483              
  Lines       17577    17578       +1     
  Branches     3464     3464              
==========================================
- Hits        12979    12978       -1     
- Misses       3742     3743       +1     
- Partials      856      857       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +1009 to +1013
// Act
sut.CaptureFeedback(feedback);

// Assert
var item = envelope.Items.First(x => x.TryGetType() == EnvelopeItem.TypeValueFeedback);
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: assert result

Would you mind also asserting the resulting ID not to be SentryId.Empty, for consistency with the other CaptureFeedback tests.

Suggested change
// Act
sut.CaptureFeedback(feedback);
// Assert
var item = envelope.Items.First(x => x.TryGetType() == EnvelopeItem.TypeValueFeedback);
// Act
var result = sut.CaptureFeedback(feedback);
// Assert
result.Should().NotBe(SentryId.Empty);
var item = envelope.Items.First(x => x.TryGetType() == EnvelopeItem.TypeValueFeedback);

Comment on lines 1273 to 1275
Replace your usage of `WithScope` with overloads of `Capture*` methods:

- `SentrySdk.CaptureEvent(SentryEvent @event, Action<Scope> scopeCallback)`
Copy link
Member

Choose a reason for hiding this comment

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

praise: thanks for the cleanup 🥔

// Evaluate and copy before invoking the callback
scope.Evaluate();
scope.Apply(evt);
_enricher.Apply(evt);
Copy link
Member

Choose a reason for hiding this comment

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

question: more than environment and release

More than environment and release are applied ... is this intended?

Comment on lines 110 to +111
scope.Apply(evt);
_enricher.Apply(evt);
Copy link
Member

Choose a reason for hiding this comment

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

question: precedence

Is the order of first applying the Scope, and then the Event-Enricher correct?
Or should instead e.g. Tags on the Scope overwrite Default-Tags from the Enricher?

On the other hand, this question would then similarly apply to e.g. Transactions, too, wouldn't it?
And changing the order the could be considered a behavioral breaking change ... or maybe a fix?

On the other hand ... we could just let "local consistency" win and do it as you suggested.
What are your thoughts?

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.

Environment not applied to User Feedback

3 participants