Skip to content

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

Merged
antonis merged 4 commits into
mainfrom
feat/replay-pause-touch-tracking
Nov 26, 2026
Merged

antonis merged 4 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

@linear-code

linear-code Bot commented Nov 13, 2026

Copy link
Copy Markdown

RN-673

@github-actions

github-actions Bot commented Nov 13, 2026 •

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
  • chore(deps): update Cocoa SDK to v9.36.0 by github-actions in #7114
  • chore(deps): update Android SDK to v8.66.0 by github-actions in #7112
  • chore(tooling): Add iOS simulator support to the verify-pr skill by antonis and claude in #7104
  • chore(tooling): Add verify-pr skill for on-device PR verification by antonis and claude in #7100
  • test(e2e): Load the WebView demo's browser SDK asynchronously by antonis and claude in #7103
  • feat(ios): Attach a flame graph to JS hang events by alwx in #7042
  • fix(tracing): Sync the JS trace to the native SDKs after they start by RasmusKard in #7107
  • test(e2e): Fix flaky sample app E2E tests by antonis and claude in #7097
  • ci(ios): Build the SwiftPM app on more React Native versions by alwx in #7096
  • chore(tooling): Remove Cursor Bugbot review guidelines by antonis and claude in #7090
  • fix(core): Capture uncaught render errors on React Native 0.78+ by alwx in #7078
  • ci: Fix stale high_risk_code paths in file-filters by antonis and claude in #7091
  • ci(e2e): Fix legacy Android e2e jobs building New Architecture by antonis and claude in #7092
  • chore(deps): update Android SDK to v8.65.1 by github-actions in #7089
  • fix(core): Remove native scope tags set to an empty value by antonis and claude in #7087
  • feat(ios): Add metricKitHangReportingMode option for MetricKit hang flame graphs by alwx in #7059
  • chore(deps): bump getsentry/craft from 3.12.0 to 3.13.0 by dependabot in #7083
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 3.12.0 to 3.13.0 by dependabot in #7082
  • chore(deps): bump getsentry/github-workflows/danger from 6bf4a27612e388f9c113d64f75e25190e814b414 to bce11fe6eaa86dbb9d360ab45a96e659828877f0 by dependabot in #7081
  • chore(deps): bump actions/create-github-app-token from 3.3.0 to 3.4.0 by dependabot in #7085
  • chore(deps): bump ruby/setup-ruby from 1.338.0 to 1.342.0 by dependabot in #7084
  • chore(sample): Remove unused Detox setup from the React Native sample by antonis and claude in #7072
  • ci(ios): Build TestFlight sample with Xcode 27 by philprime with sentry-junior in #7065

Plus 4 more


🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against c4971ff

antonis added a commit that referenced this pull request Nov 26, 2026
From running the skill on open PRs (#7042, #7030): a "Not verifiable this
way" verdict decided before any build (build-only claims, triggers a
simulator can't produce, native APIs missing from the pinned SDK, low
disk), guidance for feature PRs and open PRs, checks for node_modules,
run tagging and spec codegen, release builds by default, and evidence
for replay recording content and JS-thread blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
antonis added a commit that referenced this pull request Nov 26, 2026
* chore(tooling): Add verify-pr skill for on-device PR verification

Adds a local skill that verifies a PR end to end on an Android emulator:
build the sample without and with the change, drive it with Maestro, find
both runs' events in sentry-sdks through the Sentry MCP, and write a draft
before/after report.

The sample tags events with verify.pr, verify.commit and verify.run_id
when launched with matching launch arguments, and does nothing otherwise.
It also enables logs in sentry.options.json, so native Android matches the
JS enableLogs setting.

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

* chore(tooling): Write verify-pr scenarios per run, not into the skill

Scenarios were one-off per PR and nothing runs them, so a shared folder
would grow and rot. Move the #7087 flow to flows/examples/ as the worked
example and regression check, write each run's flow next to its report,
and promote to flows/steps/ only when a second run needs it.

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

* chore(tooling): Add iOS simulator support to the verify-pr skill

From verifying #7087 and #6974 on the iOS simulator: Pods setup and the
files pod install rewrites, the iOS init path, Maestro differences (no
`back`, tab icons and the Playground tab need ids), reading screenshot
attachments back from Sentry, and a two-color probe for masking checks.

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

* chore(tooling): Fold iOS acceptance-run findings into verify-pr

Save the revert as a patch file, compare dist/ against packages/core/src,
define verify.commit for both sides, reinstall Pods every iOS run, shut
down booted devices, and keep attachment URLs out of reports.

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

* chore(sample): Add a screenshot masking probe to the Playground tab

A two-color view inside the existing <Sentry.Mask> demo, plus a button
that captures an exception with the demo on screen. The view is neither
text nor an image, so only <Sentry.Mask> can hide it in the event's
screenshot; a masked probe is one flat color. Used to verify #6974.

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

* chore(tooling): Add a pre-build gate and open-PR handling to verify-pr

From running the skill on open PRs (#7042, #7030): a "Not verifiable this
way" verdict decided before any build (build-only claims, triggers a
simulator can't produce, native APIs missing from the pinned SDK, low
disk), guidance for feature PRs and open PRs, checks for node_modules,
run tagging and spec codegen, release builds by default, and evidence
for replay recording content and JS-thread blocks.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@antonis

antonis commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Heads-up: the native side is now unblocked on both platforms. Android already bundles sentry-android 8.66.0 (it has pauseTouchTracking since 8.65.0), and #7114 bumps sentry-cocoa to 9.36.0, which ships getsentry/sentry-cocoa#9587. Once #7114 merges, a rebase on main should make the iOS and Android builds pass.

romtsn and others added 2 commits November 26, 2026 11:24
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@romtsn
romtsn force-pushed the feat/replay-pause-touch-tracking branch from 861699c to b18dbe8 Compare November 26, 2026 10:25
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • packages/core/src/js/NativeRNSentry.ts

romtsn and others added 2 commits November 26, 2026 11:28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • packages/core/src/js/NativeRNSentry.ts

@romtsn
romtsn marked this pull request as ready for review November 26, 2026 10:36
@romtsn
romtsn requested review from a team, alwx, antonis and lucas-zimerman as code owners November 26, 2026 10:36
@romtsn
romtsn requested review from 0xadam-brown, itaybre, markushi and philprime and removed request for a team November 26, 2026 10:36
@romtsn romtsn added the ready-to-merge Triggers the full CI test suite label Nov 26, 2026
@sentry

sentry Bot commented Nov 26, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.36.0 (116) Release

⚙️ sentry-react-native Build Distribution Settings

@antonis antonis left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the tests are 🟢

Tested this end to end on both platforms, and it works as described 🎉

Pause-button touches Resume-button touches Replay
Android, without the PR 6 6 517247a1
Android, with the PR 1 5 8823401f
iOS, without the PR 6 5* 765e64e4
iOS, with the PR 1 4* e680dda7

@antonis
antonis merged commit cc37a54 into main Nov 26, 2026
122 of 128 checks passed
@antonis
antonis deleted the feat/replay-pause-touch-tracking branch November 26, 2026 11:12
romtsn added a commit to getsentry/sentry-docs that referenced this pull request Nov 27, 2026
## DESCRIBE YOUR PR

Documents the new `pauseTouchTracking()` and `resumeTouchTracking()`
Session Replay APIs for Android, Apple, React Native and Flutter, in a
new "Pause Touch Tracking" section under "Manual Control" on each
Session Replay page. The APIs stop recording touches on sensitive
screens, such as a custom PIN pad, while the masked screen recording
continues.

SDK PRs:
- Android: getsentry/sentry-java#6546 (merged)
- Apple: getsentry/sentry-cocoa#9587
- React Native: getsentry/sentry-react-native#7030
- Flutter: getsentry/sentry-dart#4166

The version numbers in the text are the expected next releases: Android
8.65.0, Apple 9.35.0, React Native 8.36.0, Flutter 10.5.0. The hybrid
SDKs can only ship after the native releases, so their numbers are the
least certain. Please do not merge before all SDK PRs are released, and
update the numbers if the release versions differ.

## IS YOUR CHANGE URGENT?

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
supplied a deadline.

Thanks in advance for your help!

## PRE-MERGE CHECKLIST

_Make sure you've checked the following before merging your changes:_

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Antonis Lilis <antonis.lilis@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

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

2 participants