fix(devtools): show non-string ApplicationSettings values by NathanWalker · Pull Request #11580 · NativeScript/NativeScript
Repository navigation
fix(devtools): show non-string ApplicationSettings values - #11580
Open
NathanWalker wants to merge 1 commit into main from fix/devtools-non-string-settings
Open
fix(devtools): show non-string ApplicationSettings values #11580 NathanWalker wants to merge 1 commit into main from fix/devtools-non-string-settings
Conversation
NathanWalker commented Oct 23, 2026
Copy link Copy Markdown
Contributor
PR Checklist
- The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages .
- There is an issue for the bug/feature this PR is for.
- You have signed the CLA .
- All existing tests are passing.
- Tests for the changes are included. (The devtools package has no unit-test target yet. See the verification below.)
What is the current behavior?
The devtools Storage panel reads every ApplicationSettings key with ApplicationSettings.getString(key). On Android that's SharedPreferences.getString(), which throws java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String for any key stored with setBoolean or setNumber. As a result, opening Storage fails for any app with a non-string setting (#10513 ).
What is the new behavior?
ApplicationSettingsKeyValueProvider.getValue tries the string, boolean and number getters in turn and returns the first one that succeeds, as a string. Missing keys still return undefined. Writes are unchanged.
Verification: I ran a one-off Vitest spec against a mocked ApplicationSettings whose getters throw on a type mismatch, the way Android's do. String, boolean and number keys all read back as 'text', 'true' and '2.5', and the missing key stays undefined. The same spec fails without this change. tsc for packages/devtools reports no new errors.
Closes #10513 .
fix(devtools): show non-string ApplicationSettings values
4646ceb
Closes #10513
nx-cloud
Bot
commented
Oct 23, 2026
·
edited
Loading
Copy link Copy Markdown
|
View your CI Pipeline Execution ↗ for commit 4646ceb
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
pkg-pr-new
Bot
commented
Oct 23, 2026
Copy link Copy Markdown
commit: |
View reviewed changes
Comment thread packages/devtools/src/impl/ApplicationSettingsKeyValueProvider.ts
| } | ||
| getValue(key: string) { | ||
| return ApplicationSettings.getString(key); | ||
| // Android's typed getters throw ClassCastException when the stored value has a different type. |
View reviewed changes
Comment thread packages/devtools/src/impl/ApplicationSettingsKeyValueProvider.ts
| getValue(key: string) { | ||
| return ApplicationSettings.getString(key); | ||
| // Android's typed getters throw ClassCastException when the stored value has a different type. | ||
| const readers = [() => ApplicationSettings.getString(key), () => ApplicationSettings.getBoolean(key), () => ApplicationSettings.getNumber(key)]; |
This branch has not been deployed
No deployments
Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment