sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

[Session Replay][iOS] Errors from session didn't merge in one record

Open vladyslav-honchenko opened this issue 9 months ago • 6 comments

What React Native libraries do you use?

React Native without Frameworks, React Navigation, Hermes

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.7.0

How does your development environment look like?

OS: MacOS 15.3.2 Yarn: 1.22.22 Node: 20.17.0 RN: 0.71.12 React: 18.3.1 hermes: true new architecture: false

Sentry.init()

    Sentry.init({
      dsn,
      environment: env,
      enableNative: true,
      enableNativeCrashHandling: true,
      enabled: true,
      release,
      ignoreErrors: IGNORE_ERRORS,
      dist,
      tracesSampleRate: 0.1,
        integrations: [
          Sentry.mobileReplayIntegration({
            maskAllText: false,
          }),
        ],
      replaysSessionSampleRate: 1.0,
      replaysOnErrorSampleRate: 1.0,
})
  AppRegistry.registerComponent('react_app', () => {
    // Have to call before Sentry.wrap!
    SentryHelper.setup(); <-------- here call Sentry.init
    //@ts-ignore
    return CodePush(codePushOptions)(Sentry.wrap(withPendoRN(App, null)));
  });

Steps to Reproduce

  1. Just add throw new Error('Some text') in some places of your code in some handlers for raising error. Click these handlers for raising error and look at Sentry replay.

Expected Result

All errors should be merged in 1 record as on Android now

Image

Actual Result

For iOS all errors are separate.

Image

vladyslav-honchenko avatar Mar 18 '25 17:03 vladyslav-honchenko

Hi @vladyslav-honchenko, thank you for the message,

is the throw new Error('Some text') unhandled and crashes the application, or do you catch it and call Sentry.captureException?

Do you observe this in the debug build with the metro dev server, in the release, or both?

krystofwoldrich avatar Mar 19 '25 10:03 krystofwoldrich

Hi @vladyslav-honchenko, thank you for the message,

is the throw new Error('Some text') unhandled and crashes the application, or do you catch it and call Sentry.captureException?

Do you observe this in the debug build with the metro dev server, in the release, or both?

@krystofwoldrich

  1. "is the throw new Error('Some text') unhandled and crashes the application" - unhandled and crashes the application
  2. Do you observe this in the debug build with the metro dev server - yes, Session Replay is not in prod we are on develop stage
  const onItemPressed = useCallback((): void => {
    // Sentry.nativeCrash();

    if (OHSelectedOrderId !== order.id) {
      getOrderDetails(order.id);
      throw new Error(
        'Error when try to go to NEW UpdateOrderHistoryDetails',
      );
    }

vladyslav-honchenko avatar Mar 19 '25 14:03 vladyslav-honchenko

@vladyslav-honchenko thanks for the details, we'll look into this!

romtsn avatar Mar 19 '25 16:03 romtsn

@romtsn Hello. Do you have an estimation or priority of this bugfix? Did you have a chance to reproduce it? If you have any questions, please tag me. This bug is actual even in 6.10.0. I have checked it.

vladyslav-honchenko avatar Mar 31 '25 14:03 vladyslav-honchenko

@vladyslav-honchenko sorry I haven't had time to look into this, but it's on my list for this week. I will tag you if anything comes up, thanks!

romtsn avatar Mar 31 '25 15:03 romtsn

This happens when the uncaught JS error doesn't crash the RN application, by default this happens in development builds.

In production this is not an issue unless the default behavior is changed and uncaught JS errors are not crashing the RN app.

krystofwoldrich avatar Jun 11 '25 13:06 krystofwoldrich

This happens when the uncaught JS error doesn't crash the RN application, by default this happens in development builds.

In production this is not an issue unless the default behavior is changed and uncaught JS errors are not crashing the RN app.

Closing this, as it is non-actionable for now. Feel free to leave a comment, and we’ll be happy to iterate on it 🙇

antonis avatar Nov 18 '25 12:11 antonis