-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Add new User Feedback API #4286
base: main
Are you sure you want to change the base?
Conversation
Added Scopes.captureFeedback API Changed the MainActivity sample app to use the new API
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Add new User Feedback API ([#4286](https://github.com/getsentry/sentry-java/pull/4286)) If none of the above apply, you can opt out of this check by adding |
Performance metrics 🚀
|
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.
LGTM!
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
// Specs can be found at https://develop.sentry.dev/sdk/data-model/envelope-items/#user-feedback |
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.
nice!
@@ -160,7 +160,8 @@ private boolean shouldApplyScopeData(final @NotNull CheckIn event, final @NotNul | |||
scope != null ? scope.withSession((@Nullable Session session) -> {}) : null; | |||
@Nullable Session session = null; | |||
|
|||
if (event != null) { | |||
// Feedbacks shouldn't be sampled, and they don't affect sessions |
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.
Do we need to exclude it from beforeSend/EventProcessors and shall we apply the scope data? In web feedbacks I only see tags being applied, so I imagine everything else is redundant?
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.
After reading the internal thread, I'm thinking we should rather introduce a new method in SentryClient (captureFeedback
) that only does the necessary things for the feedback envelope item type, wdyt? Just to make it easier to distinguish
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.
agree, but i'll wait a little until docs are updated
captureFeedback does not update scope lastEventId anymore
SentryEvent event = new SentryEvent(); | ||
event.getContexts().setFeedback(feedback); | ||
|
||
return captureEvent(event, scope, hint); |
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've also read in the iOS docs that when feedback is capture, we also capture an ongoing replay. So I think you'd have to call options.getReplayController().captureReplay(false);
in the new captureFeedback
method.
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.
that one is talking about the UI widget, to capture the replay the makes the user send the feedback.
I don't think we should add it to the API itself, but only when using the widget (which will come later)
wdyt?
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.
hm, I'd expect it to work even if I had my own widget to submit feedbackv2 I guess... but that's another point to clarify and align on with other sdks maybe?
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.
Added it to the questions 👍
📜 Description
Added new User Feedback APIs (Sentry.captureFeedback)
Still need to add tests
💡 Motivation and Context
Implements #3614
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps