Ti.App.Properties.setString crashes when I try to store a large string with more than 2048 characters on Windows Phone. The same thing works fine on iOS and Android where I am able to store and retrieve strings with more than 4096 characters.
Steps to Reproduce :
1. Create a mobile app project
2. Add the code from below text file into app.js
http://ctrlv.it/txt/4925/1177307313
3. Run the app
Expected Result
Prints the strings onto the console
(Tested on iOS and Android)
Actual Result
Error in console :
{noformat}
[ERROR] : Application Error: {
[ERROR] : "line": 2,
[ERROR] : "column": 10,
[ERROR] : "message": "Error while require(/app) unknown exception",
[ERROR] : "native_stack": [
[ERROR] : "JSExportClass
::CallNamedFunction"
[ERROR] : ]
[ERROR] : }
{noformat}
Check attachment for Screenshot of App screen.
According to https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.localsettings :
Given that Platform::String is char16, that means we should be able to get up to 4096 characters as a value. What I can't confirm, however, is if the limits mentioned are the same on 8.1 as they are on Win 10 (which is what these docs are referring to). Unfortunately MS has basically combined the WInRT API docs for 8.1/10, so I can't know for sure if the limits used to be lower. Anyways, we should likely be smart enough to catch the exception and spit out a better error for exceeding the size limits here. Also, we should see if maybe our string conversion is somehow inflating the string size causing it to take up more space.
https://github.com/appcelerator/titanium_mobile_windows/pull/596
In Android and iOS, I was able to store about 200K characters in a single string property without any issue. Hope it'll work the same way on Windows after the fix. ~Thanks
Verified using: Windows 10 Pro Visual Studio 2015 Community Update 2 Appc Core: 5.3.0-12 Appc NPM: 4.2.5-1 Ti SDK: 5.3.0.v20160411153728 Windows Phone Emulator 8.1, 10 Lumia 930 10 Lumai 520 8.1 Using the code provided the app no longer crashes Closing ticket