« Back to Search  |  Reader Mode  |  Switch to Full Retro Site View Links: Stay in Reader  |  Retro Mode: ON  |  Original »
GitHub · Extracted in 2727 ms

fix(devtools): show non-string ApplicationSettings values by NathanWalker · Pull Request #11580 · NativeScript/NativeScript

Source: https://github.com/NativeScript/NativeScript/pull/11580

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

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

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 21s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-23 20:39:10 UTC

pkg-pr-new
Bot
commented Oct 23, 2026



Copy link Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11580
npm i https://pkg.pr.new/@nativescript/vite@11580
npm i https://pkg.pr.new/@nativescript/webpack@11580

commit: 4646ceb

CatchABus reviewed Nov 12, 2026
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.
farfromrefug reviewed Nov 12, 2026
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

Labels

None yet

3 participants