{ "id": "172926", "key": "TIMOB-26774", "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": "20429", "name": "Release 7.5.1", "archived": false, "released": true, "releaseDate": "2019-02-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-02-12T18:37:15.000+0000", "created": "2019-01-28T20:28:55.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "Escalation", "android", "intent", "regression" ], "versions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-02-22T10:25:47.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\nIf the Android app's UI is in the background and you attempt to launch it via a data intent (aka: URL scheme, notification, or {{startActivity()}} intent), then the app's splash screen will be displayed but nothing will happen. This is a *regression* as of 7.5.0. Titanium 7.4.2 and older versions would re-execute the \"app.js\" in this case.\r\n\r\n*Cause:*\r\nWhat's happening is that a new UI activity stack is being created by the data intent while an existing UI stack already exists in the background. Titanium only supports running 1 JavaScript runtime at a time (does not support multiple JS runtimes). So, when the 2nd UI stack is displayed, it attempts to load the \"app.js\" when it was already loaded before.\r\n\r\nIn Titanium 7.4.2 and older versions, Titanium would re-execute the \"app.js\" for the JavaScript runtime, even though it was already loaded before. This was unintended behavior, but some app developers depend on this behavior.\r\n\r\nAs of 7.5.0, Titanium now loads a \"ti.main.js\" script on startup (our bootstrap script) and then loads the \"app.js\" via the {{require()}} function. But for the 2nd UI stack, since it's re-using an existing JavaScript runtime and the \"app.js\" was loaded before, the {{require()}} function won't re-execute the script and returns a cached module instead. This behavior is technically correct, but the old unexpected behavior is what's desired for Titanium 7.5.x.\r\n\r\n*Note:*\r\nAs of Titanium 8.0.0, the above is not an issue. Intent handling was refactored in 8.0.0 to guarantee that only one UI stack exists at a time. Data intents will instead resume the existing UI stack like how iOS works. See [TIMOB-26075] for more details.\r\n\r\n*Steps to reproduce:*\r\n# Create a classic Titanium app.\r\n# Set project name to \"IntentTest\". (This is {{}} in \"tiapp.xml\".)\r\n# Set project's \"Application Id\" to \"com.appc.intent.test\". (This is {{}} in \"tiapp.xml.)\r\n# Set up the \"app.js\" with the below code.\r\n# Build and run on Android.\r\n# Wait for the app to launch.\r\n# Open the Mac \"Terminal\" app.\r\n# CD (change directory) to: {{~/Library/Android/sdk/platform-tools}}\r\n# In the terminal, enter: {{./adb shell am start -n com.appc.intent.test/.IntenttestActivity -a android.intent.action.VIEW -d https://www.google.com -f 0x04000000}}\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar text = \"Hello World!\";\r\nif (Ti.Android) {\r\n\ttext += \"\\n\\nLaunch Intent:\\n\" + JSON.stringify(Ti.Android.currentActivity.intent);\r\n}\r\nwindow.add(Ti.UI.createLabel({\r\n\ttext: text,\r\n\twidth: Ti.UI.FILL,\r\n\theight: Ti.UI.SIZE,\r\n}));\r\nwindow.open();\r\n{code}\r\n\r\n*Result:*\r\nA new splash screen window instance is displayed, but doesn't show the window and label implemented via the \"app.js\" code.\r\n\r\n*Expected Result:*\r\nIt should re-execute the \"app.js\" when 2nd UI stack is displayed to maintain old behavior.\r\n\r\n----\r\n*Original Description*\r\n----\r\nUsing 7.5.0.GA, application gets stuck on the splash screen when navigating back from the TargetApp towards the SourceApp after having the TargetApp opened from the SourceApp. Using 7.4.2.GA, it was working fine.\r\n\r\nIf you make 2 apps use the code below and tap their buttons to launch the other app, you can reproduce this behavior.\r\n [^SourceApp.js] [^TargetApp.js] ", "attachment": [ { "id": "66133", "filename": "SourceApp.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-06T01:50:58.000+0000", "size": 663, "mimeType": "application/x-javascript" }, { "id": "66132", "filename": "TargetApp.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-06T01:50:59.000+0000", "size": 578, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: When backgrounded, data intent no longer re-executes \"app.js\" as of 7.5.0", "creator": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Microsoft Windows 8.1 Pro with Media Center\r\n Version = 6.3.9600\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 6298132480\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version = 7.4.2.GA/7.5.0.GA\r\n Target Platform = android", "closedSprints": [ { "id": 1112, "state": "closed", "name": "2019 Sprint 4", "startDate": "2019-02-11T16:16:38.316Z", "endDate": "2019-02-23T16:16:00.000Z", "completeDate": "2019-02-24T18:35:43.422Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "445869", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (7.5.x): https://github.com/appcelerator/titanium_mobile/pull/10678", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-06T02:54:10.000+0000", "updated": "2019-02-06T02:54:10.000+0000" }, { "id": "445976", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Awaiting on CR before merge. ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-11T15:49:41.000+0000", "updated": "2019-02-11T15:49:41.000+0000" }, { "id": "446249", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket* Fix verified in SDK Version {{7.5.1.v20190219102458}}.\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/10678", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-02-22T10:25:37.000+0000", "updated": "2019-02-22T10:25:37.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }