{ "id": "173677", "key": "TIMOB-27104", "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": "20845", "name": "Release 8.1.1", "archived": false, "released": true, "releaseDate": "2019-08-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-08-23T04:57:13.000+0000", "created": "2019-05-28T11:41:51.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ProgressIndicator", "android", "close", "dialog", "engSchedule", "exception", "hide" ], "versions": [ { "id": "20791", "name": "Release 8.0.2", "archived": false, "released": true, "releaseDate": "2019-06-18" } ], "issuelinks": [ { "id": "57722", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "173806", "key": "TIMOB-27183", "fields": { "summary": "Android: SKD 8.0.2.GA, 8.0.1.GA has Window Leaks.", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-08-23T04:57:13.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": "*Summary:*\r\nAs of Titanium 8.0.2, hiding a {{Ti.UI.Android.ProgressIndicator}} and closing its parent window at the same time will log a \"WindowLeaked\" exception.\r\n\r\nThis is not a crash. Nothing harmful occurs.\r\nThis is merely an unsightly exception stack trace error that occurs in the log.\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below code on Android.\r\n# Tap on the \"Show Progress Dialog\" button.\r\n# Wait 2 seconds for the progress dialog and its window to close.\r\n# Observe the log.\r\n\r\n{code:javascript}\r\nvar progressIndicator = Ti.UI.Android.createProgressIndicator({\r\n\tmessage: \"Progressing...\",\r\n\tlocation: Ti.UI.Android.PROGRESS_INDICATOR_DIALOG,\r\n\ttype: Ti.UI.Android.PROGRESS_INDICATOR_INDETERMINANT,\r\n\tcancelable: false,\r\n\tpersistent: true,\r\n});\r\n\r\nvar window = Ti.UI.createWindow();\r\nvar button = Ti.UI.createButton({ title: \"Show Progress Dialog\" });\r\nbutton.addEventListener(\"click\", function(e) {\r\n\tvar childWindow = Ti.UI.createWindow({ title: \"Child Window\" });\r\n\tchildWindow.addEventListener(\"open\", function() {\r\n\t\tprogressIndicator.show();\r\n\t\tsetTimeout(function() {\r\n\t\t\tprogressIndicator.hide();\r\n\t\t\tchildWindow.close();\r\n// This works-around the problem.\r\n//\t\t\tsetTimeout(function() { childWindow.close(); }, 1);\r\n\t\t}, 2000);\r\n\t});\r\n\tchildWindow.open();\r\n});\r\nwindow.add(button);\r\nwindow.open();\r\n{code}\r\n\r\n*Result:*\r\nThe following gets logged when the progress dialog closes.\r\n{code}\r\n[ERROR] WindowManager: android.view.WindowLeaked: Activity org.appcelerator.titanium.TiActivity has leaked window DecorView@e74eabe[TiActivity] that was originally added here\r\n[ERROR] WindowManager: \tat android.view.ViewRootImpl.(ViewRootImpl.java:518)\r\n[ERROR] WindowManager: \tat android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346)\r\n[ERROR] WindowManager: \tat android.view.WindowManagerImpl.addView(WindowManagerImpl.java:94)\r\n[ERROR] WindowManager: \tat android.app.Dialog.show(Dialog.java:329)\r\n[ERROR] WindowManager: \tat ti.modules.titanium.ui.widget.TiUIProgressIndicator.handleShow(TiUIProgressIndicator.java:236)\r\n[ERROR] WindowManager: \tat ti.modules.titanium.ui.widget.TiUIProgressIndicator.show(TiUIProgressIndicator.java:146)\r\n[ERROR] WindowManager: \tat ti.modules.titanium.ui.android.ProgressIndicatorProxy.handleShow(ProgressIndicatorProxy.java:59)\r\n[ERROR] WindowManager: \tat org.appcelerator.titanium.proxy.TiViewProxy.show(TiViewProxy.java:765)\r\n[ERROR] WindowManager: \tat ti.modules.titanium.ui.TiDialogProxy.access$001(TiDialogProxy.java:29)\r\n[ERROR] WindowManager: \tat ti.modules.titanium.ui.TiDialogProxy$1.onCurrentActivityReady(TiDialogProxy.java:47)\r\n[ERROR] WindowManager: \tat org.appcelerator.titanium.util.TiUIHelper.waitForCurrentActivity(TiUIHelper.java:195)\r\n[ERROR] WindowManager: \tat ti.modules.titanium.ui.TiDialogProxy.show(TiDialogProxy.java:42)\r\n[ERROR] WindowManager: \tat org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)\r\n[ERROR] WindowManager: \tat org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63)\r\n[ERROR] WindowManager: \tat org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:978)\r\n[ERROR] WindowManager: \tat org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1207)\r\n[ERROR] WindowManager: \tat org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:266)\r\n[ERROR] WindowManager: \tat android.os.Handler.dispatchMessage(Handler.java:102)\r\n[ERROR] WindowManager: \tat android.os.Looper.loop(Looper.java:193)\r\n[ERROR] WindowManager: \tat android.app.ActivityThread.main(ActivityThread.java:6694)\r\n[ERROR] WindowManager: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[ERROR] WindowManager: \tat com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)\r\n[ERROR] WindowManager: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)\r\n{code}\r\n\r\n*Note:*\r\nThe error appears to be harmless. The exception is being caught and logged. The reason it is happening is because the dialog is being shown again in a destroyed activity window. Why the code is automatically calling its {{show()}} method again after hiding/closing is what we need to track down (this is the real bug; but our safety mechanisms are catching it).\r\n\r\n*Comment from Hans Knöchel:*\r\nWe suspect it being related to showing our [loader class|https://gist.github.com/hansemannn/20297e983e2b8c898975b600e7ab8418] that uses a {{Ti.UI.ActivityIndicator}}. This did not happen on earlier versions of the SDK.\r\n\r\n*Work-around:*\r\nInstead of hiding the dialog and closing its parent window back-to-back like this...\r\n{code:javascript}\r\nprogressIndicator.hide();\r\nchildWindow.close();\r\n{code}\r\n\r\nDelay closing the window after hiding the dialog like this...\r\n{code:javascript}\r\nprogressIndicator.hide();\r\nsetTimeout(function() { childWindow.close(); }, 1);\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: ProgressIndicator logs \"WindowLeaked\" exception when hiding dialog and closing window at same time as of 8.0.2", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 1160, "state": "closed", "name": "2019 Sprint 17", "startDate": "2019-08-12T07:59:28.950Z", "endDate": "2019-08-25T07:59:00.000Z", "completeDate": "2019-08-26T15:35:29.980Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "448679", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~jquick] This may be a regression of TIMOB-26978.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-05-28T11:43:41.000+0000", "updated": "2019-05-28T11:43:41.000+0000" }, { "id": "449486", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hknoechel], I suspect you can work-around this issue by changing the following code in your \"loader.js\" from this...\r\n{code:javascript}\r\nthis.activityIndicator.hide();\r\nresolve();\r\n{code}\r\n\r\n...to this...\r\n{code:javascript}\r\nthis.activityIndicator.hide();\r\nsetTimeout(() => {\r\n\tresolve();\r\n}, 1);\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-29T03:14:27.000+0000", "updated": "2019-06-29T03:14:27.000+0000" }, { "id": "449487", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I've confirmed that this issue was introduced in Titanium 8.0.2.\r\n\r\nTitanium 8.01 does *NOT* have this issue. This is curious since 8.0.1 has dialog code changes while 8.0.2 does not.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-29T03:18:14.000+0000", "updated": "2019-06-29T03:18:14.000+0000" }, { "id": "449817", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for the workaround Josh, I just saw it now. *EDIT*: Working fine for now, although every new timeout makes me a bit sad :P.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-07-15T19:08:12.000+0000", "updated": "2019-07-15T19:12:13.000+0000" }, { "id": "449822", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I believe this issue has always been happening.\r\nThe difference is that we're logging it now.\r\nBut I do agree that it is unsightly and should be corrected.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-15T19:33:34.000+0000", "updated": "2019-07-15T19:34:03.000+0000" }, { "id": "450411", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11115\r\nPR (8.1.x): https://github.com/appcelerator/titanium_mobile/pull/11142\r\nPR (8.3.x): https://github.com/appcelerator/titanium_mobile/pull/11143\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-13T00:49:34.000+0000", "updated": "2019-08-13T00:49:34.000+0000" }, { "id": "450655", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed on master, 8_1_X and 8_3_X. The progress indicator works as expected.\r\nWaiting for builds to pass.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-20T22:13:57.000+0000", "updated": "2019-08-20T22:13:57.000+0000" }, { "id": "450748", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Merged to master, 8_3_X. (had already been merged to 8_1_X)", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-08-22T18:42:58.000+0000", "updated": "2019-08-22T18:42:58.000+0000" }, { "id": "450763", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on sdk 8.3.0.v20190822115908,8.2.0.v20190822114913 and 8.1.1.v20190822103134.Progress indicator works as expected. Closing\r\n*Test Enviornment:*\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.14.5\r\n Architecture = 64bit\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 10.16.2\r\n npm Version = 6.9.0\r\nTitanium CLI\r\n CLI Version = 5.2.1\r\nTitanium SDK\r\n SDK Version = 8.2.0.v20190822114913\r\nDevice = One plus 5T android 9,samsung s5 android 6\r\nEmulator= pixel android 9,nexus android 8\r\n\r\n", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-08-23T04:57:00.000+0000", "updated": "2019-08-23T04:57:00.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }