Sentry-javascript: Sentry says to the user that showReportDialog data has been sent when it wasn't

Created on 14 May 2019  路  6Comments  路  Source: getsentry/sentry-javascript

Package + Version

  • [x] @sentry/browser

Version:

5.2.1

Description

Consider an example code for manual issue reporting:

Sentry.showReportDialog({ eventId: window.Sentry.captureMessage('test') })

It shows the report dialog, the user fills the fields in, and then this is shown:

小薪懈屑芯泻 褝泻褉邪薪邪 2019-05-14 胁 6 05 04

User thinks that the report is submitted.

But in fact, nothing was sent anywhere, because at the very first step (during captureMessage) the POST request to https://sentry.io/api/***/store/ was blocked by uBlock with net::ERR_BLOCKED_BY_CLIENT, and Sentry wan't even able to detect that.

||sentry.io/api/*/store/? is in AdGuard Tracking Protection list (probably also some more).

Steps to Reproduce

  1. Add Sentry to an example webpage (client-side)
  2. Open it in Chrome, install uBlock with fairly default filters (AdGuard Tracking Protection).
  3. Try to use Sentry.showReportDialog (example code above), the same applies to example directly taken from https://docs.sentry.io/enriching-error-data/user-feedback/

What happens

The user is shown a confirmation that their report has been sent when it actually wasn't.

What you expected to happen

Either of the following:

  • the data should be actually sent,
  • the final message should indicate that the data could not be sent (not ideal)
  • the user should be warned at the very beginning that the report has been blocked by their browser setup

Possible Solution

Detect that the POST has failed and abort the report dialog, possibly replacing it with a corresponding message.


Could be related: https://github.com/getsentry/sentry/issues/2049, https://github.com/getsentry/sentry-javascript/issues/668, https://github.com/StevenBlack/hosts/issues/568

Needs Triage

Most helpful comment

@ChALkeR completely forgot that this feature even exist 馃槄thanks

All 6 comments

A work-around would be to wrap the code in fetch('https://sentry.io/api/1/store/?sentry_version=7').then(...) -- it resolves with a 4xx status if non blocked and rejects if blocked, but that solution is sub-ideal.

I contacted AdGuard support, they said that they removed the blocking rule, everything should work, check.

https://forum.adguard.com/index.php?threads/%D0%A0%D0%B5%D1%88%D0%B5%D0%BD%D0%BE-adguard-%D0%B1%D0%BB%D0%BE%D0%BA%D0%B8%D1%80%D1%83%D0%B5%D1%82-sentry-http-localhost-8080.34035/

@Libidine Thanks, but I don't think that's a reliable long-term solution.

Sentry should detect that sending did not work and show an error instead of "Your feedback has been sent".

User Feedback Dialog is created and handled in the main repository of Sentry, and SDK is only including it as an iframe, thus it cannot be fixed here.
Please report the issue there and cross-link it with this one. Thanks!

https://github.com/getsentry/sentry

ref: https://github.com/getsentry/sentry/blob/master/src/sentry/web/frontend/error_page_embed.py
ref: https://github.com/getsentry/sentry/blob/master/src/sentry/templates/sentry/error-page-embed.js

@kamilogorek Why not just transfer the issue into the corresponding repo in these cases?
But ok, I recreated it as https://github.com/getsentry/sentry/issues/14348, thanks.

@ChALkeR completely forgot that this feature even exist 馃槄thanks

Was this page helpful?
0 / 5 - 0 ratings