{ "id": "113022", "key": "TIMOB-13606", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-07-13T18:29:07.000+0000", "created": "2013-04-17T20:38:54.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" } ], "issuelinks": [ { "id": "27891", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "112701", "key": "MOD-1356", "fields": { "summary": "Nfc: Example applications lose NDEF message contents", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-07-13T18:29:07.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" }, { "id": "12305", "name": "Core", "description": "Central component of the Platform (outside of Tooling, or platform specific implementation details)" } ], "description": "Android modules that declare properties using the 'propertyAccessors' annotation will lose the ability for javascript to access those properties after the main activity is closed under certain circumstances. Custom properties are not affected by this issue.\r\n\r\nI have been able to reproduce this with a very simple module:\r\n\r\nAttached is a reproduction case. It's a simple module that declares a proxy ('exampleProxy') and that proxy has a propertyAccessor ('name') as well as a custom property ('phone').\r\n\r\nThe app.js in the example folder demonstrates the issue:\r\n1. Unzip the module\r\n2. Build the module ('ant')\r\n3. Create a new Titanium application in Studio\r\n4. Copy the app.js from the module's example folder into your application\r\n5. Run the application\r\n6. Notice that the label displays 'Jeff 555-1212'. The 'Jeff' comes from the propertyAccessor and the '555-1212' comes from the custom property.\r\n7. Hit the Android Back button (the activity closes but the process is still active)\r\n8. Tap on the application in the Android app launcher\r\n9. Notice that the label displays 'undefined 555-1212'. You can also see the 'E/Proxy ( 2221): Unable to lookup Proxy.prototype.getProperty' error message in the log.\r\n\r\nFor further weirdness, uncomment lines 29-31 in the app.js file and re-run steps 5-8 again. This time you will notice that everything works correctly. The only difference here is that a 2nd instance of the proxy is being created with a call from JS rather than the one that is being created internally.\r\n\r\nA couple of observations:\r\n1. The onStop and onDestroy methods are getting called when the activity closes (check the messages output to the log file)\r\n2. The process is still active after closing the activity\r\n3. On the 2nd launch of the main activity you will notice a log message that it is registering an existing module again even though the module was supposedly destroyed. Probably expected behavior, but perhaps not.\r\n\r\nI've tried a number of different things but have not been able to change this behavior. I also tried 'exitOnClose: true' and 'exitOnClose: false' with no change in behavior.\r\n\r\nI've confirmed that the module is creating the proxy and calling setProperty on the 'name' property, but for some reason the 'name' property does not make its way back up to javascript land (ie. the application). Other properties that are defined with Kroll.getProperty are still accessible. It's just those defined in the propertyAccessors that are getting lost.\r\n\r\nThinking that perhaps something in the way propertyAccessors are bound is not occurring the 2nd time the module is loaded by the process.\r\n", "attachment": [ { "id": "37584", "filename": "property.zip", "author": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "created": "2013-04-17T20:38:54.000+0000", "size": 15040, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: propertyAccessors lost after closing main activity", "creator": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "environment": "Titanium SDK 3.0.2.GA, 3.1.0.GA, 2.1.3.GA\r\nAndroid Emulator and device", "comment": { "comments": [ { "id": "248003", "author": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "body": "Custom properties do not exhibit this issue.", "updateAuthor": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "created": "2013-04-17T20:47:34.000+0000", "updated": "2013-04-17T20:47:34.000+0000" }, { "id": "424095", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket due to time passed and lack of progress for a number of years. Please open a new ticket if there are any problems.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-13T18:29:07.000+0000", "updated": "2017-07-13T18:29:07.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }