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

Session replays recording while app is in background

Open hammoudma opened this issue 1 year ago • 6 comments

OS:

  • [ ] Windows
  • [ ] MacOS
  • [ ] Linux

Platform:

  • [x] iOS
  • [ ] Android

SDK:

  • [x] @sentry/react-native (>= 1.0.0)
  • [ ] react-native-sentry (<= 0.43.2)

SDK version: 8.33.0

react-native version: 0.74.0

Are you using Expo?

  • [ ] Yes
  • [x] No

Are you using sentry.io or on-premise?

  • [x] sentry.io (SaaS)
  • [ ] on-premise

Configuration:

(@sentry/react-native)

Sentry.init({
      dsn: SENTRY_DSN,
      environment: SENTRY_ENVIRONMENT,
      _experiments: {
        replaysSessionSampleRate: 0,
        replaysOnErrorSampleRate: 1.0
      },
      integrations: [
        Sentry.mobileReplayIntegration({
          maskAllText: false,
          maskAllImages: false
        })
      ]
    });

I have the following issue:

I am getting hours-long replay sessions of the app idling in the background. Is there a way to disable that? I am assuming that that is also happening when the app is open and then the screen is locked.

Expected result:

I only get replays of user sessions were the user is using the app.

hammoudma avatar Aug 26 '24 15:08 hammoudma

Hi @hammoudma,

thank you for the message,

could you describe more in detail, how to reproduce the behaviour?

I've tried to open our sample app, capture an error, lock the simulator screen and unlock it 10 minutes later, the replay shows the app was suspended for the 10 minutes.

krystofwoldrich avatar Aug 26 '24 16:08 krystofwoldrich

Hi @krystofwoldrich

Sorry I wasnt clear in the description, the replays I am getting are not of an error, they are just of the app idling for a long time.

Image

For example, is there a way to get rid of these or limit the recording time

hammoudma avatar Aug 27 '24 08:08 hammoudma

@hammoudma Thank you for the explanation. I understand now.

krystofwoldrich avatar Aug 27 '24 08:08 krystofwoldrich

@brustolin @romtsn Does the current Replay length limit includes the inactive/paused replay time?

krystofwoldrich avatar Aug 27 '24 08:08 krystofwoldrich

Technically, yes, but this should not happen. Once it goes into the background for more than 30 seconds, we should not consider it the same session.

brustolin avatar Aug 27 '24 08:08 brustolin

Bump cocoa when https://github.com/getsentry/sentry-cocoa/pull/4303 is released.

krystofwoldrich avatar Aug 30 '24 12:08 krystofwoldrich

RN https://github.com/getsentry/sentry-react-native/releases/tag/5.34.0 contains the https://github.com/getsentry/sentry-cocoa/pull/4303 fix.

The current latest RN SDK version is https://github.com/getsentry/sentry-react-native/releases/tag/6.2.0

krystofwoldrich avatar Nov 18 '24 15:11 krystofwoldrich