Skip to content

feat(replay): Add pauseTouchTracking and resumeTouchTracking - #7030

Draft
romtsn wants to merge 2 commits into
mainfrom
feat/replay-pause-touch-tracking
Draft

romtsn wants to merge 2 commits into
mainfrom
feat/replay-pause-touch-tracking

Conversation

@romtsn

@romtsn romtsn commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds pauseTouchTracking() and resumeTouchTracking() to the shared Replay interface. While touch tracking is paused, the native SDKs record no touch positions, but the masked screen recording continues. Breadcrumbs are not affected.

Sentry.getReplay()?.pauseTouchTracking(); // before showing the PIN pad
Sentry.getReplay()?.resumeTouchTracking(); // after it is hidden

This is a bridge only; the behavior lives in the native SDKs:

  • The flag is independent of pause()/resume(). resume() does not resume touch tracking.
  • Only resumeTouchTracking() clears it, also across new replays and stop()/start(). It can be called before a replay starts.

The calls are wired exactly like pause/resume: fire-and-forget through fireReplayControl → NATIVE.pauseReplayTouchTracking() / resumeReplayTouchTracking() → Sentry.replay().pauseTouchTracking() on Android and SentrySDK.internal.replay.pauseTouchTracking() on iOS. On Web they are logged no-ops, like pause().

Important

Blocked on native releases. The native code calls APIs from getsentry/sentry-java#6546 (merged, ships in sentry-android 8.65.0) and getsentry/sentry-cocoa#9587 (open, 9.35.0 at the earliest). The Android and iOS builds fail until both versions are bumped here.

Both new methods are required members of the public Replay interface, like pause/resume. Code that implements Replay itself must add them.

💡 Motivation and Context

Masking hides sensitive content such as a custom PIN pad or a masked WebView, but the recorded touch positions can still reveal the input. pause() already stops touches, but it also stops the screen recording, which some apps want to keep.

Fixes #6299
Fixes RN-673

Docs: getsentry/sentry-docs#20711

💚 How did you test it?

JS unit tests in mobilereplay.test.ts, browserReplay.test.ts and wrapper.test.ts (each method calls only its own native control, a failed call is logged, the calls do nothing when native is disabled or the method is missing). The Android RNSentryReplayControlTest and the iOS RNSentryReplayControlTests cover the new methods, but they can only run after the native bumps. The sample app's Playground tab has buttons for both methods.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

Bump sentry-android to 8.65.0 and sentry-cocoa to 9.35.0, then mark ready for review.

🤖 Generated with Claude Code

Bridge the native touch tracking pause to the shared Replay API, so apps can stop
recording touch positions on sensitive screens, such as a custom PIN pad, while the
masked screen recording continues. On Web the calls are logged no-ops, like pause().

Requires sentry-android 8.65.0 and sentry-cocoa 9.35.0.

Fixes RN-673

Fixes #6299

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 13, 2026

Copy link
Copy Markdown

RN-673

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(replay): Add pauseTouchTracking and resumeTouchTracking by romtsn and claude in #7030
  • build(deps): Bump addressable to 2.9.2 in macOS sample to resolve advisories by antonis and claude in #7029
  • chore(deps): bump addressable from 2.9.0 to 2.9.1 in /samples/react-native-tvos by dependabot in #7028
  • chore(deps): bump addressable from 2.9.0 to 2.9.1 in /samples/react-native-visionos by dependabot in #7026
  • chore(deps): bump addressable from 2.9.0 to 2.9.1 in /samples/react-native by dependabot in #7027
  • chore(deps): update Sentry Android Gradle Plugin to v6.27.0 by github-actions in #7025
  • build(deps): Bump basic-ftp to 6.2.6 to resolve DoS advisory by antonis and claude in #7024
  • build(deps): Bump fast-xml-parser to 5.12.0 to resolve ReDoS advisory by antonis and claude in #7022
  • chore(deps): bump node-forge from 1.4.2 to 1.4.3 by dependabot in #7023

🤖 This preview updates automatically when you update the PR.

@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 861699c

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.

Mobile App Session Replay: Ability to disable or mask touch capture per screen

1 participant