Skip to content

fix(android): Handle boolean values in JSON options converter#6130

Open
antonis wants to merge 2 commits into
mainfrom
fix/json-converter-boolean-values
Open

fix(android): Handle boolean values in JSON options converter#6130
antonis wants to merge 2 commits into
mainfrom
fix/json-converter-boolean-values

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented May 11, 2026

📢 Type of change

  • Bugfix

📜 Description

RNSentryJsonConverter.convertToWritable() did not handle Boolean values when converting sentry.options.json to a React Native ReadableMap. Boolean values were silently dropped because the instanceof chain only checked for Float, Double, Number, String, JSONObject, JSONArray, and null.

This caused all boolean options to fall back to their defaults when using the RNSentrySDK.init() native-first initialization path.

💡 Motivation and Context

Fixes #6122

When users set maskAllText: false (or other boolean replay options) in sentry.options.json and initialize via RNSentrySDK.init(), the false value was dropped. The SDK then treated the missing key as true (mask everything), making it impossible to disable text masking through the JSON config.

This affects all boolean options read from sentry.options.json, not just replay masking — including debug, attachScreenshot, attachViewHierarchy, enableCaptureFailedRequests, spotlight, etc. However, the impact is limited because most boolean options default to sensible values when missing, and the JS-side Sentry.init() options (which go through the React Native bridge, not the JSON converter) were never affected.

💚 How did you test it?

  • Added boolean assertions to existing RNSentryJsonConverterTest for both map and array conversions
  • Manually verified on Android emulator (API 36, Fabric/New Architecture enabled): replay screenshots showed unmasked text after the fix, confirming maskAllText: false is now properly applied

📝 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
  • No breaking changes

🔮 Next steps

`RNSentryJsonConverter.convertToWritable()` did not handle `Boolean`
values from `sentry.options.json`, silently dropping them. This caused
all boolean options (e.g. `maskAllText`, `debug`, `attachScreenshot`)
to fall back to defaults when using `RNSentrySDK.init()`.

Fixes #6122

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

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(android): Handle boolean values in JSON options converter by antonis in #6130
  • chore(deps): update CLI to v3.4.2 by github-actions in #6129
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.26.2 to 2.26.3 by dependabot in #6126
  • chore(deps): bump getsentry/craft from 2.26.2 to 2.26.3 by dependabot in #6127
  • chore(deps): bump github/codeql-action from 4.35.3 to 4.35.4 by dependabot in #6128
  • feat(core): Extract text from children of touched components for breadcrumb labels by antonis in #6106
  • chore(deps): bump @babel/plugin-transform-modules-systemjs from 7.25.0 to 7.29.4 by dependabot in #6124
  • chore(deps): bump fast-uri from 3.0.1 to 3.1.2 by dependabot in #6121
  • chore(deps): bump fast-xml-builder from 1.1.5 to 1.2.0 by dependabot in #6120
  • chore(deps): bump socks to ^2.8.8 to fix ip-address vulnerability by antonis in #6117
  • chore(deps): bump uuid to ^13.0.1 to fix buffer bounds check vulnerability by antonis in #6118
  • test(replay): Add passthrough tests for device-state replay breadcrumbs by antonis in #6115
  • chore(deps): update JavaScript SDK to v10.52.0 by github-actions in #6108
  • chore(deps): bump basic-ftp from 5.3.0 to 5.3.1 by dependabot in #6111

🤖 This preview updates automatically when you update the PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented May 11, 2026

📲 Install Builds

Android

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

⚙️ sentry-react-native Build Distribution Settings

Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 04b1a96. Configure here.

@antonis antonis marked this pull request as ready for review May 11, 2026 12:25
@github-actions
Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 403.83 ms 442.31 ms 38.47 ms
Size 48.30 MiB 53.49 MiB 5.19 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8929511+dirty 405.33 ms 452.16 ms 46.83 ms
d2eadf8+dirty 414.64 ms 454.56 ms 39.92 ms
23598c3+dirty 414.12 ms 426.24 ms 12.12 ms
ad66da3+dirty 468.46 ms 533.56 ms 65.10 ms
5c1e987+dirty 423.52 ms 471.64 ms 48.12 ms
2c735cc+dirty 414.09 ms 438.47 ms 24.38 ms
7ac3378+dirty 404.78 ms 439.84 ms 35.06 ms
c004dae+dirty 412.86 ms 481.50 ms 68.64 ms
4953e94+dirty 442.02 ms 456.52 ms 14.50 ms
5fe1c6c+dirty 401.62 ms 445.28 ms 43.66 ms

App size

Revision Plain With Sentry Diff
8929511+dirty 43.75 MiB 48.16 MiB 4.41 MiB
d2eadf8+dirty 48.30 MiB 53.48 MiB 5.18 MiB
23598c3+dirty 43.75 MiB 48.16 MiB 4.41 MiB
ad66da3+dirty 48.30 MiB 53.49 MiB 5.19 MiB
5c1e987+dirty 43.75 MiB 48.08 MiB 4.33 MiB
2c735cc+dirty 43.75 MiB 48.08 MiB 4.33 MiB
7ac3378+dirty 43.75 MiB 48.13 MiB 4.37 MiB
c004dae+dirty 48.30 MiB 53.49 MiB 5.19 MiB
4953e94+dirty 43.75 MiB 48.08 MiB 4.33 MiB
5fe1c6c+dirty 43.75 MiB 48.14 MiB 4.39 MiB

@github-actions
Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 411.40 ms 441.96 ms 30.56 ms
Size 48.30 MiB 53.49 MiB 5.19 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
04207c4+dirty 395.40 ms 456.55 ms 61.15 ms
4b87b12+dirty 356.23 ms 399.86 ms 43.63 ms
d2eadf8+dirty 468.02 ms 530.37 ms 62.35 ms
4953e94+dirty 398.80 ms 431.81 ms 33.01 ms
7ac3378+dirty 410.67 ms 442.60 ms 31.92 ms
7d6fd3a+dirty 435.06 ms 458.78 ms 23.72 ms
890d145+dirty 486.42 ms 514.85 ms 28.43 ms
2c735cc+dirty 435.20 ms 459.48 ms 24.28 ms
ad66da3+dirty 411.49 ms 449.38 ms 37.89 ms
c004dae+dirty 404.60 ms 430.67 ms 26.07 ms

App size

Revision Plain With Sentry Diff
04207c4+dirty 43.94 MiB 48.98 MiB 5.04 MiB
4b87b12+dirty 43.94 MiB 49.00 MiB 5.06 MiB
d2eadf8+dirty 48.30 MiB 53.48 MiB 5.18 MiB
4953e94+dirty 43.94 MiB 48.94 MiB 5.00 MiB
7ac3378+dirty 43.94 MiB 48.99 MiB 5.05 MiB
7d6fd3a+dirty 43.94 MiB 49.00 MiB 5.06 MiB
890d145+dirty 43.94 MiB 49.00 MiB 5.06 MiB
2c735cc+dirty 43.94 MiB 48.94 MiB 5.00 MiB
ad66da3+dirty 48.30 MiB 53.49 MiB 5.19 MiB
c004dae+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.

Mobile Replay (Android, Fabric/New Architecture): maskAllText: false silently ignored — replays always fully masked

1 participant