bugsnag / bugsnag-react-native

Error monitoring and reporting tool for native exceptions and JS errors in React Native apps
https://docs.bugsnag.com/platforms/react-native
MIT License
370 stars 121 forks source link

registerBeforeSendCallback doesn't respect an AsyncFunction object #422

Closed kennym closed 4 years ago

kennym commented 4 years ago

Description

      BugsnagConfiguration.registerBeforeSendCallback(async(report, error) => {
         return false
      }

This will run, and return false, but not cause the send to be prevented.

Environment

mattdyoung commented 4 years ago

Hi @kennym

Calling registerBeforeSendCallback with an async function is not currently supported. It should work if you remove async.

We are currently working on a significant rework of our React Native error reporting library though which will then re-use our Universal JS bugsnag-js library for the Javascript layer. As the Universal JS error reporting library does support async beforeSend functions, this will then allow it on React Native as well.

So this should be possible after the next major release.