Skip to content

Commit

Permalink
UserReport: also route to Sentry
Browse files Browse the repository at this point in the history
## Why
Better search, viewing, alert.

## How
- Search: `_origin:/$/report`
- Full message will be located in the "extras" section of each entry.

## Flaws
The sentry version should not be considered the primary one since:
- ad-blockers block the packet
- sentry's own throttling will sometimes drop successive entries, even if they are distinct.

## Aside
Sentry has a formal crash report widget and different dashboard. But that takes a bit of effort and testing to set up, so just use the existing mechanism for now.

https://docs.sentry.io/platforms/javascript/enriching-events/user-feedback/?original_referrer=https%3A%2F%2Fdocs.sentry.io%2Fproduct%2Fuser-feedback%2F#embeddable-javascript-widget
  • Loading branch information
infinite-persistence committed Sep 28, 2023
1 parent 284ce89 commit 3e60c2a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/page/report/view.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import analytics from 'analytics';
import { doToast } from 'redux/actions/notifications';
import { FormField } from 'component/common/form';
import { Lbryio } from 'lbryinc';
Expand Down Expand Up @@ -33,6 +34,12 @@ class ReportPage extends React.Component {
window.app.store.dispatch(action);
});

analytics.log(message.length > 80 ? `${message.slice(0, 80)}…` : message, {
level: 'info',
tags: { origin: '/$/report' },
extra: { message: message },
});

this.setState({ message: '' });
}

Expand Down

0 comments on commit 3e60c2a

Please sign in to comment.