{ "id": "171644", "key": "TIMOB-26030", "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": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-09-24T23:18:06.000+0000", "created": "2018-05-11T03:09:09.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "socket", "tcp" ], "versions": [], "issuelinks": [ { "id": "57027", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172634", "key": "TIMOB-26575", "fields": { "summary": "Windows: Support async variants of Ti.Network.TCP #read and #write", "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": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "56865", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "172347", "key": "TIMOB-26411", "fields": { "summary": "API: Support async variants of Ti.IOStream methods", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "56789", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "171307", "key": "TIMOB-25862", "fields": { "summary": "Parity: Support async Ti.UI.Webview.evalJS call on Android & iOS", "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": "None", "id": "6" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-11-16T19:23:50.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nIf the \"tiapp.xml\" file property {{run-on-main-thread}} is set to {{true}}, then calling a {{Ti.Networking.Socket.TCP}} object's blocking {{read()}} or {{write()}} method will cause a crash on Android.\r\n\r\n*Steps to reproduce:*\r\n# Open the project's \"tiapp.xml\" file.\r\n# Make sure property \"run-on-main-thread\" is set to {{true}}.\r\n# Set up an Android device with Internet access.\r\n# Build and run [^TcpClientBlockingTest.js] on the Android device.\r\n\r\n*Result:*\r\nThe app crashes with a Java {{NetworkOnMainThreadException}}.\r\n\r\n*Cause:*\r\nThe Java {{java.net.ServerSocket}} class will throw a {{NetworkOnMainThreadException}} when used on the main UI thread. It can only be used by a non-UI thread.\r\n\r\n*Work-Around:*\r\nSimplest solution is to set the tiapp.xml property \"run-on-main-thread\" to {{false}}.\r\n\r\nBest solution is to not use the blocking read() and write() methods and use the async {{Ti.Stream.pump()}} and {{Ti.Stream.write()}} methods instead as documented here...\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.Network.Socket.TCP\r\n\r\nNote that even if we do fix the crash, we still don't recommend using the synchronous {{read()}} and {{write()}} method calls since they'll block the UI thread. This will make the UI appear to stutter or hang, providing a poor experience for the end-user.", "attachment": [ { "id": "65152", "filename": "TcpClientBlockingTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-11T03:01:19.000+0000", "size": 1207, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: TCP read() and write() methods cause a crash when running on main UI thread", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "441996", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10338", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-24T18:27:31.000+0000", "updated": "2018-09-24T18:27:31.000+0000" }, { "id": "442018", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nPR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-24T23:17:58.000+0000", "updated": "2018-09-24T23:17:58.000+0000" }, { "id": "442421", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on SDK 7.5.0.v20181005164109. No Crashing. Works fine. Closing.\r\n{code}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Architecture = 64bit\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version =7.5.0.v20181005164109\r\nDevice\t\t\t =\r\n\t\t\t\t\tSamsung s5 android 6\r\n\t\t\t\t\tPixel 2 Android 8 emulator\r\n{code}", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-10-08T21:22:22.000+0000", "updated": "2018-10-08T21:22:22.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }