Repository navigation
Description
Current behavior
Given_ApplicationDataContainer_When_GetAllKeys fails on iOS when run on my device. The problem seems to be the fact, that even after clearing, the NSUserDefaults.StandardUserDefaults contains a ton of weird default settings like:
AppleLanguages, AppleLocale, NSInterfaceStyle, AppleITunesStoreItemKinds, AppleKeyboardsExpanded, PKKeychainVersionKey, ApplePasscodeKeyboards , AppleKeyboards, NSLanguages, NSInterfaceStyle
One of those being a date, which contains :, which Uno, unfortunately, uses as deserialization separator. This makes the DataTypeSerializer crash with exception.
Expected behavior
Runtime tests should run from SamplesApp without issues.
How to reproduce it (as minimally and precisely as possible)
Run Runtime tests via the SamplesApp on iOS.
Environment
Nuget Package:
Package Version(s):
Affected platform(s):
- iOS
- Android
- WebAssembly
- Windows
- Build tasks
Visual Studio
- 2017 (version: )
- 2019 (version: 16.2 Preview 3)
- for Mac (version: )
Relevant plugins
- Resharper (version: )
Activity
xperiandri commentedon Feb 17, 2021
Critical bug. Having it you kan only save a fixed set of values keys for which you hardcode in code
8 remaining items
[-]Given_ApplicationDataContainer_When_GetAllKeys fails on iOS[/-][+]`Given_ApplicationDataContainer_When_GetAllKeys` fails on iOS[/+]MartinZikmund commentedon Jun 17, 2024
The cause is that these come from the global domain:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/UserDefaults/AboutPreferenceDomains/AboutPreferenceDomains.html
We should be able to filter them out, will do that as part of App data changes PR
MartinZikmund commentedon Jul 15, 2025
Still relevant to both Skia and Native renderer
fix(passwordbox): content jumps when hover it (unoplatform#1285)
test: Reproduce ApplicationDataContainer GetEnumerator returns raw va…
MartinZikmund commentedon Apr 7, 2026
Repro generator
Runtime test(s) added in branch
dev/mazi/repro/1285:src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_ApplicationDataContainer.cs→When_GetEnumerator_Returns_Correct_Values_Not_Keyssrc/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_ApplicationDataContainer.cs→When_Values_Collection_Returns_Stored_ValueWhen_GetEnumerator_Returns_Correct_Values_Not_Keysfails on Skia Desktop (and likely on all platforms): iterating viaforeachoverValuesreturns the raw serialized stringSystem.String:hello_worldinstead of the deserialized valuehello_world.Root cause found in two places:
src/Uno.UWP/Storage/ApplicationDataContainer.skia.cs:181—GetEnumerator()returnsv.Value(raw serialized string) without callingDataTypeSerializer.Deserialize(v.Value)src/Uno.UWP/Storage/ApplicationDataContainer.Apple.cs:104—GetEnumerator()passesk.Key.ToString()instead ofk.Value?.ToString()toDataTypeSerializer.DeserializeThe
Valuesproperty on both platforms correctly callsDataTypeSerializer.Deserialize, butGetEnumerator()does not.