{ "id": "118645", "key": "TIMOB-14916", "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": "15646", "description": "2013 Sprint 18", "name": "2013 Sprint 18", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15690", "description": "2013 Sprint 18 API", "name": "2013 Sprint 18 API", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-08-21T23:01:31.000+0000", "created": "2013-08-16T08:40:54.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-03T08:57:48.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": "I just installed and switched my project from using 3.1.1GA to 3.1.2GA. And on Android device it appears everything works fine. However in the logcat window, I can see ENGLESSLY \"Window is closed normally\". \r\n\r\nI am sure I did not create a dead loop and create>open>close windows at the background. \r\n\r\nSo may I ask where could possibility be the reason causing such weird logs?\r\n\r\nBack in the titanium mobile source code, it appear to be from the window file.\r\n\r\n{code}\r\nvar _open = Window.prototype.open;\r\n\tWindow.prototype.open = function(options) {\r\n\t\t// Retain the window until it has closed.\r\n\t\tvar handle = new PersistentHandle(this);\r\n\r\n\t\tvar self = this;\r\n\t\tthis.on(\"close\", function(e) {\r\n\t\t\tif (e._closeFromActivityForcedToDestroy) {\r\n\t\t\t\tif (kroll.DBG) {\r\n\t\t\t\t\tkroll.log(TAG, \"Window is closed because the activity is forced to destroy by Android OS.\");\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Dispose the URL context if the window's activity is destroyed.\r\n\t\t\tif (self._urlContext) {\r\n\t\t\t\tScript.disposeContext(self._urlContext);\r\n\t\t\t\tself._urlContext = null;\r\n\t\t\t}\r\n\t\t\thandle.dispose();\r\n\r\n\t\t\tif (kroll.DBG) {\r\n\t\t\t\tkroll.log(TAG, \"Window is closed normally.\");\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t_open.call(this, options);\r\n\t}\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Endless \"Window is closed normally\" appear in the logcat.", "creator": { "name": "pantherqin", "key": "pantherqin", "displayName": "pantherqin", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pantherqin", "key": "pantherqin", "displayName": "pantherqin", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium 3.1.2GA", "comment": { "comments": [ { "id": "266848", "author": { "name": "pantherqin", "key": "pantherqin", "displayName": "pantherqin", "active": true, "timeZone": "America/Los_Angeles" }, "body": "sample code to simulate the issue:\nvar win = Titanium.UI.createWindow({\n width : '100%',\n height : '100%',\n backgroundColor : '#FF00FF',\n});\n\nwin.addEventListener(\"blur\", function(e) {\n win.close();\n});\n\nwin.open();\n\nsetTimeout(function() {\n win.close();\n}, 2000);\n\n\n\n\nObviously after win.close(), event \"blur\" is triggered. And it tried to close the window(which is already closed) again. \nThus a dead loop is formed. \n\nThis error never happened in 3.1.1 or 3.0.0.", "updateAuthor": { "name": "pantherqin", "key": "pantherqin", "displayName": "pantherqin", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-16T09:50:20.000+0000", "updated": "2013-08-16T09:50:20.000+0000" }, { "id": "267421", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/4587\nTest case is in the last comment. Please add {code}true{code} to the tiapp.xml to reproduce the fail case.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-20T23:29:36.000+0000", "updated": "2013-08-20T23:29:36.000+0000" }, { "id": "267441", "author": { "name": "pantherqin", "key": "pantherqin", "displayName": "pantherqin", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Does it mean if I set this value to \"false\" in tiapp.xml, the issue will go away?\r\nI am using 3.1.2GA.\r\n\r\nI mean just as a temporary fix.", "updateAuthor": { "name": "pantherqin", "key": "pantherqin", "displayName": "pantherqin", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-21T03:58:58.000+0000", "updated": "2013-08-21T03:58:58.000+0000" }, { "id": "267494", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~pantherqin], don't worry about that if you use 3.1.x. The \"ti.android.useLegacyWindow\" property will be introduced in 3.2.0. My last comment is just for the tester since the issue is only for LW windows and my PR is against the master branch.\r\nBTW, this fix will be also in 3.1.3.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-21T17:21:47.000+0000", "updated": "2013-08-21T17:23:46.000+0000" }, { "id": "267496", "author": { "name": "pantherqin", "key": "pantherqin", "displayName": "pantherqin", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Alright. Got it. Thanks :-)", "updateAuthor": { "name": "pantherqin", "key": "pantherqin", "displayName": "pantherqin", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-21T17:30:21.000+0000", "updated": "2013-08-21T17:30:21.000+0000" }, { "id": "267550", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/4587", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-21T23:01:19.000+0000", "updated": "2013-08-21T23:01:19.000+0000" }, { "id": "267630", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4596", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-22T17:11:46.000+0000", "updated": "2013-08-22T17:11:46.000+0000" }, { "id": "267798", "author": { "name": "djha", "key": "djha", "displayName": "Dhirendra Jha", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Used the below environment to verify this issue - \nAppcelerator Studio: 3.1.3.201308201707\nTitanium SDK: 3.1.3.v20130822140128\nacs: 1.0.6\nalloy: 1.2.1-cr\nnpm: 1.3.2\ntitanium: 3.1.2\ntitanium-code-processor: 1.0.2\nDevices: Nexus 7 (v4.3, v4.2.1), Nexus 4 (v4.0.4), Galaxy Note (v2.3.6)\n\nTested Below -\n1) Reproduced this issues using the code mentioned with 3.1.2.GA build.\n2) Used the same code with build 3.1.3.v20130822140128. Message \"Window is closed normally\" appears only one time in logcat. Its working fine in this build.\n\nSo this issue is no more reproducible using the 3.1.3.v20130822140128 build. Hence closing this issue. \n", "updateAuthor": { "name": "djha", "key": "djha", "displayName": "Dhirendra Jha", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-23T08:34:55.000+0000", "updated": "2013-08-23T08:34:55.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }