unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.66k stars 699 forks source link

`Given_ApplicationDataContainer_When_GetAllKeys` fails on iOS #1285

Open MartinZikmund opened 5 years ago

MartinZikmund commented 5 years ago

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):

Visual Studio

Relevant plugins

Anything else we need to know?

xperiandri commented 3 years ago

Critical bug. Having it you kan only save a fixed set of values keys for which you hardcode in code

MartinZikmund commented 1 month ago

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