{ "id": "163324", "key": "TIMOB-23931", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-11-13T20:31:37.000+0000", "created": "2016-09-20T11:15:34.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "parity", "qe-6.0.0" ], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "issuelinks": [ { "id": "53481", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "158415", "key": "TIMOB-22465", "fields": { "summary": "Ti.UI.TableView Test Suite: Titanium.UI.TableView Acceptance TIMOB-11713", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } }, { "id": "53413", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "158431", "key": "TIMOB-22481", "fields": { "summary": "Ti.UI.TableView Test Suite: Titanium.UI.TableView Acceptance TIMOB-12620", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } }, { "id": "53449", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "158460", "key": "TIMOB-22510", "fields": { "summary": "Ti.UI.TableView Test Suite: TIMOB-15589 Unable to change TableViewRow properties for a row in a section", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "10100", "description": "This Issue Type is used to create Zephyr Test within Jira.", "name": "Test", "subtask": false } } } }, { "id": "52980", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "161396", "key": "TIMOB-23568", "fields": { "summary": "Windows: JSON.stringify against Blob causes app freeze", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-12-22T23:49:23.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nOn Windows, when trying to inspect an event that is returned to an event listener a user will be faced with one of the two following results.\r\n\r\n{code: title=app.js}\r\nvar win = Ti.UI.createWindow();\r\nvar label = Ti.UI.createLabel({\r\n backgroundColor:'darkgray',\r\n text: 'Your Test here',\r\n});\r\nwin.add(label);\r\nlabel.addEventListener('click', function(e) {\r\n\tconsole.log(e.source);\r\n\tconsole.log(JSON.stringify(e.source));\r\n});\r\nwin.open();\r\n{code}\r\n\r\n{code:title=Windows: console.log(e.source)}\r\n[INFO] [object class TitaniumWindows::UI::Label]\r\n{code}\r\n\r\n{code:title=Windows: console.log(JSON.stringify(e))}\r\n[ERROR] : Application Error: \"Runtime Error: JSON.stringify cannot serialize cyclic structures.\"\r\n{code}\r\n\r\nHowever, when trying to log an event on iOS and Android the following is returned\r\n\r\n{code:title=Android: console.log(e)}\r\n[INFO] : {\"wordWrap\":true,\"textAlign\":\"center\",\"text\":\"Your Test here\",\"ellipsize\":2,\"enabled\":true,\"visible\":true,\"touchEnabled\":true,\"backgroundColor\":\"darkgray\",\"backgroundRepeat\":false,\"size\":{\"height\":100,\"width\":360,\"y\":0,\"x\":0},\"rect\":{\"height\":100,\"width\":360,\"y\":229,\"x\":0},\"keepScreenOn\":false,\"children\":[],\"width\":\"fill\",\"height\":100,\"bubbleParent\":true,\"apiName\":\"Ti.UI.Label\",\"_events\":{\"click\":{}}}\r\n\r\n{code}\r\n\r\n{code:title=Android: console.log(JSON.stringify(e))}\r\n[INFO] : {\"wordWrap\":true,\"textAlign\":\"center\",\"text\":\"Your Test here\",\"ellipsize\":2,\"enabled\":true,\"visible\":true,\"touchEnabled\":true,\"backgroundColor\":\"darkgray\",\"backgroundRepeat\":false,\"size\":{\"height\":100,\"width\":360,\"y\":0,\"x\":0},\"rect\":{\"height\":100,\"width\":360,\"y\":229,\"x\":0},\"keepScreenOn\":false,\"children\":[],\"width\":\"fill\",\"height\":100,\"bubbleParent\":true,\"apiName\":\"Ti.UI.Label\",\"_events\":{\"click\":{}}}\r\n{code}\r\n\r\n{code:title=iOS: console.log(e)}\r\n[INFO] [object TiUILabel]\r\n{code}\r\n\r\n{code:title=iOS: console.log(JSON.stringify(e))}\r\n{\"horizontalWrap\":true,\"visible\":true,\"height\":100,\"backgroundColor\":\"darkgray\",\"width\":\"FILL\",\"textAlign\":\"center\",\"text\":\"Your Test here\",\"touchEnabled\":true}\r\n{code}\r\n\r\n\r\nh5.Steps to reproduce\r\n\r\n# Add the code above to an exisiting app.js\r\n# Build using {{appc run -p windows -T wp-emulator}}\r\n\r\nh5.Actual result\r\n\r\nWhen attempting to get information on the event returned from the event listener, either\r\n# When attempting to use JSON.stringify an application error will be thrown as the JSON contains cyclic structures\r\n# When logging just the event, the object type will be logged\r\n\r\nh5.Expected result\r\n\r\nIn parity with other platforms and to aid a developer I would expect to be able to log an event to the console to inspect the properties returned in the JSON payload.\r\n", "attachment": [], "flagged": false, "summary": "Windows: Allow an event to be logged to the console for inspection", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "OS: Microsoft Windows 10 Pro 10.0.14393\r\nAppc core: 6.0.0-46\r\nAppc NPM: 4.2.8-6\r\nTi SDK: 6.0.0.v20160919141738\r\nAppc Studio: 4.8.0.201609191928", "closedSprints": [ { "id": 752, "state": "closed", "name": "2016 Sprint 23 SDK", "startDate": "2016-11-05T00:39:37.027Z", "endDate": "2016-11-19T01:39:00.000Z", "completeDate": "2016-11-29T06:51:57.887Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "398315", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "For the cyclic structure, I can see that {{e.source.parent}} property could cause the issue because {{e.source.parent.children}} obviously contains {{e.source}} itself. I would rather be surprised that iOS and Android implementation doesn't dump entire properties but only few properties on {{JSON.stringify}}. It seems we have been using custom implementation for {{JSON.stringify}} for them, and we might want to emulate what iOS does on Windows to fix this issue.\r\n\r\nFYI When I JSON.stringify {{Ti.UI.Button}} instance on Windows, I got a lot more properties compared to the other platforms:\r\n\r\n{code}\r\n{\r\n \"title\": \"This is a button\",\r\n \"color\": \"\",\r\n \"textAlign\": 1,\r\n \"image\": null,\r\n \"font\": {\r\n \"fontFamily\": \"\",\r\n \"fontSize\": \"\",\r\n \"fontStyle\": -842150451,\r\n \"fontWeight\": -842150451,\r\n \"textStyle\": -842150451\r\n },\r\n \"verticalAlign\": 1,\r\n \"titleid\": \"\",\r\n \"rect\": {\r\n \"x\": 217,\r\n \"y\": 369,\r\n \"width\": 66,\r\n \"height\": 35\r\n },\r\n \"left\": \"\",\r\n \"backgroundGradient\": {\r\n \"type\": \"GRADIENT_TYPE::Unknown\",\r\n \"backfillStart\": false,\r\n \"backfillEnd\": false,\r\n \"endRadius\": 0,\r\n \"startRadius\": 0,\r\n \"startPoint\": {\r\n \"x\": 0,\r\n \"y\": 0\r\n },\r\n \"endPoint\": {\r\n \"x\": 0,\r\n \"y\": 0\r\n },\r\n \"colors\": []\r\n },\r\n \"keepScreenOn\": false,\r\n \"bottom\": \"\",\r\n \"pullBackgroundColor\": \"\",\r\n \"children\": [],\r\n \"accessibilityLabel\": \"\",\r\n \"backgroundLeftCap\": -6.2774385622041925e+66,\r\n \"backgroundFocusedImage\": \"\",\r\n \"parent\": null,\r\n \"borderWidth\": 0,\r\n \"borderColor\": \"\",\r\n \"backgroundFocusedColor\": \"\",\r\n \"backgroundSelectedImage\": \"\",\r\n \"borderRadius\": 0,\r\n \"accessibilityValue\": \"\",\r\n \"backgroundColor\": \"\",\r\n \"horizontalWrap\": true,\r\n \"accessibilityHint\": \"\",\r\n \"viewShadowColor\": \"\",\r\n \"backgroundSelectedColor\": \"\",\r\n \"viewShadowRadius\": -6.2774385622041925e+66,\r\n \"size\": {\r\n \"x\": 0,\r\n \"y\": 0,\r\n \"width\": 66,\r\n \"height\": 35\r\n },\r\n \"width\": \"\",\r\n \"animatedCenter\": {\r\n \"x\": 0,\r\n \"y\": 0\r\n },\r\n \"anchorPoint\": {\r\n \"x\": 0,\r\n \"y\": 0\r\n },\r\n \"touchEnabled\": true,\r\n \"backgroundDisabledColor\": \"\",\r\n \"accessibilityHidden\": false,\r\n \"tintColor\": \"\",\r\n \"backgroundDisabledImage\": \"\",\r\n \"backgroundTopCap\": -6.2774385622041925e+66,\r\n \"transform\": null,\r\n \"right\": \"\",\r\n \"visible\": true,\r\n \"opacity\": 1,\r\n \"overrideCurrentAnimation\": true,\r\n \"softKeyboardOnFocus\": 3452816845,\r\n \"backgroundImage\": \"\",\r\n \"center\": {\r\n \"x\": 0,\r\n \"y\": 0\r\n },\r\n \"top\": \"\",\r\n \"height\": \"\",\r\n \"layout\": \"\",\r\n \"focusable\": true,\r\n \"clipMode\": 3452816845,\r\n \"backgroundRepeat\": true,\r\n \"zIndex\": -842150451,\r\n \"enabled\": true,\r\n \"viewShadowOffset\": {\r\n \"x\": 0,\r\n \"y\": 0\r\n },\r\n \"lifecycleContainer\": null,\r\n \"bubbleParent\": true,\r\n \"apiName\": \"Ti.UI.Button\"\r\n}\r\n{code}", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-07T05:31:21.000+0000", "updated": "2016-10-07T05:31:21.000+0000" }, { "id": "400384", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/891", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-11-04T08:07:54.000+0000", "updated": "2016-11-04T08:07:54.000+0000" }, { "id": "400385", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "So the actual issue here is that we were not able to {{JSON.stringify}} Ti.UI.Views. I noticed that Ti.UI.View and its subclasses has {{parent}} and {{children}} property, and they are enumerable. That makes it impossible to log them through {{JSON.stringify}} because of circular references. We can easily workaround it by configuring them non-enumerable.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-11-04T08:09:25.000+0000", "updated": "2016-11-04T08:09:25.000+0000" }, { "id": "403836", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified improvement with the code provided in the description.\r\n*Windows: console.log(JSON.stringify(e))*; now displays the following information:\r\n{code:java}\r\n[INFO] {\"textAlign\":1,\"textid\":\"\",\"verticalAlign\":1,\"ellipsize\":false,\"text\":\"Your Test here\",\"color\":\"\",\"wordWrap\":true,\"font\":{\"fontFamily\":\"\",\"fontSize\":\"\",\"fontStyle\":0,\"fontWeight\":0,\"textStyle\":0},\"attributedString\":null,\"rect\":{\"x\":118,\"y\":271,\"width\":124,\"height\":27},\"left\":\"\",\"backgroundGradient\":{\"type\":\"GRADIENT_TYPE::Unknown\",\"backfillStart\":false,\"backfillEnd\":false,\"endRadius\":0,\"startRadius\":0,\"startPoint\":{\"x\":0,\"y\":0},\"endPoint\":{\"x\":0,\"y\":0},\"colors\":[]},\"keepScreenOn\":false,\"bottom\":\"\",\"pullBackgroundColor\":\"\",\"accessibilityLabel\":\"\",\"backgroundLeftCap\":8e-323,\"backgroundFocusedImage\":\"\",\"borderWidth\":0,\"borderColor\":\"\",\"backgroundFocusedColor\":\"\",\"backgroundSelectedImage\":\"\",\"borderRadius\":0,\"accessibilityValue\":\"\",\"backgroundColor\":\"darkgray\",\"horizontalWrap\":true,\"accessibilityHint\":\"\",\"viewShadowColor\":\"\",\"backgroundSelectedColor\":\"\",\"viewShadowRadius\":2.6631047824235e-311,\"size\":{\"x\":0,\"y\":0,\"width\":124,\"height\":27},\"width\":\"\",\"animatedCenter\":{\"x\":0,\"y\":0},\"anchorPoint\":{\"x\":0,\"y\":0},\"touchEnabled\":true,\"backgroundDisabledColor\":\"\",\"accessibilityHidden\":false,\"tintColor\":\"\",\"backgroundDisabledImage\":\"\",\"backgroundTopCap\":0,\"transform\":null,\"right\":\"\",\"visible\":true,\"opacity\":1,\"overrideCurrentAnimation\":false,\"softKeyboardOnFocus\":59756584,\"backgroundImage\":\"\",\"center\":{\"x\":0,\"y\":0},\"top\":\"\",\"height\":\"\",\"layout\":\"\",\"focusable\":true,\"clipMode\":1932,\"backgroundRepeat\":true,\"zIndex\":0,\"enabled\":true,\"viewShadowOffset\":{\"x\":0,\"y\":0},\"lifecycleContainer\":null,\"bubbleParent\":true,\"apiName\":\"Ti.UI.Label\",\"constructor\":{\"textAlign\":1,\"textid\":\"\",\"verticalAlign\":1,\"ellipsize\":false,\"text\":\"\",\"color\":\"\",\"wordWrap\":true,\"font\":{\"fontFamily\":\"\",\"fontSize\":\"\",\"fontStyle\":0,\"fontWeight\":0,\"textStyle\":0},\"attributedString\":null,\"keepScreenOn\":false,\"accessibilityLabel\":\"\",\"accessibilityValue\":\"\",\"accessibilityHint\":\"\",\"accessibilityHidden\":false,\"softKeyboardOnFocus\":0,\"focusable\":true,\"clipMode\":0,\"lifecycleContainer\":null,\"bubbleParent\":true,\"apiName\":\"Ti.UI.Label\"}}\r\n{code}\r\n\r\n*Environment*\r\n{code:java}\r\nNokia Lumia 640 LTE (RM-1073)\r\nversion 1607\r\nOS Build: 10.0.14393.576\r\nMobile Emulator 10.0.14393.0 WVGA 4 inch 512MB\r\n \r\nOperating System\r\nName = Microsoft Windows 10 Pro\r\nVersion = 10.0.14393\r\nArchitecture = 64bit\r\n# CPUs = 4\r\nMemory = 17034395648\r\n \r\nNode.js\r\nNode.js Version = 4.4.4\r\nnpm Version = 2.11.3\r\n \r\nTitanium SDK\r\nSDK Version =6.1.0.v20161222061413\r\n{code}\r\nClosing ticket. \r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-22T23:48:59.000+0000", "updated": "2016-12-22T23:48:59.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }