Description
Problem Statement
CaptureFeedback is a user facing (not just our users, but actually our users' user) method, where there is no way to validate successful capture right now.
Context
|
public static void CaptureFeedback(SentryFeedback feedback, Action<Scope> configureScope, SentryHint? hint = null) |
CaptureFeedback returns
void right now. There are multiple conditions why the SDK might fail to send the feedback
|
CaptureFeedback(feedback, clonedScope, hint); |
|
} |
|
catch (Exception e) |
|
{ |
|
_options.LogError(e, "Failure to capture feedback"); |
|
} |
|
if (string.IsNullOrEmpty(feedback.Message)) |
|
{ |
|
_options.LogWarning("Feedback dropped due to empty message."); |
|
return; |
|
} |
The feedback could be dropped and without reading the logs, users will never know that it happened.
Capturing the feedback ends with a call to CaptureEnvelope which does return a bool but that gets swallowed right now.
|
var attachments = hint.Attachments.ToList(); |
|
var envelope = Envelope.FromFeedback(evt, _options.DiagnosticLogger, attachments, scope.SessionUpdate); |
|
CaptureEnvelope(envelope); |
Proposal
Similar to how it is done in CaptureEvent calling CaptureFeedback should return the event ID.
|
try |
|
{ |
|
return DoSendEvent(@event, hint, scope); |
|
} |
|
catch (Exception e) |
|
{ |
|
_options.LogError(e, "An error occurred when capturing the event {0}.", @event.EventId); |
|
return SentryId.Empty; |
|
} |
This would allow
- Users to validate whether the event/feedback was actually sent
- Users to display the captured event ID to their users
Description
Problem Statement
CaptureFeedbackis a user facing (not just our users, but actually our users' user) method, where there is no way to validate successful capture right now.Context
sentry-dotnet/src/Sentry/SentrySdk.cs
Line 536 in dc2b326
CaptureFeedbackreturnsvoidright now. There are multiple conditions why the SDK might fail to send the feedbacksentry-dotnet/src/Sentry/Internal/Hub.cs
Lines 559 to 564 in dc2b326
sentry-dotnet/src/Sentry/SentryClient.cs
Lines 87 to 91 in dc2b326
The feedback could be dropped and without reading the logs, users will never know that it happened.
Capturing the feedback ends with a call to
CaptureEnvelopewhich does return aboolbut that gets swallowed right now.sentry-dotnet/src/Sentry/SentryClient.cs
Lines 114 to 116 in dc2b326
Proposal
Similar to how it is done in
CaptureEventcallingCaptureFeedbackshould return the event ID.sentry-dotnet/src/Sentry/SentryClient.cs
Lines 73 to 81 in dc2b326
This would allow