Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20581] Windows: Ti App Properties Crashes while storing large data

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-03-28T13:25:33.000+0000
Affected Version/sRelease 5.2.0
Fix Version/sRelease 5.3.0
ComponentsWindows
Labelswindows, windows8.1, windowsphone
ReporterBinay Das
AssigneeKota Iguchi
Created2016-03-14T11:08:39.000+0000
Updated2016-04-12T05:10:58.000+0000

Description

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.

Attachments

FileDateSize
Capture.PNG2016-03-14T11:05:56.000+000037162

Comments

  1. Christopher Williams 2016-03-21

    According to https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.localsettings :
       The name of each setting can be 255 characters in length at most. Each setting can be up to 8K bytes in size and each composite setting can be up to 64K bytes in size.
       
    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.
  2. Kota Iguchi 2016-03-28

    https://github.com/appcelerator/titanium_mobile_windows/pull/596
  3. Binay Das 2016-03-29

    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
  4. Ewan Harris 2016-04-12

    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

JSON Source