{ "id": "128085", "key": "TIMOB-16688", "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": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-08-19T23:38:11.000+0000", "created": "2014-03-25T00:28:18.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "APP-767561", "module_android", "parity", "qe-manualtest", "supportTeam" ], "versions": [ { "id": "15857", "description": "Release 3.2.2", "name": "Release 3.2.2", "archived": false, "released": true, "releaseDate": "2014-03-09" } ], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-08-19T23:38:11.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": "h6.Issue description\r\nApp is using application level events to communicate with WebViews - by using calls to Ti.App.fireEvent() and Ti.App.addEventListener().\r\n\r\nhttp://docs.appcelerator.com/titanium/3.0/#!/guide/Communication_Between_WebViews_and_Titanium-section-29004919_CommunicationBetweenWebViewsandTitanium-Ti.AppEvents\r\n\r\nh6.Steps to reproduce\r\n# Grab app.js and logging.html\r\n# Click webView \"fromWebView\" button. Alert shows message.\r\n# Click app \"fromTitanium\" button. Message displayed as expected.\r\n# Click \"cleanUp\" button. Alert fires message. \r\n# If you click twice the console message shows TiViewProxy released although function keeps listening event.\r\n\r\n_Android monitor_\r\n{code}\r\n03-24 18:22:48.531: E/TiViewProxy(12371): (KrollRuntimeThread) [102323,132456] Add called with null child\r\n{code} \r\n\r\nIf you attempt to run it on iOS, event listener isn't available after a second time _Studio output_\r\n{code}\r\n[INFO] : Application started\r\n[INFO] : TiAppEvents/1.0 (3.2.2.GA.96e9a07)\r\n[DEBUG] : Loading: /Users/egomez/Library/Application Support/iPhone Simulator/7.1/Applications/CD516444-41E2-4BEE-BACD-ADEE0049F7ED/TiAppEvents.app/_app_props_.json, Resource: _app_props__json\r\n[DEBUG] : Application booted in 122.496009 ms\r\n[DEBUG] : New scheme: { URL: file:///Users/egomez/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/CD516444-41E2-4BEE-BACD-ADEE0049F7ED/TiAppEvents.app/logging.html }\r\n[DEBUG] : Loading: /Users/egomez/Library/Application Support/iPhone Simulator/7.1/Applications/CD516444-41E2-4BEE-BACD-ADEE0049F7ED/TiAppEvents.app/logging.html, Resource: logging_html\r\n[DEBUG] : Firing app event: app:fromTitanium\r\n[ERROR] : Script Error {\r\n[ERROR] : backtrace = \"#0 () at :0\";\r\n[ERROR] : line = 93;\r\n[ERROR] : message = \"Invalid type passed to function\";\r\n[ERROR] : nativeLocation = \"-[TiViewProxy remove:] (TiViewProxy.m:225)\";\r\n[ERROR] : nativeReason = \"expected: TiViewProxy, was: NSNull\";\r\n[ERROR] : sourceId = 267172160;\r\n[ERROR] : sourceURL = \"file:///Users/egomez/Library/Application%20Support/iPhone%20Simulator/7.1/Applications/CD516444-41E2-4BEE-BACD-ADEE0049F7ED/TiAppEvents.app/app.js\";\r\n[ERROR] : }\r\n{code}\r\n\r\n\r\n*Cleanup* is called when developer want to dispose of the webview that was added to the view. That last Ti.App.removeEventListener(\"app:fromTitanium\", fromTitanium); fails to work though since the fromTitanium function actually sits in the webView. All we want to do is ensure that the fromTitanium event listener added to the webview is removed once the webview is destroyed.\r\n\r\n", "attachment": [ { "id": "46829", "filename": "app.js", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-25T00:28:18.000+0000", "size": 1238, "mimeType": "text/javascript" }, { "id": "46830", "filename": "logging.html", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-03-25T00:28:18.000+0000", "size": 349, "mimeType": "text/html" } ], "flagged": false, "summary": "Android: Titanium Application events firing after WebView is destroyed", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Android API Level 11 - 18 ", "closedSprints": [ { "id": 121, "state": "closed", "name": "2014 Sprint 12 SDK", "startDate": "2014-06-09T21:51:17.043Z", "endDate": "2014-06-21T00:00:00.000Z", "completeDate": "2014-06-23T16:52:29.621Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "306996", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-30T13:36:18.000+0000", "updated": "2014-06-04T23:42:51.000+0000" }, { "id": "319373", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\nTitanium Application events do not fire after WebView is destroyed.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 3.4.0.201408180158\r\nTi SDK : 3.4.0.v20140815142514\r\nMac OSX : 10.8.5\r\nAlloy : 1.5.0-dev\r\nCLI - 3.4.0-dev\r\nCode Processor: 1.1.1\r\nNexus 5 - android 4.4.4", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-19T22:55:44.000+0000", "updated": "2014-08-19T22:55:44.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }