Skip to content

Conversation

@jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Feb 19, 2025

@jamescrosswell jamescrosswell marked this pull request as ready for review February 25, 2025 02:58
@bruno-garcia
Copy link
Member

Adding @aliu39 and @billyvg from the Replay team for review

<Label Text="Name" Margin="0,20,0,0" />
<Entry x:Name="NameEntry" Placeholder="Enter your name" />

<Button Text="Attach Screenshot" Clicked="OnAttachScreenshotClicked" Margin="0,20,0,0" />
Copy link
Member

Choose a reason for hiding this comment

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

Nice, we can use this to create a built-in Widget like @armcknight built for iOS

Or use bindings to use the native one. But with a MAUI implementation means we have it also on Windows and macOS

_options.LogInfo("Capturing event.");

var evt = new SentryEvent { Level = SentryLevel.Info };
evt.Contexts.Feedback = feedback;
Copy link
Member

Choose a reason for hiding this comment

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

I find this odd. Are we trying to find a way to attach the feedback to the event somehow?
Could the feedback inherit from SentryEvent instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not without changing all the other SDKs. This is just how the spec says we should be doing it.

@jamescrosswell jamescrosswell merged commit db56068 into main Mar 5, 2025
22 checks passed
@jamescrosswell jamescrosswell deleted the feedback branch March 5, 2025 05:22
@codecat
Copy link

codecat commented Mar 11, 2025

Can there be an Action<Scope> configureScope parameter on CaptureFeedback? The documentation even says:

In the following example we use the scope callback parameter that is available for all capture methods to attach a level and a tag to only one specific error:

@jamescrosswell
Copy link
Collaborator Author

Can there be an Action<Scope> configureScope parameter on CaptureFeedback? The documentation even says:

That particular example shows the CaptureException method... but yes, those docs do say the scope can be passed on all capture methods - so we should probably add this.

It's really just a convenience. As a workaround, in the meantime, the same can be achieved by:

        using (var scopeTracker = SentrySdk.PushScope())
        {
            SentrySdk.ConfigureScope(s =>
            {
                s.SetTag("my-tag", "my value");
                s.User = new SentryUser
                {
                    Id = "42",
                    Email = "[email protected]"
                };
            });
            var feedback = new SentryFeedback(message, contactEmail, name);
            SentrySdk.CaptureFeedback(feedback, hint: hint);
        }

Note that the temporary local scope gets popped when scopeTracker gets disposed above... so important to dispose of it before creating other events that you don't want that scope applied to.

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.

Support for Feedback Events Feedback captures are subject to sample rate

9 participants