question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can't see the submitted user feedback in my project

See original GitHub issue

I am using ReactJS to set up the user feedback for Sentry.

I initialize it with:

import Raven from 'raven-js';

Raven.config(https://#########@sentry.io/#######, {
  environment: "development",
}).install();

And used the componentDidCatch in ErrorBoundary(https://reactjs.org/docs/error-boundaries.html) concept to show the report dialog.

componentDidCatch(error, info) {
    this.setState({ hasError: true });
    Raven.captureException(error, { extra: info });
    Raven.showReportDialog();
}

When I submit the dialog, the network shows me a POST request with a 200 Response and a confirmation dialog that it was successful. However, the body is empty and the submitted form can’t be seen in the user feedback section of my project on my sentry account.

The behavior looks as seen on this site: https://wiggly-power.glitch.me/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilogorekcommented, Jul 20, 2018

@kerwin-personalyze there are 2 issues with the code.

  1. You are using the development version of React, which has known “issue” (they say it’s feature, but plenty of people think of it as unexpected behavior), which rethrows all errors, even those caught by error boundaries, to the global error handler.

  2. Because of this, you are calling showReportDialog with incorrect eventId, as it’s getting overridden by the second react error (which is not sent to Sentry, as it’s a duplicate, and we dedup exactly same errors)

Captured event: screen shot 2018-07-20 at 10 03 37

Dialog call: screen shot 2018-07-20 at 10 03 54

If you’ll use production bundle, it’ll fix itself.

You are also calling showReportDialog() in one place and captureException in other. It can make it use incorrect eventId if any error happens in between. It’s better to store an eventId that you want and pass it directly.

Raven.captureException(new Error('boom'));
var eventId = Raven.lastEventId();

...

Raven.showReportDialog({ eventId: eventId });

Keep in mind that your componentDidCatch is called second, not first (hello again react), so eventId that you see being sent to Sentry in network tab actually comes from global error handler.

0reactions
nabeelsuspgcommented, Aug 5, 2021

@kamilogorek I am having the same issue. In my case sentry API in the browser network tab has the correct event id but my componentDidCatch method gives me the wrong eventID. Following is my code:

componentDidCatch(error, errorInfo) {
    // eslint-disable-next-line no-console
    console.log({ error, errorInfo });
    Sentry.withScope((scope) => {
      scope.setExtras(errorInfo);
      const event = Sentry.captureException(error);
      const eventId = Sentry.lastEventId();
      console.log("Sentry.lastEventId()", eventId, event)
      this.setState({ eventId, errorInfo });
    });
  }

Please suggest a way forward.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to view feedback - Pearson MyITLab Office 2016 - YouTube
When completing the Grader Project in MyITLab by Pearson you can view submissions in any of the ... Your browser can't play this...
Read more >
What to Do When Users Can't Submit Feedback - Help Center
Click Management>Project Configuration>Feedback Types in the upper navigation bar; Hover over your Feedback Type; Click Modify pencil; Click Workflow; Identify ...
Read more >
What is the timeline for Project Review, and how to view the ...
In the Review tab, you can see the feedback from your reviewer. And in the History tab, you can see your previous feedback...
Read more >
Submitting & Managing Feedback - Qualtrics
In your Qualtrics account, navigate to the Projects page. · Click the folder icon. · Go to the Shared with me folder. ·...
Read more >
How to track and manage customer feedback - Asana
If you want to track only the feedback for specific features, products, etc. create a project for each so feedback goes to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found