fix(android): Handle boolean values in JSON options converter#6130
Open
antonis wants to merge 2 commits into
Open
fix(android): Handle boolean values in JSON options converter#6130antonis wants to merge 2 commits into
antonis wants to merge 2 commits into
Conversation
`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>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📲 Install BuildsAndroid
|
There was a problem hiding this comment.
✅ 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.
Contributor
Android (legacy) Performance metrics 🚀
|
| 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 |
Contributor
Android (new) Performance metrics 🚀
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
RNSentryJsonConverter.convertToWritable()did not handleBooleanvalues when convertingsentry.options.jsonto a React NativeReadableMap. Boolean values were silently dropped because theinstanceofchain only checked forFloat,Double,Number,String,JSONObject,JSONArray, andnull.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) insentry.options.jsonand initialize viaRNSentrySDK.init(), thefalsevalue was dropped. The SDK then treated the missing key astrue(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 — includingdebug,attachScreenshot,attachViewHierarchy,enableCaptureFailedRequests,spotlight, etc. However, the impact is limited because most boolean options default to sensible values when missing, and the JS-sideSentry.init()options (which go through the React Native bridge, not the JSON converter) were never affected.💚 How did you test it?
RNSentryJsonConverterTestfor both map and array conversionsmaskAllText: falseis now properly applied📝 Checklist
sendDefaultPIIis enabled🔮 Next steps