Watts-Lab / deliberation-empirica

Empirica V2 framework
MIT License
6 stars 0 forks source link

Customize User Feedback Form from Sentry #132

Open kepstein23 opened 2 years ago

kepstein23 commented 2 years ago

We added client-side bug reporting in #12 using Sentry's built in user feedback report dialog.

As a researcher, I want to protect participant's privacy by not collecting name or email. As a developer, I want to collect user feedback reports with a fully customizable component.

As of now, there is no way to turn off email validation for the email field in Sentry's user feedback form. See closed issue here: https://github.com/getsentry/sentry/issues/4646

There is also no way to change the default email text to be blank. See issue here: https://github.com/getsentry/sentry/issues/14682

An option to fix these problems are to create our own custom user feedback form that gets sent through sentry. See relevant sources on how to do this: https://github.com/getsentry/sentry-javascript/issues/3111 https://docs.sentry.io/api/projects/submit-user-feedback/ And Sentry's implementation for guidance: https://github.com/getsentry/sentry/blob/86fed44b9edffcd4a6f2398368ba4e4a0112e05e/src/sentry/web/frontend/error_page_embed.py#L49-L58 The onLoad field in Sentry.showReportDialog may be useful here as well.

Another potential solution that avoids creating a custom component, is if Sentry creates a way to override onSubmit, so that we can override the error thrown if the user inputs an invalid email address. See open issue for this here: https://github.com/getsentry/sentry-javascript/issues/3326

For reference, the interface for the report dialog can be found here: https://github.com/getsentry/sentry-javascript/blob/b7baedd9/packages/browser/src/client.ts#L30

JamesPHoughton commented 6 months ago

https://docs.sentry.io/platforms/javascript/user-feedback/