Skip to content

fix(replay): Forward Session Replay network detail options to native SDKs#6373

Draft
antonis wants to merge 5 commits into
mainfrom
fix/replay-forward-network-detail-options
Draft

fix(replay): Forward Session Replay network detail options to native SDKs#6373
antonis wants to merge 5 commits into
mainfrom
fix/replay-forward-network-detail-options

Conversation

@antonis

@antonis antonis commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Enhances the network detail capture for Mobile Session Replay (added in #6288) by forwarding the network-detail options into the native SentryReplayOptions on both platforms:

  • iOS (RNSentryReplay.mm): adds the keys to the sessionReplay dict; Cocoa's SentryReplayOptions(dictionary:) already parses them.
  • Android (RNSentryStart.getReplayOptions): reads the keys and calls the existing setNetworkDetail* setters.
  • JS (client.ts / mobilereplay.ts): RegExp allow/deny patterns can't cross the native bridge (they serialize to {}), so they are forwarded as their string source. JS-side matching in xhrUtils keeps using the original RegExp values in order to drive the frontend render signal.

💡 Motivation and Context

Follow-up to #6288

💚 How did you test it?

CI checks and tests, Manual

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
    • Capture remains opt-in via networkDetailAllowUrls (empty by default); auth-like headers are always stripped in the JS layer.
  • I updated the docs if needed
  • I updated the wizard if needed
  • All tests passing (JS + Android local; iOS via CI)
  • No breaking changes

🔮 Next steps

antonis and others added 2 commits June 29, 2026 14:18
…SDKs

Network detail capture for Mobile Session Replay is implemented in the JS
layer (xhrUtils enriches breadcrumbs), but the rrweb options event that
tells the Sentry frontend to render request/response bodies and headers is
emitted by the native SDKs from their SentryReplayOptions. RN never forwarded
the network detail config to native, so SentryReplayOptions.networkDetailAllowUrls
stayed empty, networkDetailHasUrls was false, and the frontend never rendered
the captured details.

Forward networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies,
networkRequestHeaders and networkResponseHeaders from mobileReplayOptions into
the native SentryReplayOptions on both platforms. RegExp allow/deny patterns
can't cross the native bridge, so they are forwarded as their string source;
JS-side matching in xhrUtils keeps using the original RegExp values.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@github-actions

github-actions Bot commented Jun 29, 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).


  • fix(replay): Forward Session Replay network detail options to native SDKs by antonis in #6373
  • feat(replay): Default networkCaptureBodies to true by alwx in #6372
  • chore(deps): bump getsentry/craft from 2.26.10 to 2.26.13 by dependabot in #6368
  • chore(deps): bump getsentry/github-workflows/danger from 17cc15eb58ea3687cd8f2714a4192dcee4aa09ef to 4013fc6e1aeb1be1f9d3b4d232624f0ec1afa613 by dependabot in #6366
  • chore(deps): bump getsentry/github-workflows/validate-pr from 71588ddf95134f804e82c5970a8098588e2eaecd to 4013fc6e1aeb1be1f9d3b4d232624f0ec1afa613 by dependabot in #6364
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.26.10 to 2.26.13 by dependabot in #6367
  • feat(core): Wire TurboModulePerfLogger on iOS and Android by alwx in #6307
  • chore(deps): bump actions/cache from 4 to 6 by dependabot in #6365
  • chore(deps): update CLI to v3.6.0 by github-actions in #6362
  • chore(deps): bump faraday from 1.10.5 to 1.10.6 in /samples/react-native by dependabot in #6363
  • chore(deps): update JavaScript SDK to v10.62.0 by github-actions in #6361
  • Expo Router ErrorBoundary auto wrapped by alwx in #6347
  • chore(ci): Move sample app iOS build jobs to GitHub Actions runners by itaybre in #6356
  • docs: Add missing 8.14.1 to changelog and SDK versions table by antonis in #6360
  • chore(deps): update Android SDK to v8.46.0 by github-actions in #6357
  • chore(ci): Move testflight and size-analysis iOS jobs to GitHub Actions macos-26 by itaybre in #6355
  • feat(core): Use native btoa for envelope base64 encoding by alwx in #6351

🤖 This preview updates automatically when you update the PR.

@antonis

antonis commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@sentry review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 47cb22d. Configure here.

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Jun 29, 2026
Allow-list the Spaceflight News API host and enable networkCaptureBodies so
the sample exercises request/response detail rendering in the Replay network
tab via the existing News screen.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@sentry

sentry Bot commented Jun 29, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-react-native Build Distribution Settings

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3815.83 ms 1207.09 ms -2608.75 ms
Size 4.98 MiB 6.51 MiB 1.53 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a858ac3+dirty 3836.62 ms 1222.56 ms -2614.06 ms
038a6d7+dirty 3849.69 ms 1228.40 ms -2621.28 ms
c2e182c+dirty 3848.40 ms 1211.79 ms -2636.61 ms
5748023+dirty 3840.49 ms 1227.43 ms -2613.05 ms
b0d3373+dirty 3831.75 ms 1227.29 ms -2604.46 ms
7887847+dirty 3849.83 ms 1227.35 ms -2622.48 ms
6177334+dirty 3834.85 ms 1217.58 ms -2617.28 ms
21a1e70+dirty 3834.15 ms 1218.43 ms -2615.73 ms
774257e+dirty 3846.90 ms 1215.02 ms -2631.88 ms
15d4514+dirty 3840.17 ms 1225.79 ms -2614.38 ms

App size

Revision Plain With Sentry Diff
a858ac3+dirty 4.98 MiB 6.51 MiB 1.53 MiB
038a6d7+dirty 5.15 MiB 6.70 MiB 1.55 MiB
c2e182c+dirty 4.98 MiB 6.50 MiB 1.52 MiB
5748023+dirty 5.15 MiB 6.68 MiB 1.53 MiB
b0d3373+dirty 5.15 MiB 6.68 MiB 1.53 MiB
7887847+dirty 4.98 MiB 6.46 MiB 1.48 MiB
6177334+dirty 5.15 MiB 6.68 MiB 1.53 MiB
21a1e70+dirty 4.98 MiB 6.46 MiB 1.49 MiB
774257e+dirty 5.15 MiB 6.70 MiB 1.54 MiB
15d4514+dirty 5.15 MiB 6.70 MiB 1.55 MiB

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3825.93 ms 1213.11 ms -2612.83 ms
Size 4.98 MiB 6.51 MiB 1.53 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a858ac3+dirty 3850.72 ms 1226.35 ms -2624.37 ms
a50b33d+dirty 1207.11 ms 1212.10 ms 5.00 ms
c2e182c+dirty 3841.76 ms 1220.76 ms -2621.01 ms
7436d0f+dirty 3861.51 ms 1231.07 ms -2630.44 ms
5a21b51+dirty 3837.87 ms 1223.47 ms -2614.40 ms
09a902f+dirty 3847.65 ms 1221.31 ms -2626.34 ms
ad66da3+dirty 3855.02 ms 1213.43 ms -2641.59 ms
eb93136+dirty 3846.51 ms 1226.13 ms -2620.39 ms
d2eadf8+dirty 3841.53 ms 1216.15 ms -2625.39 ms
1e5d96d+dirty 3845.93 ms 1222.51 ms -2623.42 ms

App size

Revision Plain With Sentry Diff
a858ac3+dirty 4.98 MiB 6.51 MiB 1.53 MiB
a50b33d+dirty 3.38 MiB 4.73 MiB 1.35 MiB
c2e182c+dirty 4.98 MiB 6.51 MiB 1.53 MiB
7436d0f+dirty 5.15 MiB 6.70 MiB 1.54 MiB
5a21b51+dirty 5.15 MiB 6.67 MiB 1.51 MiB
09a902f+dirty 4.98 MiB 6.46 MiB 1.49 MiB
ad66da3+dirty 5.15 MiB 6.67 MiB 1.51 MiB
eb93136+dirty 5.15 MiB 6.69 MiB 1.53 MiB
d2eadf8+dirty 5.15 MiB 6.67 MiB 1.51 MiB
1e5d96d+dirty 4.98 MiB 6.46 MiB 1.49 MiB

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 525.53 ms 585.46 ms 59.93 ms
Size 49.74 MiB 55.08 MiB 5.34 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
5569641+dirty 465.92 ms 532.22 ms 66.30 ms
3b6e9f9+dirty 442.39 ms 486.44 ms 44.05 ms
b04af96+dirty 430.33 ms 485.98 ms 55.65 ms
68ae91b+dirty 515.04 ms 578.08 ms 63.04 ms
f3215d3+dirty 396.53 ms 436.66 ms 40.13 ms
df5d108+dirty 434.82 ms 447.39 ms 12.57 ms
6176a94+dirty 403.58 ms 446.73 ms 43.15 ms
71abba0+dirty 411.04 ms 453.67 ms 42.63 ms
822d35b+dirty 472.69 ms 561.24 ms 88.56 ms
5a23c47+dirty 406.83 ms 451.47 ms 44.64 ms

App size

Revision Plain With Sentry Diff
5569641+dirty 48.30 MiB 53.48 MiB 5.18 MiB
3b6e9f9+dirty 48.30 MiB 53.54 MiB 5.23 MiB
b04af96+dirty 49.74 MiB 55.00 MiB 5.26 MiB
68ae91b+dirty 49.74 MiB 54.79 MiB 5.05 MiB
f3215d3+dirty 48.30 MiB 53.49 MiB 5.19 MiB
df5d108+dirty 43.94 MiB 48.94 MiB 5.00 MiB
6176a94+dirty 48.30 MiB 53.54 MiB 5.24 MiB
71abba0+dirty 48.30 MiB 53.49 MiB 5.19 MiB
822d35b+dirty 49.74 MiB 54.84 MiB 5.10 MiB
5a23c47+dirty 49.74 MiB 54.82 MiB 5.07 MiB

@github-actions

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 428.14 ms 455.83 ms 27.69 ms
Size 49.74 MiB 55.08 MiB 5.34 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
a3265b6+dirty 406.86 ms 449.84 ms 42.98 ms
20fbd51+dirty 487.89 ms 535.60 ms 47.71 ms
5ee78d6+dirty 551.80 ms 568.27 ms 16.47 ms
a50b33d+dirty 500.81 ms 532.11 ms 31.30 ms
7a89652+dirty 537.76 ms 567.84 ms 30.08 ms
09a902f+dirty 427.38 ms 473.80 ms 46.42 ms
68ae91b+dirty 416.44 ms 477.56 ms 61.12 ms
4b87b12+dirty 421.82 ms 413.60 ms -8.22 ms
23598c3+dirty 414.12 ms 426.24 ms 12.12 ms
71abba0+dirty 496.54 ms 525.16 ms 28.63 ms

App size

Revision Plain With Sentry Diff
a3265b6+dirty 48.30 MiB 53.58 MiB 5.28 MiB
20fbd51+dirty 49.74 MiB 54.81 MiB 5.07 MiB
5ee78d6+dirty 48.30 MiB 53.58 MiB 5.28 MiB
a50b33d+dirty 43.75 MiB 48.08 MiB 4.33 MiB
7a89652+dirty 48.30 MiB 53.60 MiB 5.30 MiB
09a902f+dirty 49.74 MiB 54.81 MiB 5.07 MiB
68ae91b+dirty 49.74 MiB 54.79 MiB 5.05 MiB
4b87b12+dirty 43.75 MiB 48.14 MiB 4.39 MiB
23598c3+dirty 43.75 MiB 48.16 MiB 4.41 MiB
71abba0+dirty 48.30 MiB 53.49 MiB 5.19 MiB

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.

1 participant