{ "id": "173836", "key": "TIMOB-27206", "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": "2019-07-02T19:52:43.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "alloy", "engSchedule", "liveview" ], "versions": [], "issuelinks": [ { "id": "58368", "type": { "id": "10620", "name": "Gantt End to End", "inward": "has to be finished together with", "outward": "has to be finished together with" }, "outwardIssue": { "id": "175014", "key": "TIMOB-27899", "fields": { "summary": "Common: path.parse with a file extension but no directory results in an invalid dir value", "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" } }, "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": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "updated": "2021-02-22T20:01:37.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": "SDK: 8.0.2.GA\r\nTitanium: 5.2.1\r\nAlloy: 1.14.0-1\r\n--------------------------------\r\n\r\nUPDATE: Upon further investigation, I've found that it is more than just Alloy.Globals that is being affected by this. Every time alloy is required using `require()` it is getting a fresh version so any changes that were made to the same module in a different class are lost. \r\n\r\nrequire('/alloy') on index.js gets a clean version and thus all changes made in alloy.js are gone. Even if I move all the logic of assigning things to Alloy.Globals to index.js, everything added is gone when the next controller is loaded.\r\n\r\nI have a stand-alone project that I can share to duplicate this issue.\r\n\r\n--------------------------------\r\nWhen defining an event handler function in alloy.js:\r\n\r\n\r\n{code:java}\r\nAlloy.Globals.eventHandler = e => {\r\n\tconsole.error('you are here → Alloy.Globals.eventHandler1');\r\n\talert('button clicked 1');\r\n}\r\n\r\n{code}\r\n\r\nand then using it in index.xml:\r\n\r\n\r\n{code:xml}\r\n