{ "id": "147316", "key": "TIMOB-18892", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2019-12-11T19:00:30.000+0000", "created": "2015-04-27T10:52:57.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "alert", "called", "calling", "event", "focus", "infinite", "times", "window" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2019-12-11T19:00:30.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When the alert function is called on window focus event the that alert function gets called infinite times, this is because window focus events gets on calling infinite times.\r\n\r\nAnother problem is window focus event should not call on calling alert or alertDialog.show()\r\n\r\nTest the code on iOS simulator or device to reproduce bug.\r\n\r\nBelow is the code to test the bug, window focus event should not get called infinite times when alert code is written on window focus event.\r\n\r\nCase 1:\r\n\r\nvar win1 = Titanium.UI.createWindow({\r\n\tbackgroundColor : 'red',\r\n\ttitle : 'Red Window',\r\n});\r\n\r\nvar navWin = Titanium.UI.iOS.createNavigationWindow({\r\n\twindow : win1\r\n});\r\n\r\n\r\nwin1.addEventListener(\"focus\",function(e){\r\n\talert(\"hello\");\r\n\tTi.API.info(\"Focus on first window\");\r\n});\r\n\r\nnavWin.open(); \r\n\r\n\r\nCase 2:\r\nvar win1 = Titanium.UI.createWindow({\r\n\tbackgroundColor : 'red',\r\n\ttitle : 'Red Window',\r\n});\r\n\r\nvar navWin = Titanium.UI.iOS.createNavigationWindow({\r\n\twindow : win1\r\n});\r\n\r\n\r\nvar dialog = Ti.UI.createAlertDialog({\r\n cancel: 1,\r\n buttonNames: ['Confirm', 'Cancel'],\r\n message: 'demo alert dialog?',\r\n title: 'Window Option'\r\n });\r\n \r\n \r\n\r\nwin1.addEventListener(\"focus\",function(e){\r\n\tdialog.show();\r\n\tTi.API.info(\"Focus on first window\");\r\n});\r\n\r\nnavWin.open(); \r\n\r\nYou can copy the cases in app.'s file and test the same. You can also check the debug logs which shows focus event is continuously firing.\r\n\r\nAttached are the files for both the test cases.\r\n\r\nExecute the code to find the bug.", "attachment": [ { "id": "55127", "filename": "case1.js", "author": { "name": "moizchhatriwala", "key": "moizchhatriwala", "displayName": "MoizChhatriwala", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-27T10:50:37.000+0000", "size": 286, "mimeType": "application/x-javascript" }, { "id": "55126", "filename": "case2.js", "author": { "name": "moizchhatriwala", "key": "moizchhatriwala", "displayName": "MoizChhatriwala", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-27T10:50:37.000+0000", "size": 454, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "iOS: alert or AlertDialog.show on window focus event is called infinite times.", "creator": { "name": "moizchhatriwala", "key": "moizchhatriwala", "displayName": "MoizChhatriwala", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "moizchhatriwala", "key": "moizchhatriwala", "displayName": "MoizChhatriwala", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Tested in titanium SDK 3.5.1 with code written in titanium classic pattern. Same issue also exist on titanium 4.0.0 Beta 2", "comment": { "comments": [ { "id": "351142", "author": { "name": "moizchhatriwala", "key": "moizchhatriwala", "displayName": "MoizChhatriwala", "active": true, "timeZone": "America/Los_Angeles" }, "body": "When this issue will get fixed Up ?", "updateAuthor": { "name": "moizchhatriwala", "key": "moizchhatriwala", "displayName": "MoizChhatriwala", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-29T14:13:58.000+0000", "updated": "2015-04-29T14:13:58.000+0000" }, { "id": "453150", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing. Unable to reproduce the issue.\r\n\r\nAxway Appcelerator Studio, build: 5.1.4.201909061933 \r\nmacOS : 10.15\r\nNode.js Version : 8.9.1\r\nnpm Version : 5.5.1\r\nAppcelerator CLI : 7.1.2\r\nTitanium CLI\r\nCLI Version : 5.2.1\r\nnode-appc Version : 0.2.49\r\nTitanium SDKs : 8.3.0.GA\r\niPhone 11 13.2.2\r\n", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-11T19:00:30.000+0000", "updated": "2019-12-11T19:00:30.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }