{ "id": "150692", "key": "ALOY-1627", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "20404", "name": "CLI Release 7.0.8", "archived": false, "released": true } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-11-01T18:59:11.000+0000", "created": "2015-08-25T22:40:33.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "user_experience" ], "versions": [ { "id": "20247", "name": "Alloy 1.13.2", "archived": false, "released": true, "releaseDate": "2018-08-21" } ], "issuelinks": [ { "id": "51459", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "128630", "key": "TISTUD-6302", "fields": { "summary": "Breakpoints Never Hit within Appcelerator Studio", "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": "49955", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "128630", "key": "TISTUD-6302", "fields": { "summary": "Breakpoints Never Hit within Appcelerator Studio", "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 } } } } ], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2018-11-01T18:59:14.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": "13604", "name": "Tooling", "description": "Items related to Alloy tooling and workflow" } ], "description": "Sprint noticed their their break points aren't working on conditions in their alloy apps. I've been able to verify this with my own testing on a fresh application. To clarify (āžœ == break point):\r\n\r\n{code}\r\n// This will not pause and the inner block runs\r\nāžœ if(true){ \r\n console.log(\"hello Jay!\"); \r\n} \r\n\r\n// This will pause \r\nif(true){ \r\n āžœ console.log(\"hello Jay!\"); \r\n}\r\n{code}\r\n\r\nh3. Steps to reproduce\r\n1. Create a new alloy app within Appcelerator Studio\r\n2. Add the above if statement with a breakpoint on the conditoin\r\n3. Run in debugging mode\r\n\r\nh3. Expected\r\nThe code pauses on the if statement and doesn't call console.log()\r\n\r\nh3. Actual\r\nThe code is ran as if the breakpoint isn't there. ", "attachment": [ { "id": "56531", "filename": "breakpoint2.gif", "author": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-08-26T19:28:33.000+0000", "size": 203315, "mimeType": "image/gif" }, { "id": "57647", "filename": "native_android.png", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-12-02T00:37:48.000+0000", "size": 109137, "mimeType": "image/png" }, { "id": "57646", "filename": "native_android2.png", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-12-02T00:37:48.000+0000", "size": 109213, "mimeType": "image/png" }, { "id": "56520", "filename": "Screen Shot 2015-08-25 at 1.18.45 PM.png", "author": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-08-25T22:38:19.000+0000", "size": 414594, "mimeType": "image/png" } ], "flagged": false, "summary": "Breakpoints not working on alloy apps", "creator": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1058, "state": "closed", "name": "2018 Sprint 16 SDK", "startDate": "2018-07-29T22:26:06.486Z", "endDate": "2018-08-12T22:26:00.000Z", "completeDate": "2018-08-13T17:38:16.757Z", "originBoardId": 114 }, { "id": 1045, "state": "closed", "name": "2018 Sprint 13 SDK", "startDate": "2018-06-17T20:47:13.621Z", "endDate": "2018-07-01T20:47:00.000Z", "completeDate": "2018-07-02T18:40:05.029Z", "originBoardId": 114 }, { "id": 1065, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2018-08-13T17:39:36.846Z", "endDate": "2018-08-27T17:39:00.000Z", "completeDate": "2018-08-29T16:10:57.013Z", "originBoardId": 114 }, { "id": 1050, "state": "closed", "name": "2018 Sprint 14 SDK", "startDate": "2018-07-01T18:40:57.193Z", "endDate": "2018-07-15T18:40:00.000Z", "completeDate": "2018-07-16T03:27:08.720Z", "originBoardId": 114 }, { "id": 1053, "state": "closed", "name": "2018 Sprint 15 SDK", "startDate": "2018-07-15T21:52:05.453Z", "endDate": "2018-07-29T21:52:00.000Z", "completeDate": "2018-07-29T22:25:11.723Z", "originBoardId": 114 }, { "id": 1039, "state": "closed", "name": "2018 Sprint 12 SDK", "startDate": "2018-06-03T15:22:23.401Z", "endDate": "2018-06-17T15:22:00.000Z", "completeDate": "2018-06-18T20:45:36.363Z", "originBoardId": 114 }, { "id": 1071, "state": "closed", "name": "2018 Sprint 18 Tooling", "startDate": "2018-08-26T16:10:36.679Z", "endDate": "2018-09-09T16:10:00.000Z", "completeDate": "2018-09-11T21:05:41.010Z", "originBoardId": 219 }, { "id": 1072, "state": "closed", "name": "2018 Sprint 19 Tooling", "startDate": "2018-09-09T21:06:36.074Z", "endDate": "2018-09-23T21:06:00.000Z", "completeDate": "2018-09-23T22:29:36.340Z", "originBoardId": 219 } ], "comment": { "comments": [ { "id": "361153", "author": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~pinnamuri], feel free to let me know if you need anything else from me.", "updateAuthor": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-08-25T22:41:20.000+0000", "updated": "2015-08-25T22:41:20.000+0000" }, { "id": "361299", "author": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just found that the breakpoint fails totally on the first build. But the second build works. ", "updateAuthor": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-08-26T19:28:15.000+0000", "updated": "2015-08-26T19:28:15.000+0000" }, { "id": "361805", "author": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~pinnamuri], any ballpark I could get this scheduled?", "updateAuthor": { "name": "stoda", "key": "stoda", "displayName": "Seth Toda", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-08-31T17:04:20.000+0000", "updated": "2015-08-31T17:04:20.000+0000" }, { "id": "368729", "author": { "name": "pinnamuri", "key": "pinnamuri", "displayName": "Praveen Innamuri", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~kkolipaka] Can you take a look into this ?", "updateAuthor": { "name": "pinnamuri", "key": "pinnamuri", "displayName": "Praveen Innamuri", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-11-03T00:02:57.000+0000", "updated": "2015-11-03T00:02:57.000+0000" }, { "id": "368760", "author": { "name": "kkolipaka", "key": "kkolipaka", "displayName": "Kondal Kolipaka", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Looks like we are ignoring the break points for if conditions where condition value is already known at build time. Please find the snippet below for better understanding. And this happens only for alloy projects for iOS applications. It has to be fixed from iOS SDK end.\r\n\r\n{code}\r\nfunction doClick(e) {\r\n\tif (OS_IOS && Ti.Platform.model === \"Simulator\") //break point will hit here\r\n\t{\r\n\t\talert(\"Simulator does not support sending emails. Use a device instead\");\r\n\r\n\t\tif (true)//break point doesn't hit here\r\n\t\t{\r\n\t\t\talert(\"True Condition\");\r\n\t\t}\r\n\t\t\r\n\t\tif (false)//break point doesn't hit here\r\n\t\t{\r\n\t\t\talert(\"False condition \");\r\n\t\t}\r\n\t\t\r\n\t\tvar x = 1;\r\n\t\tvar y = 2;\r\n\t\tif ((x + y) == 3) //breakpoint will hit here\r\n\t\t{\r\n\t\t\talert(\"x+y calc\");\r\n\t\t}\r\n\t\t\r\n\t\tvar status = true;\r\n\t\tif (status == true) //breakpoint will hit here\r\n\t\t{\r\n\t\t\talert(\"status alert\");\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n}\r\n\r\n$.index.open();\r\n\r\n{code}", "updateAuthor": { "name": "kkolipaka", "key": "kkolipaka", "displayName": "Kondal Kolipaka", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-11-03T04:47:58.000+0000", "updated": "2015-11-03T04:49:46.000+0000" }, { "id": "371432", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi. The test sample is *not valid*. \r\n1. There's no sensible reason why anyone would do {{if(true)}}\r\n2. I just tested this natively on Xcode. if I write the below native code\r\n{code}\r\nif (YES) {\r\n NSLog(@\"hello Jay!\"); \r\n}\r\n{code}\r\nand set the breakpoint at {{if(YES)}}. The behavior is the same, it *does not pause*, and goes to {{NSLog(@\"hello Jay\");}}\r\nOur debugger actually relies on Xcode Objective C behavior, so there's nothing we can do.\r\n\r\nBut as Kondal has explained above, it makes sense that Xcode ignores the break points for if conditions where condition value is already known at build time.\r\n\r\nThe below native code is valid and the breakpoint will pause on the if statement:\r\n{code}\r\n int x = 1;\r\n int y = 1;\r\n if (x + y == 2)\r\n {\r\n NSLog(@\"it's working\");\r\n }\r\n{code}\r\n\r\nI'm not sure why in this ticket only alloy sees this behavior, but i think the bigger question is, are we seeing problems hitting breakpoints on if blocks that does not do {{if (true)}} or {{if(false)}}. If so, please provide a valid reproducible case here.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-11-25T07:01:23.000+0000", "updated": "2015-11-25T07:07:15.000+0000" }, { "id": "371839", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I was able to reproduce this issue i.e:\r\n* If I add a breakpoint to {{if(true)}} or {{if(false)}} in an Alloy app, then the debugger will not hit those breakpoints.\r\n* If I add a breakpoint to {{if(true)}} or {{if(false)}} in a *Titanium classic app*, then the debugger *will hit* those breakpoints.\r\n* The two stated above behaviors occur with both iOS simulator *and* Android emulator.\r\n\r\nGiven that the bug behavior appears on Android, I tried setting a breakpoint at {{if(true)}} in a native Android project and observed the same behavior that [~cng] saw when debugging in native iOS; see native_android.png and native_android2.png attachments.\r\n\r\nAnd to go off of [~cng]'s last comment:\r\n# Is there a legitimate bug when using debugger with Titanium Classic apps?\r\n# Are Alloy apps being debugged properly?\r\n\r\n*Tested on:*\r\nAppcelerator Studio, build: 4.4.0.201511241829\r\nAppc CLI NPM: 4.2.2\r\nAppc CLI Core: 5.1.0\r\nArrow: 1.3.22\r\nSDK: 5.1.1.GA\r\nNode: v4.2.2\r\nOS: El Capitan (10.11.1)\r\nXcode: 7.1.1\r\nDevices: iphone simulator (9.1), genymotion emulator (4.4.4)\r\n", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-12-02T00:36:37.000+0000", "updated": "2015-12-02T00:37:24.000+0000" }, { "id": "381117", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello [~stoda] , the reason the breakpoint is not hit when placed on the {code}if (true) { {code} \r\nstatement is because if true will always be true. When alloy is ran it generates separate files , so when you're putting a breakpoint studio actually ties it to the equivalent line on the generated files. If something will always be true it won't get added to the files same with any variables that are created but not used. If you put the breakpoint on line underneath on the print statement it will get hit. ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-03-30T23:19:27.000+0000", "updated": "2016-03-30T23:19:45.000+0000" }, { "id": "441204", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR: https://github.com/appcelerator/alloy/pull/904\r\n\r\nLooks like white space between the lines cause source map mismatch.\r\n{code}\r\nfunction doClick(e) {\r\n\talert($.label.text);\r\n}\r\n\r\n\r\n$.index.open();\r\n\r\n\r\nfor (var i = 0; i < 4; i++) {\r\n\tconsole.log(\"Hello: \" + i); // add breakpoint here\r\n}\r\n\r\n{code}", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2018-08-29T20:21:11.000+0000", "updated": "2018-09-06T19:59:53.000+0000" }, { "id": "441580", "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-14T17:36:01.000+0000", "updated": "2018-09-14T17:36:01.000+0000" }, { "id": "442538", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in 7.0.7-master.9.\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-11T18:48:14.000+0000", "updated": "2018-10-11T18:48:14.000+0000" } ], "maxResults": 25, "total": 25, "startAt": 0 } } }