{ "id": "125438", "key": "TIMOB-16352", "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": null, "resolutiondate": null, "created": "2014-01-27T07:30:33.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "liveview", "supportTeam" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" }, { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:29.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "13600", "name": "LiveView", "description": "Live preview of Titanium apps" } ], "description": "When a change triggers LiveView to reload the app, app events like {{Ti.App.resumed}} or {{Ti.Gesture.orientationchange}} are not cleaned up and fire for once each time the app has been reloaded.\r\n\r\nh1. To reproduce\r\nRun the following app with LiveView enabled and follow the steps on the screen:\r\n\r\n{code}\r\nvar run = Ti.App.Properties.getInt('run', 0);\r\nrun++;\r\nTi.App.Properties.setInt('run', run);\r\n\r\nfunction logEvent(e) {\r\n\tconsole.log(e.type + ' #' + run);\r\n}\r\n\r\nTi.App.addEventListener('resumed', logEvent);\r\nTi.Gesture.addEventListener('orientationchange', logEvent);\r\n\r\nvar win = Ti.UI.createWindow({ \r\n backgroundColor:'#fff'\r\n});\r\n\r\nwin.add(Ti.UI.createLabel({\r\n\ttext: '1. Change something to trigger LiveView to restart the app.\\n'\r\n\t\t+ '2. Move app to background and then resume.\\n'\r\n\t\t+ '3. Change orientation.\\n'\r\n\t\t+ '4. Check logs.\\n'\r\n\t\t+ '5. Confirm that you see each event triggered twice.'\r\n}));\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "LiveView: App events are not cleared on reload", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Latest stable Appcelerator Studio & LiveView\r\nSDK 3.2.0.GA", "comment": { "comments": [ { "id": "289932", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tried the test case with LiveView enabled but for some reason I am not seeing any orientationchange or resumed event. It is a little strange as I see the same behavior with or without LiveView. I will try on another device tomorrow.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-28T05:55:22.000+0000", "updated": "2014-01-28T05:55:22.000+0000" }, { "id": "289943", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Well, that would be very strange indeed. I did the test on iOSSimulator, using the menu options to rotate and shake the device.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-28T07:18:40.000+0000", "updated": "2014-01-28T07:18:40.000+0000" }, { "id": "290578", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering as I can reproduce this issue with Appcelerator Studio 3.2.0 and LiveView.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-31T04:31:17.000+0000", "updated": "2014-01-31T04:31:17.000+0000" }, { "id": "290597", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I think it's even wider then App events, it's any non-UI event listeners, also on custom modules. So it might even mean these modules are never cleared as well?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-31T07:20:35.000+0000", "updated": "2014-01-31T07:20:35.000+0000" }, { "id": "291088", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Why backlog? IMHO this stops LiveView from being usable in any serious app using non-ui event listeners.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-02-04T07:32:20.000+0000", "updated": "2014-02-04T07:32:20.000+0000" }, { "id": "366496", "author": { "name": "TanelK", "key": "tanelk", "displayName": "Tanel Kollamaa", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm having the same issue with Ti.App.fireEvent/addEventListener events and also with the facebook module's login/logout events. ", "updateAuthor": { "name": "TanelK", "key": "tanelk", "displayName": "Tanel Kollamaa", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-12T10:53:58.000+0000", "updated": "2015-10-12T10:53:58.000+0000" }, { "id": "369553", "author": { "name": "ivotoby", "key": "ivotoby", "displayName": "Ivo Toby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I was hoping for a temporary workaround by detecting a reload from liveView but so far no succes. This issue makes liveView pretty useless", "updateAuthor": { "name": "ivotoby", "key": "ivotoby", "displayName": "Ivo Toby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-11-10T14:50:16.000+0000", "updated": "2015-11-10T14:50:16.000+0000" }, { "id": "369554", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "The issue is complex because apart from core-APIs firing global events, there could also be modules.\r\n\r\nThe workaround is:\r\n\r\n* Use the {{close}} event on Windows\r\n* You can check if LiveView is active with {{if (localeStrings) ..}}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-10T14:57:06.000+0000", "updated": "2015-11-10T14:57:06.000+0000" }, { "id": "434637", "author": { "name": "mark.henderson@snagr.co.uk", "key": "mark.henderson@snagr.co.uk", "displayName": "Mark Henderson", "active": true, "timeZone": "Europe/London" }, "body": "This seriously affects the ability to use LiveView on Android. Since the app is re-loaded effectively, can't all App.addEventListener and App.fireEvent's be reset?", "updateAuthor": { "name": "mark.henderson@snagr.co.uk", "key": "mark.henderson@snagr.co.uk", "displayName": "Mark Henderson", "active": true, "timeZone": "Europe/London" }, "created": "2018-02-20T05:26:20.000+0000", "updated": "2018-02-20T05:26:20.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }