-
-
Notifications
You must be signed in to change notification settings - Fork 225
CaptureFeedback now returns a SentryId #4613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: version6
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## version6 #4613 +/- ##
===========================================
Coverage ? 73.08%
===========================================
Files ? 480
Lines ? 17394
Branches ? 3434
===========================================
Hits ? 12713
Misses ? 3821
Partials ? 860 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This looks great from the SDK for Unity POV. |
Sentry.SentryStructuredLogger Logger { get; } | ||
void BindException(System.Exception exception, Sentry.ISpan span); | ||
Sentry.SentryId CaptureEvent(Sentry.SentryEvent evt, System.Action<Sentry.Scope> configureScope); | ||
Sentry.SentryId CaptureEvent(Sentry.SentryEvent evt, Sentry.SentryHint? hint, System.Action<Sentry.Scope> configureScope); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Is it worth considering having more returns of SentryId
... potentially in a follow-up issue/PR?
CaptureTransaction
CaptureSession
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Those methods aren't user facing (they're SDK user facing). This method is an exception in that there will be some UI around it in the app and so some feedback is required for the actual user (not just the SDK user).
Certainly nobody has ever asked for this...
src/Sentry/CaptureFeedbackResult.cs
Outdated
public SentryId EventId; | ||
|
||
/// <inheritdoc cref="CaptureFeedbackErrorReason"/> | ||
public CaptureFeedbackErrorReason? ErrorReason; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: Nullable<T>
vs non-nullable
I am a bit hesitant about a Nullable<enum>
.
I'm thinking about having an additional 0
value in the enum, like None
.
Or alternatively something like Done
or Succeeded
and calling the enum
instead CaptureFeedbackStatus
.
Similar to
- https://learn.microsoft.com/dotnet/api/system.buffers.operationstatus
- https://learn.microsoft.com/dotnet/api/system.threading.tasks.taskstatus
I do prefer the latter ... but personal preference ... I'm convincible 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that but it means we have to do weird stuff like this in one of the constructors:
public CaptureFeedbackResult(CaptureFeedbackResultStatus resultStatus)
{
if (resultStatus == CaptureFeedbackResultStatus.Success)
{
throw new ArgumentException("Use alternate constructor to indicate success.", nameof(resultStatus));
}
EventId = SentryId.Empty;
ResultStatus = resultStatus;
}
I think that's just as messy personally. I don't think the current design is any better or worse than the alternatives then.
Note
This is one good use case for a Nominal Discriminating Union... but we don't have those yet.
SentrySdk.CaptureFeedback
now returns aCaptureFeedbackResult
that returns:SentryId.Empty
and an error code (if the call fails)Resolves #4319
CaptureFeedback
#4319