{ "id": "102467", "key": "AC-2201", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2013-02-22T17:10:03.000+0000", "created": "2012-10-01T18:48:29.000+0000", "labels": [ "analytics", "crash", "hang", "ios", "modules", "network", "startup", "triage" ], "versions": [], "issuelinks": [ { "id": "32434", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "91689", "key": "TIMOB-9090", "fields": { "summary": "iOS: Timing out waiting on main thread causing rejections", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "32433", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "63616", "key": "TIMOB-2984", "fields": { "summary": "iOS: Queued analytics on a bad network connection can result in a deadlock ", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:11.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Let me start by giving a general description of the behavior I am witnessing.\r\n\r\nWhen using Titanium 2.x, targeting iOS 5 or 6....\r\n\r\nIf I launch my app in a situation where the device or simulator BELIEVES it has a network connection, but where one is not actually available, the app will hang. True, this might seem to be a rare situation, but it happens quite frequently here in downtown Chicago. My phone reports a 4g connection with AT&T, but the network is unresponsive.\r\n\r\nI have witnessed all of the following depending upon my app and whether I am running on the device or in simulator.\r\n# The app hangs forever on the splash screen.\r\n# The app makes it past the startup screen, but the UI is unresponsive. \r\n# The app hangs on the startup screen for a long time, but eventually finishes launching normally. \r\n# The app hangs on the startup screen, and then iOS shuts it down (for taking to long to launch?)\r\n# Occasionally, the console shows the error \"Timing out waiting on main thread. Possibly a deadlock? in TiThreadPerformOnMainThread (TiBase.m:238)\"\r\n\r\nI know that a while back, this type of problem could be traced to having analytics enabled, but I am seeing this even with false in my tiapp.xml\r\n\r\nIt also appears that the issue is somehow related to the loading of modules, as my apps which do not use modules do not exhibit the bug.\r\n\r\nh3. Steps to reproduce:\r\n\r\nCreate a new default Titanium Mobile project. Run in simulator to show that it is working correctly (you can switch between tabs).\r\nNow, set analytics to false in tiapp.xml (just to rule that out as the cause).\r\nThen, fool your computer into thinking you have a network connection when you actually do not. The easiest way to do this is with Apple's Network Link Conditioner Preference pane. You will need to create a new profile with 0% bandwidth and 100% of up and down packets dropped. \r\n\r\nConfirm that your computer appears to have a network connection, but an attempt to access a web page yields NO response.\r\n\r\nRun the test app in the simulator. It works just as before.\r\n\r\nBut finally, try adding a module to the project. I used ti.storekit for my testing. Also, be sure to actually require the module at the beginning of the app.js code.\r\n\r\nRun the app in the simulator, and you should find that it either hangs for a long time on the default splash screen, or that the window is unresponsive when you attempt to switch tabs-- for a long time or FOREVER.\r\n\r\nAs I said, the conditions under which this bug would appear are fairly rare. Apps launch fine when the device knows there is no network connection, and they launch fine when the device HAS a network connection. Usually even when the connection is marginal, the app will eventually launch.\r\n\r\nBut when the device (or simulator) thinks it has a connection but it actuality it does not, the app will hang at launch.\r\nIf anyone could verify that they can reproduce this behavior, I will feel a little better that it is not something wonky on my end. Although, it still won't leave us with a solution yet.\r\n\r\nh3. UPDATE\r\n\r\nWhen using Little Snitch to monitor network activity, it seems that my little test app STILL is trying to connect to api.appcelerator.com on port 443 at launch. This is even after analytics is set to FALSE in tiapp.xml\r\n\r\nMaybe this issue IS related to TIMOB-9090 (reported fixed) and TIMOB-2984 (still open).", "attachment": [], "flagged": false, "summary": "iOS: Apps hang at startup when network connection is poor", "creator": { "name": "lukebar", "key": "lukebar", "displayName": "Luke Bartolomeo", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "lukebar", "key": "lukebar", "displayName": "Luke Bartolomeo", "active": true, "timeZone": "America/Chicago" }, "environment": "iOS 5 & 6, Titanium Mobile SDK 2.x\r\n", "comment": { "comments": [ { "id": "223764", "author": { "name": "hardbyte", "key": "hardbyte", "displayName": "Craig Jones", "active": true, "timeZone": "America/Los_Angeles" }, "body": "+1 for the above.\n\nI have an app that connects to the Twitter API and I've getting the same situation in hanging splash screens etc...\n\nSame as above, Analytics disabled, Ti 2.x, iOS 5 & 6.", "updateAuthor": { "name": "hardbyte", "key": "hardbyte", "displayName": "Craig Jones", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-16T11:58:51.000+0000", "updated": "2012-10-16T11:58:51.000+0000" }, { "id": "239336", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Luke, can you please provide us logs (Titanium Mobile stack traces) and crash reports, if any?", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-21T23:16:37.000+0000", "updated": "2013-02-21T23:16:37.000+0000" }, { "id": "239405", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "When time allows, please check and complete [JIRA Ticket Checklist|http://docs.appcelerator.com/titanium/latest/#!/guide/How_to_Submit_a_Bug_Report-section-29004732_HowtoSubmitaBugReport-JIRATicketChecklist] in order to escalate this issue quicker, thanks.", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-22T17:10:03.000+0000", "updated": "2013-02-22T17:10:03.000+0000" }, { "id": "288736", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe tested this issue with latest Ti Studio and SDK 3.2. We can't reproduce this problem. \r\n \r\n\r\nh5. Test Environment \r\nMac OX x 10.8.5\r\nTi CLI 3.2.0\r\nTi SDK 3.2.0.GA\r\nIOS Simulator 7.0.3 \r\n\r\nh5. Test Code \r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n\tbackgroundColor : 'orange'\r\n});\r\n\r\nc = Titanium.Network.createHTTPClient();\r\nc.setTimeout(10000);\r\n\r\nc.onload = function() {\r\n\tTi.API.info('IN ONLOAD ');\r\n\tTi.API.info(\"response \" + c.responseData);\r\n\r\n};\r\nc.ondatastream = function(e) {\r\n\r\n};\r\nc.onerror = function(e) {\r\n\tTi.API.info('XHR Error ' + e.error);\r\n};\r\n\r\n// open the client\r\n\r\nc.open('GET', 'https://raw.github.com/appcelerator/Documentation-Examples/master/HTTPClient/data/json.txt');\r\n\r\n// send the data\r\nc.send();\r\nwin.open();\r\n\r\n{code}\r\n\r\nh5. Step to Test\r\n\r\n# Create new project for Ti Classic \r\n# Update app.js file with test code\r\n# Disconnected networks connection \r\n# Set analytics false in project tiapp.xml\r\n# Run this project in iOS simulator \r\n# App will run with 'orange' background color\r\n\r\n\r\nThanks\r\n", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-18T11:10:31.000+0000", "updated": "2014-01-19T00:46:56.000+0000" }, { "id": "343477", "author": { "name": "shotaw", "key": "shotaw", "displayName": "Shota Watanabe", "active": true, "timeZone": "America/Los_Angeles" }, "body": "+1 for this\r\nI just use 'Network Link Conditioner' and set '100% loss' , it finally reproduced.\r\n\r\n", "updateAuthor": { "name": "shotaw", "key": "shotaw", "displayName": "Shota Watanabe", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-02-16T02:55:31.000+0000", "updated": "2015-02-16T02:55:31.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }