sentry-javascript: duplicate react error
From @nightnei on October 4, 2018 15:47
I use componentDidCatch to send error, like in the new documentation. But I receive 2 errors: one is from componentDidCatch and another is sent from somewhere another place. Can I disable autosend errors?
componentDidCatch(error, errorInfo) {
this.setState({ error });
Sentry.configureScope(scope => {
Object.keys(errorInfo).forEach(key => {
scope.setExtra(key, errorInfo[key]);
});
});
Sentry.captureException(error);
}
Copied from original issue: getsentry/sentry#10021
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (9 by maintainers)
From @kamilogorek on October 4, 2018 18:33
@nightnei do you use development mode by any chance?
https://docs.sentry.io/clients/javascript/integrations/react/
@htulipe whoops, it was there in the old docs – https://docs.sentry.io/clients/javascript/integrations/react/#expanded-usage 😅
Fixed it – https://github.com/getsentry/sentry-docs/pull/840
Thanks!
@crobinson42 It’s actually not a grouping problem, or a file naming problem, nor does it have to do with the OP’s react question. It is, rather, a race condition, which is an uncommon but inherent technical limitation of our current event ingestion architecture.
We can continue the conversation about your particular case in your support ticket, but just in case anyone else stumbles upon this issue:
If multiple events from what would be a new issue/group come in effectively simultaneously, they can end up not getting grouped, even though under normal circumstances they would. Because they are getting processed in parallel, and because they represent a never-seen-before issue, when each one checks the database to see if it belongs to a pre-existing group, they all come up empty. As a result, each one creates a new group for itself. It’s not until at least one lands in the database that subsequent events can group themselves with it.
In order to tell if this is what you’re dealing with, look for identical timestamps on the oldest event in each issue, consecutive or near-consecutive issue ids (in the URL of the issue details page), and identical hash values in the grouping info (turn on Early Adopter in your org settings, then scroll all the way to the bottom of the issue details page). At that point, your best bet is to merge the issues using the UI, which will not only eliminate the noise in your issue stream but also cause all future occurrences of that issue to group together.
Looks like this important piece of information is no longer in the documentation https://docs.sentry.io/platforms/javascript/react/