{ "id": "170768", "key": "TIMOB-25662", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2019-11-06T22:35:29.000+0000", "created": "2018-01-10T18:49:05.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "regression" ], "versions": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" }, { "id": "19988", "description": "", "name": "Release 7.0.1", "archived": false, "released": true, "releaseDate": "2017-12-21" } ], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2019-11-06T22:35:29.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "After updating from SDK 6.3.0 to 7.0.1 I have encountered a problem when fetching data from a backend service using models.\r\n\r\nWhen I fetch a little over 46K elements (JSON) via the service everything works. Fetching more than 49K elements it breaks with: \r\n\r\n{quote}[ERROR] : Script Error {\r\n[ERROR] : column = 14;\r\n[ERROR] : line = 625;\r\n[ERROR] : message = \"Maximum call stack size exceeded.\";\r\n[ERROR] : sourceURL = \"file:///Users/jda/Library/Developer/CoreSimulator/Devices/8C57F4CE-45BB-42BF-A384-19DADC911651/data/Containers/Bundle/Application/622094F1-60C4-4507-B122-5AC148B43C68/Test.app/alloy/backbone.js\";\r\n{quote}\r\n\r\nIf I change back to 6.3.0 then it works fine also with the larger file set.\r\n\r\nI have created to temporary service urls (as long as needed for this jira) that can be used to get these data (first is the smaller set):\r\n\r\n* https://test.dalsgaard-data.dk/jira1.nsf/service.xsp?open&command=getLocationPoints\r\n* https://test.dalsgaard-data.dk/jira2.nsf/service.xsp?open&command=getLocationPoints\r\n\r\nI have created a simple app that can be used to test this. This is index.xml:\r\n\r\n{code}\r\n\r\n\t\r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t \r\n\t\r\n\r\n{code}\r\n\r\nand this is index.js:\r\n\r\n{code}\r\nfunction loadData(url){\r\n\tvar dtStart = new Date();\r\n\t$.label4.text = \"Load data...\";\r\n\tconsole.info(\"Load data using url: \" + url);\r\n\tvar model = Alloy.createCollection('LocationPoint');\r\n model.fetch({\r\n timeout: 20000, \r\n url : url,\r\n success: function(result){\r\n console.info(\"loadData: data received\");\r\n\t\t var added = 0;\r\n for (var k = 0; k < result.length; k++) {\r\n var key = result.models[k].get(\"key\");\r\n var record = result.models[k].attributes;\r\n added++;\r\n };\r\n console.info(\"loadData: \" + added + ' records added ');\r\n\t\t\tvar dtNow = new Date();\r\n \t$.label4.text = \"Load took \" + (dtNow.getMilliseconds() - dtStart.getMilliseconds()) + \" ms\";\r\n \t$.label5.text = added + \" records loaded\";\r\n },\r\n error: function(result, e){\r\n console.error(\"loadData: Error: \" + e);\r\n \t$.label4.text = \"Load error: \" + e;\r\n }\r\n }); // Grab data \r\n}\r\n\r\nfunction loadDataSmall(){\r\n\tloadData(\"https://test.dalsgaard-data.dk/jira1.nsf/service.xsp?open&command=getLocationPoints\");\r\n}\r\n\r\nfunction loadDataLarge(){\r\n\tloadData(\"https://test.dalsgaard-data.dk/jira2.nsf/service.xsp?open&command=getLocationPoints\");\r\n}\r\n\r\n// Init using self executing function\r\n(function (){\r\n\t$.language.text = \"Test loading large collections\";\r\n\t$.main.open();\r\n})();\r\n{code}\r\n\r\nand finally the model \"LocationPoint\":\r\n\r\n{code}\r\nexports.definition = {\r\n\tconfig: {\r\n parentNode : \"data\",\r\n URL: \"https://test.dalsgaard-data.dk/kunder/dtu/fangst.nsf/service.xsp?open&command=getLocationPoints\",\r\n adapter : {\r\n type : \"restapi\",\r\n collection_name : \"LocationPoint\",\r\n idAttribute : \"id\",\t\t\t// Not in data from service\r\n\r\n // optimise the amount of data transfer from remote server to app\r\n addModifedToUrl: true,\r\n lastModifiedColumn: \"created\"\r\n }\r\n },\r\n\textendModel: function(Model) {\r\n\t\t_.extend(Model.prototype, {\r\n\t\t\t// extended functions and properties go here\r\n\t\t});\r\n\r\n\t\treturn Model;\r\n\t},\r\n\textendCollection: function(Collection) {\r\n\t\t_.extend(Collection.prototype, {\r\n\t\t\t// extended functions and properties go here\r\n\t\t});\r\n\r\n\t\treturn Collection;\r\n\t}\r\n};\r\n{code}\r\n\r\nI use the Rest API driver by Mads Møller from Napp ApS (I have attached the js file to be put in \"app/assets/alloy/sync\"\r\n\r\nI you set up this app using 7.0.1 (in tiapp.xml) then pressing button [Load small] will work and [Load larger] will fail with the error above. If you change to 6.3.0 it will work....\r\n\r\nCan I change my code to cater for this? \r\n\r\n_PS. Sorry for the formatting - the editor really is a challenge.... :_(_", "attachment": [ { "id": "63941", "filename": "restapi.js", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-10T17:53:02.000+0000", "size": 13291, "mimeType": "text/javascript" } ], "flagged": false, "summary": "Large collection retrieved by restapi breaks in model.fetch with: \"Maximum call stack size exceeded.\" at backbone.js (line 625)", "creator": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Johns-MacBook:Test jda$ appc info\r\nAppcelerator Command-Line Interface, version 7.0.1\r\nCopyright (c) 2014-2018, Appcelerator, Inc. All Rights Reserved.\r\n\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.2\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 16.0GB\r\n\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\n\r\nAppcelerator CLI\r\n Installer = 4.2.11\r\n Core Package = 7.0.1\r\n\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\n node-appc Version = 0.2.41\r\n\r\nTitanium SDKs\r\n 7.0.1.GA\r\n Version = 7.0.1\r\n Install Location = /Users/jda/Library/Application Support/Titanium/mobilesdk/osx/7.0.1.GA\r\n Platforms = iphone, android\r\n git Hash = f5ae7e5\r\n git Timestamp = 12/18/2017 18:48\r\n node-appc Version = 0.2.43\r\n 7.0.0.GA\r\n Version = 7.0.0\r\n Install Location = /Users/jda/Library/Application Support/Titanium/mobilesdk/osx/7.0.0.GA\r\n Platforms = iphone, android\r\n git Hash = f09dec4\r\n git Timestamp = 12/5/2017 21:38\r\n node-appc Version = 0.2.43\r\n 6.3.0.GA\r\n Version = 6.3.0\r\n Install Location = /Users/jda/Library/Application Support/Titanium/mobilesdk/osx/6.3.0.GA\r\n Platforms = iphone, android, mobileweb\r\n git Hash = 3620088\r\n git Timestamp = 11/1/2017 01:20\r\n node-appc Version = 0.2.43\r\n 6.2.2.GA\r\n Version = 6.2.2\r\n Install Location = /Users/jda/Library/Application Support/Titanium/mobilesdk/osx/6.2.2.GA\r\n Platforms = iphone, android, mobileweb\r\n git Hash = 42c7196\r\n git Timestamp = 9/19/2017 23:07\r\n node-appc Version = 0.2.43\r\n 6.1.2.GA\r\n Version = 6.1.2\r\n Install Location = /Users/jda/Library/Application Support/Titanium/mobilesdk/osx/6.1.2.GA\r\n Platforms = iphone, android, mobileweb\r\n git Hash = c4cd761\r\n git Timestamp = 7/27/2017 23:13\r\n node-appc Version = 0.2.43\r\n \r\nMac OS X\r\n Command Line Tools = installed\r\n\r\nIntel® Hardware Accelerated Execution Manager (HAXM)\r\n Installed = yes\r\n Memory Limit = 4 GB\r\n\r\nJava Development Kit\r\n Version = 1.8.0_112\r\n Java Home = /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home\r\n", "comment": { "comments": [ { "id": "433008", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Please create a sample test app which generates the issue and attach the project in here. We will test the issue. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-01-11T04:27:02.000+0000", "updated": "2018-01-11T04:27:02.000+0000" }, { "id": "433016", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi Sharif\r\n\r\nWell, that is exactly what I did - the source code is so simple that I provided you with the bits and pieces to create a new Alloy project (which by the way I can find NO way to do in Studio!!! - we could earlier!!).\r\n\r\nAnd I have also created two external services that the provided code calls for you to test (on one of my servers).\r\n\r\nPlease let me know what you need more?\r\n\r\n/John", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-11T09:01:26.000+0000", "updated": "2018-01-11T09:01:26.000+0000" }, { "id": "433017", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": ".... you may need to edit my message to get the right source code out - as per my comments at the end. I could not format the source code correctly... Or let me know how I can format it in the editor in the browser?", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-11T09:02:58.000+0000", "updated": "2018-01-11T09:02:58.000+0000" }, { "id": "433022", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks Ewan for the edits! (y)\r\n\r\nThe code tag does not seem to be among the styles in the editor :)\r\n\r\nSharif, I guess that you can just take my very simple code from above and reproduce the error. Otherwise, let me know.\r\n\r\n/John", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-11T11:09:02.000+0000", "updated": "2018-01-11T11:09:02.000+0000" }, { "id": "433025", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "I'm only able to reproduce this issue when setting {{run-on-main-thread}} to false with the below setup, therefore I don't believe this is an alloy issue so moving to TIMOB. I also observed that using backbone 1.1.2 instead of the default 0.9.2 fixes the issue for me\r\n\r\nTi SDK: 7.0.1.GA. 7.0.0.GA\r\nAppc CLI: 7.0.1\r\nAlloy: 1.10.10 (backbone 0.9.2)\r\niOS 11.2 Simulator", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2018-01-11T11:46:30.000+0000", "updated": "2018-01-11T11:46:30.000+0000" }, { "id": "433026", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks Ewan!\r\n\r\nInteresting....\r\n\r\nSo what do you suggest I should try here in my environment?\r\n\r\nThis is not a \"new\" app so some of the settings may not be \"best practice\" now. I am not sure whether I should set {{run-on-main-thread}} - and what other consequences for my app that could have?\r\n\r\nWhat steps should I use if I want the \"supported\" way of installing backbone 1.1.2 instead of 0.9.2? Just using {code}npm install - g ....{code}\r\n\r\n/John", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-11T11:53:14.000+0000", "updated": "2018-01-11T11:54:21.000+0000" }, { "id": "433083", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~jda] For backbone, there's a migration guide at http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Backbone_Migration, to switch to using it you just need to add {{\"backbone\": \"1.1.2\"}} in your config.json As for the {{run-on-main-thread}} setting, I'm not massively familiar with the nuances sorry, [~hknoechel] do you know of any potential issues", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2018-01-12T13:53:48.000+0000", "updated": "2018-01-12T13:53:48.000+0000" }, { "id": "433154", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ewan, I have played a little with the options you mentioned.\r\n\r\n1. Using a newer backbone gave me another error from backbone about a \"cid\"....\r\n2. {{Run-on-main-thread}}\r\n\r\nThe latter is interesting as my first impression is that it runs faster! E.g. loading the data from the server is a little faster - and who don't want \"faster\"? :-)\r\n\r\nHowever, when I open a function with a map (using ti.map) then everything gets veryyyy sloooooowwww..... I think it has more to do with getting the location (in the simulator right now). Is that anything you have seen? Could there be related settings for location services while setting {{Run-on-main-thread}}?\r\n\r\nI'll do some further tests - but just wanted to give some feedback along the way. ", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-15T15:12:01.000+0000", "updated": "2018-01-15T15:12:01.000+0000" }, { "id": "433156", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "Could issues like the above be related to using a dispatcher (as described in [an article by Fokke|http://www.tidev.io/2014/09/10/the-case-against-ti-app-fireevent-2/] a couple of years ago)?\r\n\r\nI use that heavily.... - and testing on an iPhone 7 the delay for getting the gps location is _workable_ - However, it just hang the app somewhere else (seemed arbitrary)\r\n\r\nHmmm.... tried again. And it misbehaves the same way as in the simulator on second try. So quite sure it is something that I do in the app that makes it behave like this - but I have no clue as to where to search. Just guessing that it could be related to: ti.map, locationservices and/or perhaps more likely dispatchers...", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-15T15:31:06.000+0000", "updated": "2018-01-15T15:31:06.000+0000" }, { "id": "435797", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "I'll remove the two test services as there seem to be no development on this issue...\r\n", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-21T10:56:35.000+0000", "updated": "2018-03-21T11:41:43.000+0000" }, { "id": "438764", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "I have removed the test services now :-(", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-27T15:19:10.000+0000", "updated": "2018-06-27T15:19:10.000+0000" }, { "id": "452515", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue as “Cannot Reproduce”. No test code provided, or code provided in URL links are no longer available. The SDKs listed are out of date with our current release (8.2.1.GA as of the date of closure), and out of date with mobile OS versions. Updating the code may not reproduce the issue reported, or be a valid test case.\r\n\r\nIf community members feel that the issue is still valid, please add a comment, and include code that demonstrates/reproduces the issue.\r\n", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-06T22:35:29.000+0000", "updated": "2019-11-06T22:35:29.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }