Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPLOAD-1409 - Enhanced error reporting #1665

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vojtech-cerveny
Copy link
Contributor

This pull request includes changes to enhance error reporting to Rollbar and update
Enhancements to error reporting:

  • app/actions/utils.js: Modified the sendToRollbar function to handle the case when rollbar is not defined, and improved the error reporting by merging additional properties into the reported error.

By merging ...props to extra, application send also data included in uploadErrProps

      let uploadErrProps = {
        details: err.message,
        utc: getUtc(utc),
        name: err.name || 'Uncaught or API POST error',
        step: err.step || null,
        datasetId: err.datasetId || null,
        requestTrace: err.requestTrace || null,
        sessionTrace: err.sessionTrace || null,
        code: err.code || errCode,
        version: version,
        data: recs,
        loggedInUser: loggedInUser,
        userEmail: userEmail,
        userName: name,
        os: os,
        device: driverId,
      };

During testing it, I tried to upload data without connecting device and I got this error on rollbar.

And as you can see, ticket has new params - custom params added by this PR.
new params

- adding extra information into custom.* property
Copy link
Member

@gniezen gniezen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of small changes requested.

app/actions/utils.js Outdated Show resolved Hide resolved
app/actions/utils.js Outdated Show resolved Hide resolved
@gniezen
Copy link
Member

gniezen commented Nov 22, 2024

@vojtech-cerveny I think we may need to be a bit more specific with which props we add. If the upload fails while uploading to the backend, I think there's a chance that the props will include all the data being sent (under props.data).

@vojtech-cerveny
Copy link
Contributor Author

Well, I would say that I am OK with all data except props.data.

Because we send different objects into this function
For example:

        let disconnectedErrProps = {
          utc: actionUtils.getUtc(utc),
          code: 'E_HID_CONNECTION',
          version: version,
          loggedInUser: loggedInUser,
          userEmail: userEmail,
          userName: name,
          os: os,
          device: driverId,
        };

and

      let uploadErrProps = {
        details: err.message,
        utc: getUtc(utc),
        name: err.name || 'Uncaught or API POST error',
        step: err.step || null,
        datasetId: err.datasetId || null,
        requestTrace: err.requestTrace || null,
        sessionTrace: err.sessionTrace || null,
        code: err.code || errCode,
        version: version,
        data: recs,
        loggedInUser: loggedInUser,
        userEmail: userEmail,
        userName: name,
        os: os,
        device: driverId,
      };

so my solution would be to just delete props.data, WDYT?

    const extra = { ...props };
    delete extra.data;

@gniezen
Copy link
Member

gniezen commented Nov 22, 2024

Yeah, I think that should be fine. I just did a test with Tandem where I made it fail during uploading to the backend and props.data included the raw packets, compressed binary blob, parsed records and raw records, so definitely exclude that one 😉

Copy link
Member

@gniezen gniezen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants