Skip to content

feat(sentry): enable on-error mobile session replay#7499

Open
hawkrives wants to merge 1 commit into
masterfrom
claude/sentry-mobile-replay
Open

feat(sentry): enable on-error mobile session replay#7499
hawkrives wants to merge 1 commit into
masterfrom
claude/sentry-mobile-replay

Conversation

@hawkrives

Copy link
Copy Markdown
Member

Follow-up to #7464. Enables Sentry's mobile session replay on errors only, with aggressive masking.

What

Adds mobileReplayIntegration. When an error is captured, Sentry uploads a short video of the frames leading up to it — useful for reproducing UI-state-dependent bugs that don't surface from the stack trace alone.

Privacy / bandwidth posture

This is the reason this PR is separated out from #7497 and #7498.

  • replaysSessionSampleRate: 0no blanket session recording. A replay is only produced if an error happens.
  • replaysOnErrorSampleRate: 0.1 — 10% of error-containing sessions are recorded. Easy to tune up once we have a feel for volume and signal.
  • maskAllText: true, maskAllImages: true, maskAllVectors: true — every text node, image, and SVG is blurred in the recording. These match the library defaults but are spelled out so the privacy choice is visible at the call site.

Verification before merging

Because replay ships screen recordings of real users, please don't merge without a manual pass on TestFlight:

  • Trigger the debug "Send Exception" in Settings → Developer → Sentry event.
  • Open the resulting replay in the Sentry UI.
  • Confirm no text, image, or avatar renders through unmasked. In particular eyeball:
    • Directory / contact list cells
    • Dining menu items
    • Course catalog search results
    • Any screen showing a logged-in user's name or email

If anything leaks, we have two escape hatches:

  • Per-element masking: wrap the view in <Sentry.Mask>.
  • Per-screen opt-out: drop the screen class into excludedViewClasses on iOS.

Why stacked on the v8 branch

mobileReplayIntegration only exists in @sentry/react-native v8+, so this PR targets renovate/sentry-react-native-8.x. Will auto-retarget master once #7464 merges.

Test plan

  • mise run tsc passes
  • mise run lint passes
  • mise run pretty:check passes
  • mise run test passes (36 suites, 197 passing)
  • Manual masking check on TestFlight (see above).

Adds `mobileReplayIntegration` so when an error is reported, Sentry
also uploads a short replay of the frames leading up to it. Useful
for reproducing UI-state-dependent bugs.

Privacy posture:
- `replaysSessionSampleRate: 0` — no blanket session recording.
- `replaysOnErrorSampleRate: 0.1` — 10% of error-containing sessions
  are recorded. Tune up once we have a feel for volume / signal.
- All masking options (`maskAllText`, `maskAllImages`, `maskAllVectors`)
  are passed explicitly as `true`, matching the defaults. They're
  spelled out so the privacy choice is visible at the call site.

Still worth eyeballing a test recording in TestFlight before rolling
to production — if any text or avatars slip through masking we'll
either need to tighten per-view masks (`<Mask>`) or disable for the
offending screens.
@hawkrives hawkrives requested review from drewvolz and rye as code owners April 14, 2026 13:25
Base automatically changed from renovate/sentry-react-native-8.x to master April 14, 2026 13:33
@hawkrives hawkrives enabled auto-merge April 15, 2026 03:48
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.

3 participants