{ "id": "130432", "key": "AC-1599", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-05-15T18:48:00.000+0000", "created": "2014-05-14T19:22:48.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:38:04.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "{code}\r\nalert('Hello 1');\r\n\r\n(function (){\r\n alert('Hello 2');\r\n})();\r\n\r\nalert('Hello 3');\r\n\r\n(function (){\r\n alert('Hello 4');\r\n})();\r\n\r\nalert('Hello 5');\r\n{code}\r\n\r\nIn Classic project all the messages are shown in opposite order:\r\n'Hello 5', 'Hello 4', 'Hello 3', 'Hello 2', 'Hello 1'.\r\n\r\nIn Alloy project the same code shows the last message ('Hello 5') *only*.", "attachment": [], "flagged": false, "summary": "Some parts of initialization code are not executed in Alloy project ", "creator": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "subtasks": [], "reporter": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "environment": "Windows 7, 3.2.3.GA, Android", "comment": { "comments": [ { "id": "305057", "author": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "body": "Below is one more test case. The same as before, the 'Classic' project shows all the messages but *in strange order*: 'Hello 5', 'Hello 4', 'Hello 3', 'Hello 2', 'Hello 1'.\r\nAlloy project shows the last message ('Hello 5') *only*.\r\n\r\n*Take a look, please.*\r\n\r\n{code}\r\n(function() {\r\n\r\nalert('Hello 1');\r\n\r\n(function (){\r\n alert('Hello 2');\r\n})();\r\n\r\nalert('Hello 3');\r\n\r\n(function (){\r\n alert('Hello 4');\r\n alert('Hello 5');\r\n})();\r\n\r\n}());\r\n{code}", "updateAuthor": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "created": "2014-05-15T13:53:33.000+0000", "updated": "2014-05-15T13:53:33.000+0000" }, { "id": "305071", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Where do you have this code? In a controller, lib or alloy.js? And what does the compiled code looks like?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-05-15T14:59:03.000+0000", "updated": "2014-05-15T14:59:03.000+0000" }, { "id": "305089", "author": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "body": "{quote}\r\nWhere do you have this code? In a controller, lib or alloy.js?\r\n{quote}\r\nI've just created a new test Alloy project from the scratch in order to re-check the issue once again.\r\n\r\nh3. Case 1.\r\n*index.js* is empty.\r\n*alloy.js* is as follows:\r\n{code}\r\n(function() {\r\n\r\nalert('Hello from alloy.js 1');\r\n\r\n(function (){\r\n alert('Hello from alloy.js 2');\r\n})();\r\n\r\nalert('Hello from alloy.js 3');\r\n\r\n(function (){\r\n alert('Hello from alloy.js 4');\r\n alert('Hello from alloy.js 5');\r\n})();\r\n\r\n}());\r\n{code}\r\n\r\nh4. The result:\r\nHello from alloy.js 5\r\nHello from alloy.js 4\r\nHello from alloy.js 3\r\nHello from alloy.js 2\r\nHello from alloy.js 1\r\n", "updateAuthor": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "created": "2014-05-15T16:17:10.000+0000", "updated": "2014-05-15T16:17:10.000+0000" }, { "id": "305091", "author": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "body": "\r\nh3. Case 2.\r\n*alloy.js* is empty.\r\n*index.js* is as follows:\r\n{code}\r\n(function() {\r\n\r\nalert('Hello from index.js 1');\r\n\r\n(function (){\r\n alert('Hello from index.js 2');\r\n})();\r\n\r\nalert('Hello from index.js 3');\r\n\r\n(function (){\r\n alert('Hello from index.js 4');\r\n alert('Hello from index.js 5');\r\n})();\r\n\r\n}());{code}\r\n\r\nh4. The result:\r\nHello from index.js 5\r\nHello from index.js 4\r\nHello from index.js 3\r\nHello from index.js 2\r\nHello from index.js 1\r\n", "updateAuthor": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "created": "2014-05-15T16:24:21.000+0000", "updated": "2014-05-15T16:25:02.000+0000" }, { "id": "305094", "author": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "body": "\r\nh3. Case 3.\r\n*alloy.js* is empty.\r\n*index.js* is as follows (note, $.index.open() is added this time):\r\n{code}\r\n(function() {\r\n\r\nalert('Hello from index.js 1');\r\n\r\n(function (){\r\n alert('Hello from index.js 2');\r\n})();\r\n\r\nalert('Hello from index.js 3');\r\n\r\n(function (){\r\n alert('Hello from index.js 4');\r\n alert('Hello from index.js 5');\r\n})();\r\n\r\n$.index.open();\r\n\r\n}());{code}\r\n\r\nh4. The result:\r\nHello from index.js 5\r\n\r\n", "updateAuthor": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "created": "2014-05-15T16:39:05.000+0000", "updated": "2014-05-15T16:39:05.000+0000" }, { "id": "305095", "author": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "body": "\r\nh3. Case 4.\r\n*alloy.js* is as follows:\r\n{code}\r\n(function() {\r\n\r\nalert('Hello from alloy.js 1');\r\n\r\n(function (){\r\n alert('Hello from alloy.js 2');\r\n})();\r\n\r\nalert('Hello from alloy.js 3');\r\n\r\n(function (){\r\n alert('Hello from alloy.js 4');\r\n alert('Hello from alloy.js 5');\r\n})();\r\n\r\n}());\r\n{code}\r\n\r\n*index.js* is as follows:\r\n{code}\r\n(function() {\r\n\r\nalert('Hello from index.js 1');\r\n\r\n(function (){\r\n alert('Hello from index.js 2');\r\n})();\r\n\r\nalert('Hello from index.js 3');\r\n\r\n(function (){\r\n alert('Hello from index.js 4');\r\n alert('Hello from index.js 5');\r\n})();\r\n\r\n$.index.open();\r\n\r\n}());{code}\r\n\r\nh4. The result:\r\nHello from index.js 5\r\n", "updateAuthor": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "created": "2014-05-15T16:43:39.000+0000", "updated": "2014-05-15T16:43:39.000+0000" }, { "id": "305149", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The comparison here was poorly defined. The behavior between classic titanium and alloy is the same. Notice in your example everything works as expected until you add {{$.index.open()}}. If you create an equivalent classic titanium example, which augments your test case in the following way:\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow();\r\n\r\nalert('Hello 1');\r\n \r\n(function (){\r\n alert('Hello 2');\r\n})();\r\n \r\nalert('Hello 3');\r\n \r\n(function (){\r\n alert('Hello 4');\r\n})();\r\n \r\nalert('Hello 5');\r\n\r\nwin.open();\r\n{code}\r\n\r\nThe classic example behaves in the exact same way as alloy, showing only the last alert of {{alert('Hello 5')}}. This is behavior in Android that kills the pending alerts because a new activity is being opened when you open the main windows, which is {{win}} in the classic case, {{$.index}} in the alloy case. There is no disparity between alloy and titanium. ", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-15T18:48:00.000+0000", "updated": "2014-05-15T18:48:00.000+0000" }, { "id": "305151", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Additional note: if it is important to you that you be able to queue large amounts of alert() calls even when a new Android activity is opened, you could request that this be reopened and moved to the TIMOB project, as it has nothing to do with Alloy. TBH though, I would imagine this might not get much love since it is an extremely impractical use case. Entirely up to you whether to pursue though, if you can make a case for it.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-15T18:51:12.000+0000", "updated": "2014-05-15T18:51:12.000+0000" }, { "id": "305363", "author": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "body": "{quote}\r\nyou could request that this be reopened and moved to the TIMOB project\r\n{quote}\r\nNo, thanks.", "updateAuthor": { "name": "fixplease", "key": "fixplease", "displayName": "Fix Please", "active": true, "timeZone": "Europe/Luxembourg" }, "created": "2014-05-16T21:13:17.000+0000", "updated": "2014-05-16T21:13:17.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }