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

react native session replay causes very noticeable screen freezing once every second

Open bj97301 opened this issue 1 month ago • 10 comments

What React Native libraries do you use?

Expo (mobile only)

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

"^7.7.0"

How does your development environment look like?

npx react-native@latest info
info Fetching system and libraries information...
System:
  OS: macOS 26.1
  CPU: (20) arm64 Apple M1 Ultra
  Memory: 3.29 GB / 128.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.19.4
    path: ~/.nvm/versions/node/v20.19.4/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v20.19.4/bin/yarn
  npm:
    version: 11.6.2
    path: ~/.nvm/versions/node/v20.19.4/bin/npm
  Watchman:
    version: 2024.10.21.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.1
      - iOS 26.1
      - macOS 26.1
      - tvOS 26.1
      - visionOS 26.1
      - watchOS 26.1
  Android SDK:
    API Levels:
      - "30"
      - "31"
      - "32"
      - "33"
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 27.0.3
      - 28.0.3
      - 29.0.3
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 32.0.0
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-UpsideDownCake-ext5 | Google APIs ARM 64 v8a
      - android-UpsideDownCake-ext5 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2513.14007798
  Xcode:
    version: 26.1.1/17B100
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.7
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/Bryan/.rvm/rubies/ruby-2.7.6/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.2
    wanted: ^20.0.2
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.5
    wanted: 0.79.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.82.1 is now available (your project is running on v0.79.5).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.82.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.79.5&to=0.82.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".




Sentry.init()

Sentry.init({
  dsn: 'https://[email protected]/...'
   tracesSampleRate: 1.0,
    enabled: true,
    debug: environmentConfigs.isProduction(),
    environment: environmentConfigs.environment,
    dist: Platform.OS,
    normalizeDepth: 0,
    replaysSessionQuality: 'low', // i also tried the v2 stuff but no luck still freezes my screen once every second
    replaysSessionSampleRate: 0.1,
    replaysOnErrorSampleRate: 1,
    integrations: [
      Sentry.mobileReplayIntegration({
        maskAllText: false,
        maskAllImages: false,
        maskAllVectors: false,
      }),
      Sentry.userInteractionIntegration(),
    ],
})

Steps to Reproduce

  1. enable replays
  2. scroll

Expected Result

scrolls smoothly

Actual Result

freezes every second

bj97301 avatar Dec 03 '25 20:12 bj97301

RN-415

linear[bot] avatar Dec 03 '25 20:12 linear[bot]

Thank you for reporting @bj97301 🙇 Do you observe the delay on both iOS and Android? Is this reproduced both on development and release builds? Could you also share your project dependencies (package.json) to investigate possible conflicts that may cause the observed behavior?

antonis avatar Dec 04 '25 08:12 antonis

Thank you for reporting @bj97301 🙇 Do you observe the delay on both iOS and Android? Is this reproduced both on development and release builds? Could you also share your project dependencies (package.json) to investigate possible conflicts that may cause the observed behavior?

Yes both but on android it's more of a massive performance hit rather then freezing every second.

Both dev and prod builds. Dev builds are less performant as expected.

I will work on the package in a bit. You just want to see dependencies?

bj97301 avatar Dec 04 '25 14:12 bj97301

You just want to see dependencies?

Ideally we would like a minimal repro but the list of dependencies might help us reproduce the issue.

antonis avatar Dec 04 '25 15:12 antonis

You just want to see dependencies?

Ideally we would like a minimal repro but the list of dependencies might help us reproduce the issue.

Dependencies:

 "dependencies": {
    "@clerk/clerk-expo": "^2.10.1",
    "@convex-dev/rate-limiter": "^0.2.6",
    "@expo-google-fonts/roboto-mono": "^0.4.1",
    "@expo/vector-icons": "^14.1.0",
    "@miblanchard/react-native-slider": "^2.6.0",
    "@openspacelabs/react-native-zoomable-view": "^2.1.1",
    "@react-native-async-storage/async-storage": "2.1.2",
    "@react-native-community/netinfo": "11.4.1",
    "@react-native-masked-view/masked-view": "0.3.2",
    "@reduxjs/toolkit": "^2.9.0",
    "@sentry/react-native": "^7.7.0",
    "@shopify/react-native-skia": "2.2.4",
    "buffer": "^6.0.3",
    "convex": "^1.28.0",
    "crypto-es": "^3.1.2",
    "expo": "~53.0.23",
    "expo-application": "~6.1.5",
    "expo-auth-session": "~6.2.1",
    "expo-battery": "~9.1.4",
    "expo-blur": "~14.1.5",
    "expo-camera": "~16.1.11",
    "expo-clipboard": "~7.1.5",
    "expo-constants": "~17.1.7",
    "expo-crypto": "~14.1.5",
    "expo-dev-client": "^5.2.4",
    "expo-device": "~7.1.4",
    "expo-file-system": "~18.1.11",
    "expo-font": "~13.3.2",
    "expo-haptics": "~14.1.4",
    "expo-keep-awake": "~14.1.4",
    "expo-linear-gradient": "~14.1.5",
    "expo-localization": "~16.1.6",
    "expo-location": "~18.1.6",
    "expo-navigation-bar": "~4.2.8",
    "expo-notifications": "~0.31.4",
    "expo-screen-orientation": "~8.1.7",
    "expo-secure-store": "~14.2.4",
    "expo-splash-screen": "~0.30.10",
    "expo-status-bar": "~2.2.3",
    "expo-system-ui": "~5.0.11",
    "expo-updates": "~0.28.17",
    "expo-web-browser": "~14.2.0",
    "js-sha256": "^0.11.0",
    "jsurl": "^0.1.5",
    "lodash": "^4.17.21",
    "nativewind": "^2.0.11",
    "react": "19.0.0",
    "react-dom": "19.0.0",
    "react-native": "0.79.5",
    "react-native-ble-plx": "^3.5.0",
    "react-native-dialog": "^9.3.0",
    "react-native-error-boundary": "^1.2.3",
    "react-native-event-listeners": "^1.0.7",
    "react-native-gesture-handler": "~2.24.0",
    "react-native-json-tree": "^1.3.0",
    "react-native-reanimated": "~3.19.1",
    "react-native-safe-area-context": "5.4.0",
    "react-native-svg": "15.11.2",
    "react-native-tcp-socket": "^6.3.0",
    "react-native-toast-message": "^2.2.0",
    "react-native-uuid": "^2.0.1",
    "react-redux": "^9.2.0",
    "with-react-native-tcp-socket": "^1.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.28.5",
    "@babel/preset-env": "^7.26.9",
    "@edge-runtime/vm": "^5.0.0",
    "@react-native-community/cli": "^20.0.2",
    "@sentry/cli": "^2.58.2",
    "@testing-library/jest-native": "^5.4.2",
    "@testing-library/react-native": "^13.3.3",
    "@types/jest": "^30.0.0",
    "@types/node": "^24.5.2",
    "@typescript-eslint/eslint-plugin": "^8.40.0",
    "@typescript-eslint/parser": "^8.40.0",
    "convex-test": "^0.0.38",
    "eslint": "^9.25.1",
    "eslint-config-prettier": "10.1.8",
    "eslint-config-standard-with-typescript": "^34.0.1",
    "eslint-import-resolver-typescript": "^4.4.3",
    "eslint-plugin-import": "^2.31.0",
    "eslint-plugin-import-x": "^4.15.1",
    "eslint-plugin-n": "^17.23.1",
    "eslint-plugin-prefer-arrow": "^1.2.3",
    "eslint-plugin-prefer-let": "^4.0.0",
    "eslint-plugin-promise": "^7.2.1",
    "eslint-plugin-react": "^7.37.5",
    "eslint-plugin-react-hooks": "^5.2.0",
    "eslint-plugin-react-native": "^5.0.0",
    "eslint-plugin-unused-imports": "^4.1.4",
    "jest": "29.3.1",
    "jest-cli": "^29.7.0",
    "jest-expo": "~53.0.10",
    "prettier": "^3.6.2",
    "prettier-plugin-tailwindcss": "^0.6.14",
    "tailwindcss": "3.3.2",
    "typescript": "~5.8.3",
    "typescript-eslint": "^8.31.0"
  },

Let me know if you need anything else. I can pm you a video as well if that helps just dont want to post it publically so i dont get random customers spamming me on git when they find out i made the app.

bj97301 avatar Dec 04 '25 16:12 bj97301

Thank you @bj97301 🙇 Yes a video or a minimal repo would be ideal.

Some notes on the dependencies:

  • I noticed in the dependency list that you are using react-native-skia. Is your app intense on graphics?
  • @convex-dev/rate-limiter could you disable rate limiting and see if the problem persist?
  • @react-native-masked-view/masked-view could you temporarily disable masking and see if the problem persist? Though masking is disabled in your Sentry init configuration I suspect that the two functionalities might interfere.

antonis avatar Dec 05 '25 09:12 antonis

I’d be happy to send the video. Do you have a preferred way to message you privately? I don’t think GitHub allows PMs, unfortunately. I can use the contact form on your website if that works for you, or I can share my email with you.

  • Parts of the app are fairly graphically intensive, but performance is very good before enabling replays
  • The rate limiter shouldn’t affect anything — I never interact with it when reproducing the freezing
  • masked-view is purely a UI effect and doesn’t handle sensitive data. I disabled it, and the issue persists

bj97301 avatar Dec 05 '25 19:12 bj97301

Do you have a preferred way to message you privately?

If you are using Discord you can dm me (antonis.lilis) or reach us here or at Sentry Discord https://discord.gg/sentry

antonis avatar Dec 09 '25 09:12 antonis

Will do. Sory for the late reply been very sick.

bj97301 avatar Dec 12 '25 17:12 bj97301

Thank you @bj97301 🙇 I hope you fully recover soon.

antonis avatar Dec 15 '25 08:12 antonis

Thank you for sharing your recordings @bj97301 🙇 After looking at those I think this is a known issue. We are working on improving the session replay performance (eg) but we do not have an immediate solution for this yet.

I'll close this issue for now as duplicate and track the progress on this older issue. Feel free to comment if this is not the case.

antonis avatar Dec 16 '25 08:12 antonis